Design test cases for loop testing, Software Engineering

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


Then is_a_triangle=TRUE

Else is_a_triangle=FALSE;

IF is_a_triangle


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

Then print "Triangle is Isosceles"


Then print "Triangle is Equilateral"

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

Then print "Triangle is scalene"


Print "Not a triangle"

The flow graph of the problem is given as in

the fig:

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







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

Posted Date: 7/26/2013 5:10:14 AM | Location : United States

Related Discussions:- Design test cases for loop testing, Assignment Help, Ask Question on Design test cases for loop testing, Get Answer, Expert's Help, Design test cases for loop testing Discussions

Write discussion on Design test cases for loop testing
Your posts are moderated
Related Questions
What are the benefits of smoke testing? Integration risk is decreased. The quality of the end-product is getting better. Error diagnosis and correction are simplified. Assessme

Advantages of Re-Engineering:- 1)  Reduced risk - there is a huge risk in new software development. There might be development problems, staffing problems and specification pro

Function count:- It measures the functionality from the user point of view, that is, on the basis of what the user requests and receives in return. Therefore it deals with the fun

Explain Defect? Ans) 1) From the producer's viewpoint: a product needs that has not been met or a product attribute possessed by a product or a function perform by a product tha

Q.  Describe the various types of restructuring techniques? Ans. Software restructuring modifies source code as well as data an effort to make it amenable to future changes

Application Design: Micro CDS/ISIS is a text oriented software package. It is a good , ho ice if one wishes to store textual data, retrieve the data by certain criteria, and d

#questionFrame Diagrams We discussed the importance of framing a problem in order to understand the problem better and be able to develop a solution more quickly and easily. In thi

Give explanation about the incremental model. - Have same phases as the waterfall model. - Phases are as follows: Analysis. Code. Design. Test. Incre

What is a cohesive module? A cohesive module performs only "one task" in software procedure with few interaction with other modules. It means cohesive module serve only one thi