Software Engineering - Answers to White Box Testing Exercises

1. Problem description

Design test cases satisfying the specified coverage criteria for the following programs, the number of test cases should be as small as possible.
insert image description here
Among them,
the true branch of judgment 1 ((x>3)&&(z<10)) is b, and the false branch is c; the true branch of judgment
2 ((x==4)||(y>5)) is d , the false branch is e;
the two values ​​of condition 1 (x>3) are represented by T1 and F1; the
two values ​​of condition 2 (z<10) are represented by T2 and F2;
condition 3 (x==4) The two values ​​of condition 4 (y>5) are represented by T3 and F3;
the two values ​​of condition 4 (y>5) are represented by T4 and F4.
(1) Statement coverage (use format: [input (x,y,z), expected output (x,y,z)]) (2) Decision coverage (use truth table format) (3) Condition coverage (
use
true Value table format)
(4) Judgment/conditional coverage (using the truth table format)
(5) Conditional combination coverage (using the truth table format)
(6) Complete the basic path test (draw the flow diagram, calculate the ring complexity, write out collection of independent paths, test cases)

2. Answers to questions

Please add a picture description

Basic path test:

insert image description here

write at the end

You are welcome to discuss with me the answers to the above questions or more complex questions, and welcome corrections. In addition, the answer to the sample question is not unique, and there will be other solutions.

Guess you like

Origin blog.csdn.net/weixin_52323239/article/details/130965413