Test Cases For Decision Coverage and Modified Condition - Decision Coverage
Test Cases For Decision Coverage and Modified Condition - Decision Coverage
DC MCDC
Diff Subpr Min Max Avg Dev Avg Dev
0 21059 1 175 2.15 4.00 2.15 4.00
1 1070 3 88 4.10 5.46 5.10 5.46
2 342 4 41 5.06 4.85 7.06 4.85
3 125 5 35 5.74 5.00 8.74 5.00
4 75 6 95 9.09 15.35 13.09 15.35
5 34 7 19 5.56 3.56 10.56 3.56
6 35 8 27 8.11 5.98 14.11 5.98
7 24 9 44 11.17 11.51 18.17 11.51
8 19 10 22 5.53 3.45 13.53 3.45
9 13 11 49 9.08 10.65 18.08 10.65
10 3 12 25 7 5.72 17 5.72
11 8 13 28 6.50 5.20 17.50 5.20
12 7 14 34 9.43 8.33 21.43 8.33
13 3 15 16 2.33 0.47 15.33 0.47
14 5 16 31 10.40 5.82 24.40 5.82
15 2 60 105 67.50 22.50 82.50 22.50
16 3 44 72 39.67 11.90 55.67 11.90
18 2 20 40 12 10 30 10
19 3 33 37 16.67 1.88 35.67 1.88
21 3 61 247 113.33 80.87 134.33 80.87
68
DC MCDC
Diff Subpr Min Max Avg Dev Avg Dev
22 1 145 145 123 0 145 0
23 2 25 25 2 0 25 0
25 1 61 61 36 0 61 0
27 1 68 68 41 0 68 0
29 1 39 39 10 0 39 0
31 1 74 74 43 0 74 0
36 1 77 77 41 0 77 0
4.7.8 DC - MC/DC
In this chapter you can find how many test cases are needed for the project to cover DC and MC/DC.
In the following table, the
A means: the whole project,
B means: the whole project without those subprograms which do not contain decision,
C means: the whole project without those subprograms which contain decision with at least two
arguments.
69
5 Summary and Conclusion
In this study we analyzed six projects written in Ada programming language. Our task was to estimate
the difference of test cases needed to satisfy the requirements of Decision Coverage and Modified
Condition / Decision Coverage.
The difference is about five to ten per cent depending the characteristics of the project. The main
reason we could not achieve greater difference is the decisions in most subprograms have only one
argument and there are several subprograms which do not contain decisions at all. If we exclude these
subprograms we get four times bigger difference. Most of all, the maximum number of arguments in
decisions affects the difference. For those subprograms where there are decisions with more than six
arguments, almost twice MC/DC test cases are needed than DC. But unfortunately these subprograms
are only less than one per cent of the whole projects.
In general we can say almost ten per cent more test cases are needed to satisfy the requirements of
Modified Condition / Decision Coverage than Decision Coverage.
70
6 References
[1] Kelly J. Hayhurst, Dan S. Veerhusen, John J. Chilenski, Leanna K. Rierson: A Practical Tutorial
on Modified Condition/Decision Coverage
[2] http://www.bullseye.com/coverage.html 2008.03.01
[3] http://www.antlr.org/ 2008.03.02
[4] Oliver Kellogg: http://www.antlr.org/grammar/ada
[5] https://lemon.cs.elte.hu/site/ 2008.03.09
[6] http://www.gnu.org/software/glpk/ 2008.03.09
71