Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q 1 :Draw the Control Flow graph for the following and calculate cyclomatic complexity for the following code snippet: int func 1 ( int x

Q1:Draw the Control Flow graph for the following and calculate cyclomatic complexity for the following code snippet:
int func1(int x, int y)
1
While (xy){
If (x>y) then
x=x-y;
else y=y-x;
}
return x;
}
Q2
1 READ A
2 READ B
3 Sum = A+ B
Provide the Test cases for 100% Statement coverage. For this convert given pseudocode to flow chart and then show how many
test cases are required for 100% statement coverage.
Q3:
IF Age >16
Process License application
3 ELSE
4 Decline the License application process
5 END IF
Provide the Test cases for 100% Statement and Decision coverage. For this convert given pseudocode to flow chart and then
show how many test cases are required for 100% statement and Decision coverage.
Q4:
Nested Ifs or multiple IFs within an IF:
1 IF ( Age >17)
2 IF Age 50
3 Print Age is between 17 and 50
4 ELSE IF (Age >50)
5 Print Age is greater than 50
6 END IF
7 ELSE
8 Print Age is less than 17.
9 END IF
Provide test cases which are needed for 100% Statement and Decision test coverage?For this firstly, convert given
pseudocode to flow chart and then show how many test cases are required for 100% statement and Decision coverage.
Q5:
Provide test cases which are required to achieve 100% Statement coverage ? For this firstly, convert given pseudocode to
flow chart and then show how many test cases are required for 100% statement coverage.
Print sum (int a, int b)
{
int result =a+b;
if (result >0)
print ("red", result)
else if (result 0)
print ("blue", result)
}
image text in transcribed

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

Step: 3

blur-text-image

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions

Question

Perform assignment 8 using your state's law.

Answered: 1 week ago