The tester now tests the program on all input strings of length five consisting of characters ‘a’, ‘b’, ‘c’, ‘d’ and ‘e’ with duplicates allowed. If the tester carries out this testing with the four test cases given above, how many test cases will be able to capture the flaw?
-
Only one
-
Only two
-
Only three
-
All four
B
Correct answer
Explanation
Flaw in this given procedure is that one character of Array ‘A’ that can be replaced by more than one characters of 'newc' array, which should not be so. Test cases (3) and (4) identify this flaw as they are containing ‘oldc’ and ‘newc’ array characters arranged in specific manner. Following string can reflect flaw, if tested by test case (3).

Likewise, single character ‘b’ in A is replaced by ‘c’ and then by ‘d’. Same way, test case (4) can also catch the flaw.