The source code for the slice on totalTruffles at line 36, S(totalTruffles, 36), is
The source code for the slice on totalTruffles at line 36, S(totalTruffles, 36), is
repeated here:
1 private static double updateShoppingCart() {
2 double trufflePrice = 12.50;
5 double truffleSales = 0.0;
8 double totalSales = 0.0;
9 int totalTruffles = 0;
12 String message = "";
13 String event;
Table 9.4 Selected Program Slicing Tools
Tool/Product Language Static/dynamic?
Kamkar Pascal Dynamic
Spyder ANSI C Dynamic
Unravel ANSI C Static
CodeSonar® C, C++ Static
Indus/Kaveri Java Static
JSlice Java Dynamic
SeeSlice C Dynamic
Testing Object-Oriented Software ◾ 199
14 do {
15 while(queueOfEvents.isEmpty());
16 event = queueOfEvents.remove();
17 if(event.equalsIgnoreCase("Remove 1 Truffles") &&
totalTruffles > 0) {
18 totalTruffles--;
19 message = "Removed 1 Truffle";
26 } else if(event.equalsIgnoreCase("Add 1 Truffles")) {
27 totalTruffles++;
28 message = "Added 1 Truffle";
35 }
36 truffleSales = trufflePrice * totalTruffles;
45 }
46 }
List the Statement fragment numbers for all Def(totalTruffles) nodes. Do the
same for all Use(totalTruffles)
nodes
Trending now
This is a popular solution!
Step by step
Solved in 2 steps