Question: Exercise 2 : Code testing The source code in Figure 1 is a C implementation of an algorithm that takes a positive integer as input
Exercise : Code testing
The source code in Figure is a C implementation of an algorithm that takes a positive integer as
input and returns an integer.
int discover int number
int i jdigits;
whilenumber
digitsinumber;
number ;
digitsinumber;
number;
forj;ji;j
number numberdigitsj;
return number;
a For number what will Discover
return. In general, what does the function
Discover do
b Draw a flowchart controlflow graph
the code given in Figure
c Propose test cases that achieve branch
coverage.
d Propose test cases that achieve statement
coverage.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
