SOFTWARE ENGINEERING

SOFTWARE TESTING

TEST PLAN AND TEST CASE DEVELOPMENT

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
How is statement coverage determined?
A
Number of test decision points divided by the number of test cases
B
Number of decision outcomes tested divided by the total number of executable statements
C
Number of possible test case outcomes divided by the total number of function points
D
Number of executable statements tested divided by the total number of executable statements
Explanation: 

Detailed explanation-1: -The statement testing technique derives test cases to execute specific statements, normally to increase statement coverage. Statement coverage is determined by the number of executable statements covered by (designed or executed) test cases divided by the number of all executable statements in the code under test.

Detailed explanation-2: -Therefore, to achieve 100% decision coverage, a second test case is necessary where A is less than or equal to B which ensures that the decision statement ‘IF A > B’ has a False outcome. So one test is sufficient for 100% statement coverage, but two tests are needed for 100% decision coverage.

Detailed explanation-3: -Statement coverage technique is used to design white box test cases. This technique involves execution of all statements of the source code at least once. It is used to calculate the total number of executed statements in the source code out of total statements present in the source code.

Detailed explanation-4: -To achieve 100% statement coverage of this code segment just one test case is required, one which ensures that variable A contains a value that is greater than the value of variable Y, for example, X = 12 and Y = 10.

There is 1 question to complete.