![]() |
The statement coverage technique is used to design test cases for white box testing which involves the execution of all the statements of the source code at least once. This article focuses on discussing statement coverage in detail. What is Statement Coverage?It is one type of white box testing technique that ensures that all the statements of the source code are executed at least once. It covers all the paths, lines, and statements of a source code. It is used to design test box cases where it will find out the total number of executed statements out of the total statements present in the code. Formula:
Example 1:
Case 1:
Case 2:
Example 2:
Case 1:
Case 2:
In the internal code structure, there are loops, arrays, methods, exceptions, and control statements. Some code would be executed based on input while some may not. Statement coverage will execute all possible paths and statements of the code Statement coverage covers:
Why is statement coverage used?
Drawback of Statement Coverage:
|
Reffered: https://www.geeksforgeeks.org
Manual Testing |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 15 |