header { package = #test#, import = #vendingMachine.*# } // This file includes the schema used for the following paper: // Test Suite Selection Based on Traceability Annotations - Tool demonstration // Definition of groups which add coins to the vending machine groupheader {testCategory = #NominalValues#} group validCoins { values = [10,25,100]; } groupheader {testCategory = #RobustnessValues#} group invalidCoins { values = [20,50,200]; } group Coins { values = [@validCoins, @invalidCoins]; } // Please note the various combinations of the tags in the next three groups groupheader {comment = #InsufficientAmount#, testCategory = #RobustnessOps#} group addLessThan90 { vm.coin([10,25]){0,3}; } groupheader {comment = #SufficientAmount#, testCategory = #NominalOps#} group addAtLeast90 { vm.coin(25){3}; vm.coin(10); vm.coin(@validCoins); } groupheader {comment = #SufficientAmount#, testCategory = #RobustnessOps#} group add90AndMore { vm.coin(100); vm.coin(@validCoins); } group addCoins { vm.coin(@Coins){2} | @addLessThan90 | @addAtLeast90 | @add90AndMore } // Then groups which refill the vending machine groupheader {testCategory = #NominalOps#} group validRefill{ vm.addChoc(["Belgian","Swiss"]); } groupheader {comment = #Empty vending machine#} group invalidRefill0{ vm.getStock(); // It is necessary to put at least one operation in the group. // So the absence of call to addChoc is replaced by a call to another method; // One could have called skip() if it was present in the class. } groupheader {comment = #Full vending machine#} group invalidRefill11{ vm.addChoc(["Belgian"]){11}; } groupheader {testCategory = #RobustnessOps#} group invalidRefill{ @invalidRefill0 | @invalidRefill11 } group Refill { @validRefill | @invalidRefill } // Finally a schema which uses all these groups and unfolds into 228 test cases group buyChocolate[us=true] { VendingMachine vm = new VendingMachine(); @Refill; @addCoins; StringBuffer res = new StringBuffer("xx"); vm.getChoc(res); vm.getStock(); vm.getCredit(); } // Selectors ================= // groupheader { comment = # The HeaderCombinations selector is used here with its default constructor, i.e. all tags are taken into account.#} selector tagCombAllSelection [lang=java,file=HeaderCombinationsSelector.class] // Groups with selection ============== groupheader {comment = #This will select a subset of the test suite on the basis of the tags. All tags are considered in this case.#} selectorgroup tagsCombAllSelection_buyChoc [groupid=buyChocolate, selectorid=tagCombAllSelection, us=true]