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 failure, The inability of a system or system component to perform a...

The inability of a system or system component to perform a needed function within specified limits.

Explain process and product quality, Explain Process and product quality ...

Explain Process and product quality The quality of a developed product is influenced by the quality of the production process. This is important in software development as some

What is sei capability maturity model, What is SEI capability maturity mode...

What is SEI capability maturity model? Initial Essentially uncontrolled Repeatable Product management procedures explained and used Defined Proc

Define the process of software development, Define the process of Software ...

Define the process of Software development Software development underwent revolutionary changes. Rather than a programming teamin an organisation, full-fledged software compan

What happens when gui maps are loaded, What happens when GUI maps are loade...

What happens when GUI maps are loaded? When a GUI map is loaded following things take place: - All object logical names, window information and physical descriptions gets lo

Explain about the iterative enhancement model, Iterative Enhancement Model ...

Iterative Enhancement Model This model was developed to remove disadvantages of waterfall model. In this model, phases of software development remain the same however the cons

Explain sanity testing, Sanity testing is performed whenever cursory testin...

Sanity testing is performed whenever cursory testing is sufficient to show the application is functioning according to specifications. This level of testing is a subset of regressi

Define kpas level associated with maturity model, Define KPAs level associa...

Define KPAs level associated with maturity model KPAs are defined by SEI and associated with different maturity levels.  These are described below: Level 1 KPAs : There is

Define the minimum cardinality of a relationship, Define the Minimum cardin...

Define the Minimum cardinality of a relationship Minimum cardinality of a relationship is the minimum number of instances of second entity (student, in this case) with every in

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