98

ISBN : 978-81-963532-2-3 (E-Book) intx, y; { 1while(x!=y) { 2if(x>y)then 3x=x– y;4elsey=y–x; 5 } 6return x; } By choosing the test set {(x=3, y=3), (x=4, y=3), (x=3, y=4)}, we can exercise the program suchthatall statements are executed at least once. BranchCoverage In the branch coverage-based testing strategy, test cases are designed to make each branchcondition to assume true and false values in turn. Branch testing is also known as edge testing asinthistestingscheme,eachedgeof aprogram’scontrolflow graphistraversedatleast once. It is obvious that branch testing guarantees statement coverage and thus is a stronger testingstrategycomparedtothestatementcoveragebasedtesting.ForEuclid’sGCDcomputationalgorithm, the test cases for branch coverage can be {(x=3, y=3), (x=3, y=2), (x=4, y=3), (x=3,y=4)}. ConditionCoverage Inthisstructuraltesting,testcasesaredesignedtomakeeachcomponentofacompositeconditional expression to assume both true and false values. For example, in the conditionalexpression ((c1.and.c2).or.c3), the components c1, c2 and c3 are each made to assume both trueand falsevalues.Branchtesting is probably thesimplest condition testing strategy where onlythe compound conditions appearing in the different branch statements are made to assume thetrue and false values. Thus, condition testing is a stronger testing strategy than branch testing andbranchtestingisstrongertestingstrategy thanthestatementcoverage-basedtesting.Foracomposite conditional expression of n components, for condition coverage, 2ⁿ test cases arerequired. Thus, for condition coverage, the number of test cases increases exponentially with thenumber of component conditions. Therefore, a condition coverage-based testing technique ispractical onlyif n (thenumberof conditions) is small. PathCoverage The path coverage-based testing strategy requires us to design test cases such that all linearlyindependent paths in the program are executed at least once. A linearly independent path 93 Software Engineering Keerthana P, Manasa KN, Ganga D Bengal

99 Publizr Home


You need flash player to view this online publication