Design test cases for loop testing, Software Engineering

Assignment Help:

Q. Regard as a program that reads a set of Data for 'n' no. of triangles. The program reads three integer values like representing the sides of triangles. The program prints for each triangle whether the triangle is isosceles or equilateral or a simple. Develop logic as well as do the following:

(i) Compute cyclomatic complexity?

(ii) Design test cases for loop testing?

Ans.                 The program logic will be like follows:

Enter three sides of a triangle.

Read a, b and c

If(a

Then is_a_triangle=TRUE

Else is_a_triangle=FALSE;

IF is_a_triangle

Then

If(a=b)XOR(a=c)XOR(b=c) AND NOT ((a=b)AND(a=c))

Then print "Triangle is Isosceles"

If(a=b)AND(b=c)

Then print "Triangle is Equilateral"

If(a<>b)AND (a<>c) AND(b<>c)

Then print "Triangle is scalene"

Else

Print "Not a triangle"

The flow graph of the problem is given as in

the fig:

(i) There are 6 independent paths i.e.

1,2,3,9,14

1,2,4,5,6,8,11,13,14

1,2,3,5,6,8,11,13,14

1,2,4,5,6,7,8,11,13,14

1,2,4,5,6,8,10,11,13,14

1,2,4,5,6,8,11,12,13,14

Cyclomatic complexity is 6

1907_Design test cases for loop testing.png

(ii) Few test cases are:

778_Design test cases for loop testing1.png


Related Discussions:- Design test cases for loop testing

What is test methodology, Test methodology is up to the end client, and can...

Test methodology is up to the end client, and can be used, reused, and moulded to your end client's requirements. Rob Davis believes that using the right test methodology is signif

Explain about rapid prototyping techniques, Explain about rapid prototyping...

Explain about rapid prototyping techniques.  Used to animate the system specification. It is expressed in a formal, mathematical language to provide a system prototype

Determine the importance of software engineering, Importance of Software En...

Importance of Software Engineering As the application domains of software are becoming complicated and design of big software without a systematic method is virtually impossib

Explain evolutionary development model, Evolutionary Development model. ...

Evolutionary Development model.  Evolutionary Development Model : Evolutionary development model resembles iterative enhancement model. The similar phases as defined for the w

What is software, What is Software? Software is nothing but a collectio...

What is Software? Software is nothing but a collection of computer programs that are related documents that are indented to give desired features, functionalities and improved

What is the use of a data flow diagram, What is the use of a data flow diag...

What is the use of a data flow diagram? A data flow diagram is used to represent the functional view of an application domain. It represents all the significant business proces

What is interface analysis, Checks the interfaces among program elements fo...

Checks the interfaces among program elements for consistency and adherence to predefined axioms or rules.

K-map, m2+m3+m5+m7+m12+m8+m9 simplify using k-map

m2+m3+m5+m7+m12+m8+m9 simplify using k-map

What are the virtues of incremental model, What are the virtues of incremen...

What are the virtues of incremental model? i. The incremental model can be adopted when there are less number of persons associated with the project. ii. Technical risks can

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd