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

Explain bottom up design, Bottom up design: This design leads to a style o...

Bottom up design: This design leads to a style of design where we decide how to join these modules to give larger ones; to combine those to give even larger ones, and so on, till

Find the degree of capability of software reliability model, Q. Define capa...

Q. Define capability. What are the quantities that determine the degree of capability of a software reliability model? Ans: Capability demotes to the ability of the model to

What is structure chart, Structure chart:  A structure chart is a top-down...

Structure chart:  A structure chart is a top-down modular design tool, constructed of squares representing the dissimilar modules in the system, and lines that connect them. The l

Explain fan in and fan-out, Fan in/Fan-out :- Fan-in is a measure of th...

Fan in/Fan-out :- Fan-in is a measure of the number of process or functions that call some other function or process (say X). Fan-out is the number of functions that are known

What is evolutionary prototype, Evolutionary Prototype In this, prot...

Evolutionary Prototype In this, prototype is constructed to learn about software problems and their solutions in successive steps. Prototype is initially developed to satisf

Define the types of requirements management, Define the types of Requiremen...

Define the types of Requirements management Requirements management comprises the below processes: 1. Identifying controls and tracking requirements. 2. Checking complete

What is manual testing, Manual testing is the part of software testing that...

Manual testing is the part of software testing that needs operator input, analysis, or evaluation. or A manual testing is a testing for which there is no automation. Instead,

Define the sanity testing, Sanity testing : - Sanity testing is used to ...

Sanity testing : - Sanity testing is used to make sure that multiple or conflicting functions or variables do not exist in the system. - It verifies that the components of th

Compute act and the total cost of the system, a) Define Annual Change Traff...

a) Define Annual Change Traffic (ACT) and Annual Maintenance Effort (AME) of Boehm model. b) For a software system of 90 KLOC, 5KLOC of code was added. The initial development

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