STATEMENT COVERAGE TESTING:
Statement coverage type of white box software testing technique. It is called line or segment coverage testing. This testing is done to the code written to test whether the code written is qualitative or whether it does what it is expected to be done. It is checked in true conditions it is verified for every line of statements. Consider an example:
If A > B then
x = 0
To achieve 100% statement coverage we need to check only one test case here. We ensure that A value is greater than B for input values like A=14 and B=11. Here we check the structural design first as we are choosing input values to make certain the statement of coverage. The main disadvantage of this technique is here we cannot check the false condition of statements.
To check if number is greater than 50
If A > 50 then
print “A is greater than 50”
In statement coverage testing, to achieve 100% statement coverage we check with value of A greater than 50.
In statement coverage testing, 100% statement coverage is said to be achieved if all the statements are tested at least once. This type of testing is usually performed by the developers using development tools.
Check your understanding:
What is difference between statement coverage and decision coverage
Which one is better? statement coverage or decision coverage? Why?