Determine the cyclomatic complexity, Software Engineering

Q. Consider the program given below

void main()

{

int i,j,k;

readln (i,j,k);

if( (i < j) || ( i > k) )

{

writeln("then part");

if (j < k)

writeln ("j less then k");

else writeln ( " j not less then k");

}

else writeln( "else Part"); }

(i) Draw the flow graph. (4)

(ii) Determine the cyclomatic complexity. (4)

(iii) Arrive at all the independent paths. (8)

 

 

Ans:

void main()

{

int i,j,k;

readln (i,j,k);

if( (i < j) || ( i > k) )

{

writeln("then part");

if (j < k)

writeln ("j less then k");

else writeln ( " j not less then k");

}

else writeln( "else Part");

}

206_Determine the cyclomatic complexity.png

(ii) Cyclomatic complexity = E - N + 2 = 12 - 10 + 2 = 4

(iii) The four independent paths are

Path1 : 1 2 3 9 10

Path2 : 1 2 4 5 7 8 10

Path3 : 1 2 4 5 6 8 10

Path4 : 1 2 3 4 5 7 8 10

Posted Date: 7/26/2013 4:02:20 AM | Location : United States







Related Discussions:- Determine the cyclomatic complexity, Assignment Help, Ask Question on Determine the cyclomatic complexity, Get Answer, Expert's Help, Determine the cyclomatic complexity Discussions

Write discussion on Determine the cyclomatic complexity
Your posts are moderated
Related Questions
Explain how to define Severity Rating in your project. Severity rating is a combination of three factors: - The frequency of the problem occurrence. It could be common / ra


Case Study: LHM is a London based privately owned hospital which provides healthcare to its patients.  The hospital uses in-house software to manage and service its patients whi

Write short notes on empirical estimation models. Estimation model for computer software uses empirically derived formulas to assume effort as a function of line of codes (LOC)

Explain virtual memory? Ans) Virtual memory tells to virtual storage. In virtual storage, portions of a user's program and data are placed in auxiliary storage, and the operatin


How is cyclomatic complexity useful in program test? Cyclomatic complexity calculates the amount of decision logic in a single software module. It is used for two related purpo

EXPLAIN ABOUT DEFECT AMPLIFICATION AND REMOVAL IN SOFTWARE ENGINEERING

Problem: (a) Define measurement and briefly summarize the representation condition for measurement. (b)  Software metrics is a term that embraces many activities, all of whi

Explain in detail about Black box testing. Black box or behavioural testing focuses on the functional needs of the software. It is applied during the last stage of testing.