A developer aiming for path coverage covers all the possible paths of execution of the program. While ideally this is the strongest criterion, it is often impossible or too expensive to achieve. In a single program with three conditions, where each condition could be independently evaluated to true
or false
, we would have 23 = 8 paths to cover. In a program with 10 conditions, the total number of combinations would be 210 = 1024. In other words, we would need to devise more than a thousand tests!
Path coverage also gets more complicated for programs with loops. In a program with an unbounded loop, the loop might iterate hundreds of times. A rigorous tester aiming for path coverage would have to try the program with the loop executing one time, two times, three times, and so on.
Leave a Reply