Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code Coverage: Consider the following code (expressed as a control-flow graph) for computing the greatest common denominator (GCD) of integers x and y: The inputs

Code Coverage:
Consider the following code (expressed as a control-flow graph) for computing the greatest common denominator (GCD) of integers x and y:
image text in transcribed
The inputs to this code are the x and y values read in statement 1 and 2, so any (x,y) pair constitutes a possible test case.
(a) If x is fixed at 6, then what is the smallest possible positive value of y that gives 100% statement coverage? Your answer should be a single test case, i.e., a single (x,y) pair with the restriction that x must be 6. Using 6 for x and your chosen value for y, what is the sequence of statement numbers (e.g., 1, 2, etc.) that execute when this test case is run?
(b) Is it possible to achieve 100% data-flow (def-use) coverage for our GCD program with a single test case (i.e., a single (x,y) input pair)? Explain your answer: describe such a test if your answer is "yes" and explain why not otherwise.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

What auditing services do internal auditors provide?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago