Program P3 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) else 20) 21) C-C + 2; 22) ) // end else! (A<0) 23) output (A, B, C); 24) 1 // end else valid input 25) return; 26) end; integer A, B, C input (A, B); C-A. B; if (A<-10 or A>10 or B<0 or B>5) output ("Invalid input."); else // valid input { if (A < 0) ( CC + A + B; if (B > 2) C = C + 3: C-CC; ) // end if (A<0) else { if (B < 1 or C = 0) C-B. C; C-B / C; or the following program P3 written in pseudo-code, given the test set T: T= {t₁= <-5, 2>, t2 = <3, 1>, t3 = <9,3>} a) What is the domain for statement coverage of P3? Note: do not include syntactical markers such as comments, blank lines, (,), else, begin, end. b) What is the statement coverage for T? c) What test cases (if any) should you add to T to provide 100% statement coverage? d) What is the decision coverage for T? e) What is the condition coverage for T? f) What test cases (if any) should you add to T to provide 100% condition coverage?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question
Program P3
1)
2)
3)
4)
5)
6)
7)
8)
9)
10)
11)
12)
13)
14)
15)
16)
17)
18)
19)
20)
(21)
22)
23)
24)
25)
26)
integer A, B, C;
input (A, B);
CA B;
if (A<-10 or A>10 or B<0 or B>5)
output ("Invalid input.");
else // valid input
{
if (A < 0)
(
C
if
else
(
C + A + B;
(B > 2)
C-C. C;
// end if (A<0)
C = C + 3;
if (B < 1 or C -- 0)
CB C;
else
C-B/C:
C = C + 2;
// end else ! (A<0)
output (A, B, C):
// end else valid input.
return;
end;
For the following program P3 written in pseudo-code, given the test set T:
T = {t₁ = <-5, 2>, t2 = <3, 1>, t3 = <9,3>}
a) What is the domain for statement coverage of P3? Note: do not include syntactical
markers such as comments, blank lines, {}, else, begin, end.
b) What is the statement coverage for T?
c) What test cases (if any) should you add to T to provide 100% statement coverage?
d) What is the decision coverage for T?
e) What is the condition coverage for T?
f) What test cases (if any) 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.
Transcribed Image Text:Program P3 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20) (21) 22) 23) 24) 25) 26) integer A, B, C; input (A, B); CA B; if (A<-10 or A>10 or B<0 or B>5) output ("Invalid input."); else // valid input { if (A < 0) ( C if else ( C + A + B; (B > 2) C-C. C; // end if (A<0) C = C + 3; if (B < 1 or C -- 0) CB C; else C-B/C: C = C + 2; // end else ! (A<0) output (A, B, C): // end else valid input. return; end; For the following program P3 written in pseudo-code, given the test set T: T = {t₁ = <-5, 2>, t2 = <3, 1>, t3 = <9,3>} a) What is the domain for statement coverage of P3? Note: do not include syntactical markers such as comments, blank lines, {}, else, begin, end. b) What is the statement coverage for T? c) What test cases (if any) should you add to T to provide 100% statement coverage? d) What is the decision coverage for T? e) What is the condition coverage for T? f) What test cases (if any) 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.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education