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 do you understand by the term integrity, Question: (a) What do yo...

Question: (a) What do you understand by the term "integrity"? (b) Which type of attack denies authorized users access to network resources? (c) You have discovered tha

Cyclomatic complexity for a data flow diagram, pls explain how to calculate...

pls explain how to calculatethe cyclomatic complexity and independent paths Determine the cyclomatic complexity of the code ( (iii) Identify all the independent paths

Advantages and disadvantages of business intelligence, 1) Case A...

1) Case Analysis (maximum of 6 pages per case, double spaced) The following format may be used as a guideline for Case Analysis: Key Issues Identified in Case Sta

Calculate the information flow index of individual modules, Q. For the stru...

Q. For the structural chart given in fig.1 calculate the Information Flow index of individual modules as well as whole software. Total information flow = IF (main) + IF (A

What is the work product of software design process, What is the work produ...

What is the work product of software design process and who does this? A design model that encompasses architectural, interface, component level and their representations is th

Assignment, is there anyone can help with the assignment

is there anyone can help with the assignment

Determine the boundary value analysis, What is a boundary value analysis? ...

What is a boundary value analysis? A boundary value analysis is a testing procedure by which the elements at the edge of the domain are selected and tested. It is a test case d

Write down the concept of functional independence, Write down the concept o...

Write down the concept of Functional independence.  a. Functional independence is gained by developing modules with "single minded" function and an "aversion" to extreme intera

What are the benefits of using stored procedures, What are the benefits of ...

What are the benefits of using Stored Procedures? - They help in reducing network traffic and latency which in turn boosts application performance. - They assist in promotin

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