Question
1. Given a black box description of the inputs to a given program P1: integer A in [-10, 10]. a) What are the equivalence classes
1. Given a black box description of the inputs to a given program P1: integer A in [-10, 10].
a) What are the equivalence classes for input A to P1?
b) Create a test set that will cover the equivalence classes for A in P1.
2. Based on boundary value analysis, what test cases should we use for the input integer A in program P1?
3. Given a black box description of the inputs to a given program P2: integer X in [0,10] or [30,75].
a) What are the equivalence classes for input X to P2?
b) Create a test set that will cover the equivalence classes for X in P2.
4. Based on boundary value analysis, what test cases should we use for the input integer X in program P2?
5. For the following program P3 written in pseudo-code, given the test set T:
T = {t1 = <5, 2, 80>, t2 = <3, 1, 70>, t3 = <9, 3, 75>}
a) What is the domain for statement coverage of P3? Note: do not include syntactical markers such as comments, {, }, else, begin, end.
b) What is the statement coverage for T?
c) What test cases should you add to T to provide 100% statement coverage?
d) What is the domain for decision coverage of P3?
e) What is the decision coverage for T?
f) What test cases should you add to T to provide 100% decision coverage?
g) What is the domain for condition coverage of P3?
h) What is the condition coverage for T?
i) What test cases should you add to T to provide 100% condition coverage?
When measuring test coverage, normally coverage is expressed as a percentage. It can also be expressed as a fraction, and using an un-simplified fraction is preferred for this assignment. Note that when adding test cases, there are many possible test cases that satisfy the objective: provide 100% coverage for a given test criterion.
Program P3
1) integer A, B, C, Z;
2) input (A, B, C);
3) if (A<0 or a>8 or B<1 or b>3 or C<73 or c>94)
4) {
5) output (Boundary condition failure on inputs.);
6) }
7) else // valid input
8) {
9) Z := A * B * C;
10) if (A < 5)
11) {
12) Z := A + B;
13) if (B = 1)
14) {
15) Z := B + C;
16) } // end if (B=1)
17) Z = Z * Z;
18) } // end if (A<5)
19) else
20) {
21) Z := A B;
22) if (B = 2)
23) {
24) Z := B * C;
25) } // end if (B=2)
26) else
27) {
28) Z := B / C;
29) } // end else !(B=2)
30) Z := Z * Z * Z;
31) } // end else !(A<5)
32) output (A, B, C, Z);
33) } // end else valid input
34) return 0;
35) end;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started