Forum : query
Brief description  about Online courses   join in Online courses
View Shruti  Mahajan 's Profile

query

please explain statement and branch coverage with examples.
Asked by Shruti Mahajan | Jul 2, 2013 |  Reply now
Replies (1)
View testing instructor 's Profile
Statement coverage:

Statement coverage is also known as line coverage. The formula to calculate statement coverage is:

Statement Coverage=(Number of statements exercised/Total number of statements)*100

Studies in the software industry have shown that black-box testing may actually achieve only 60% to 75% statement coverage, this leaves around 25% to 40% of the statements untested.

Branch coverage:

Decision Coverage is also known as Branch Coverage.

Whenever there are two or more possible exits from the statement like an IF statement, a DO-WHILE or a CASE statement it is known as decision because in all these statements there are two outcomes, either TRUE or FALSE.

With the loop control statement like DO-WHILE or IF statement the outcome is either TRUE or FALSE and decision coverage ensures that each outcome(i.e TRUE and FALSE) of control statement has been executed at least once.
Aug 28, 2013