Question: | First Function : public class FunctionExample { public int firstFunction ( ) { int counter = ; int outerLimit = 1 0 ; int
First Function :
public class FunctionExample
public int firstFunction
int counter ;
int outerLimit ;
int nestedLimit ;
boolean flag true;
int secondCounter ;
forint i;i
flag flag;
ifi
Systemout.printInOuter loop even iteration, additional processing...";
Systemout.printinFirst function has finished its processing with counter: counter;
return counter;
second Function:
public int secondFunction
int secondCounter ;
int secondLimit ;
forint ; secondLimit; l
Systemout,printlnSecond function loop iteration:";
secondCounter;
if
Systemout.printlnOdd iteration in second function.";
else
Systemout.printlnEven iteration in second function.";
Systemout.printlnSecond function has finished its processing.";
return secondCounter;
aDraw the corresponding Control Flow Graphs for the firstFunclionand the secondFunclionLabel the nodes of the CFGs with the respective line numbers in the source code. points
bDraw the prime decomposition trees based on the CFG is for the firstFunctionand the secondFunctionlpoints
cHow many test cases are needed at a minimumto achieve the following coverage criteria for the firstfunctionpoints
Statement coverage
Branch coverage
Basis path coverage
Simple path coverage
dProvide al partialpaths to achieve all DU path coverage with respect to variable "counter" in the firstfunctionAll paths should be defined in terms of nodes traversed in the CFGpoints
eCreate the following backward slice S counterfor the firstfunctionSimply list the line numbers of the statements to be included in the slice. points
fplease identify source nodes, sink nodes and Module Execution Paths for the firstFunclion and the secondFunction points
gPlease build a ModuleMessage path graph based on question fpoints
hPlease identify a MMpath based on gpoints
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
