Question: White Box Testing Let us consider the following loop statement in C: for (n = 0; n < max_size && (c = getc(yyin)) != EOF
White Box Testing
Let us consider the following loop statement in C:
for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != ; ++n)
buf[n] = (char) c;
a)Derive a set of test cases that satisfy the compound condition adequacy criterion with respect to the loop.
b)Derive a set of test cases that satisfy the modified condition (MC/DC) adequacy criterion with respect to the loop.
The answers can be provided in the form of tables like the one below
n < max_size c = getc(yyin) != EOF c != ;
Test case
(1) True/False/- True/False/- True/False/-
(2) True/False/- True/False/- True/False/-
.
You must identify for each basic condition, which (two) test cases will provide coverage for this condition as required by the MC/DC adequacy criterion by underscoring the True/False/- in the table.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
