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

List the important properties of a modular system, List the important prope...

List the important properties of a modular system.    Desirable properties are:- Every module is a well defined subsystem useful to others Every module has a well defined single

Realistic approach to the development of large-scale systems, Q. Realistic ...

Q. Realistic approach to the development of large-scale systems? There are a number of advantages of Spiral model that makes it a realistic approach to development of large-sca

Calculate capacity of a cluster for this disc, A multiplattered HDD is for...

A multiplattered HDD is formatted into twenty sectors and 16 hundred cylinders. There are eight platters and 16 R/W heads. The total capacity of the disc is 1GB. A cluster of data

Define about the erroneous data - Test data, Define about the erroneous dat...

Define about the erroneous data - Test data Abnormal/erroneous data  -  This is data outside the limits of validity/acceptability and must cause an error message to be g

Supermarkets, A supermarket requires to develop software to encourage regul...

A supermarket requires to develop software to encourage regular customers. For this the customer requires to supply his name address telephone number and driving license number. A

Explain the purpose of checkpoints in winrunner, Explain the purpose of che...

Explain the purpose of checkpoints in Winrunner? Checkpoints help to compare behavior of current application to its previous version. There are total of four types of checkpoin

What is meant by data dictionary, What is meant by Data dictionary? The...

What is meant by Data dictionary? The Data dictionary is a prepared listing of all data elements that are pertinent to the system, with precise, rigorous explanations so that b

What does the insert statement in extract datasets do, What does the insert...

What does the insert statement in extract datasets do? It describes the fields of a field group.

What is the use of cmm, What is the use of CMM? Capability Maturity Mod...

What is the use of CMM? Capability Maturity Model is used in assessing how well an organisation's processes permit to complete and manage latest software projects.

Ftr, EXPLAIN ABOUT DEFECT AMPLIFICATION AND REMOVAL IN SOFTWARE ENGINEERING...

EXPLAIN ABOUT DEFECT AMPLIFICATION AND REMOVAL IN SOFTWARE ENGINEERING

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