Rating: 3.0/5. From 2 votes.
Please wait...

White-box testing provides the degree to which tests cover the logic of the software program. Exhaustive white box testing implies that each path along the program is executed; but rigorous testing is unachievable goal for a program with loops.

Screenshot_1

Fig. A small program to be checked

 

If you refuse to conduct path testing, it may seem that it would be worth executing each statement through the program at least once. Unfortunately though, this is a weak criterion for a good back-box test. Suppose that the Figure above shows a small program to be tested. An equivalent program written in a procedural language, PL / 1, follows:

Screenshot_3

You could execute each statement by creating a single test, which traverses the path ace. In other words, if you set A = 2, B = 0, and X = 3 at point a, each statement would be executed once (in fact, X can take any integer value >1).

 

Unfortunately, this criterion is worse than you may think. For instance, let the first decision be an or, not an and. If that is the case, this error will not be found. Let the second decision in the program be X> 0; if so, this error will not be found. In addition, there is a path in which X does not change (path abd). If there is an error, then it will not be detected. Thus, the statement coverage criterion is a poor one that it is usually not used.

 

Using services of game testing company you become able to play video games free of charge! All you need you do is to control their quality by finding defects and bugs in them.

 

Decision coverage is a stronger logic coverage criterion. Based on this criterion, a fair number of test cases should be written, for each decision to have true and false value ​​at least one time. Put it differently, each branch changes direction must be executed at least once. Examples of branch statements or transition operators are do-while, if-else or switch-case statements (or COBOL PERFORM UNTIL statements). Multipath go to statements can be qualified in some programming languages, for instance, such as Fortran.

 

Decision coverage usually meets statement coverage criterion. As each statement is on some path which emanates either from the transition operator or from the entry point of the program, the execution of each statement is a must given that each branch direction is executed. Nevertheless, there are three exceptions. The first – the program has no decisions. The second: programs or subroutines have several entry points; this operator can only be executed if the program is executed at the appropriate entry point. The third one – operators are within ON-units; execution of each branch direction does not necessarily cause the execution of all ON-units.

 

Comments are closed.