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
The Clue-Less system shall operate with the following Web browsers: Microsoft Internet Explorer, Mozilla Firefox, Google Chrome, and Safari. OE-2: The Clue-Less system shall

Q. How can we use Spiral model in large-scale systems? Spiral model is as well known as spiral life cycle model is the system development life cycle model utilized in informati

What are the reasons behind to perform white box testing? There are three main reasons behind performing the white box testing.  1. Programmers may have some incorrect assum

Define debugging. Debugging is defined as the process of removal of defect. It occurs as a consequence of successful testing.

The level at which the software uses scarce resources Efficiency level.


Explain the working of Gantt charts -  Gantt charts enable emailing of project/tasks info to others automatically -  Gantt charts allow use of intranet/email facility to down

desidn a complete flow chart diagram ,which ask the user to input the rate of diesel and quantity of diesel consumed.after calculate the total amount of diesel consumed and display

What is live variable A variable is live from its first to its last reference within a process.

The spiral model of software development Contains project risks evaluation during every iteration