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 prototype, What is Prototype Prototype is developed so that cu...

What is Prototype Prototype is developed so that customers, developers and users can learn more about problem. Hence prototype serves as a mechanism for identifying software r

What are the types of software maintenance, What are the types of software ...

What are the types of software maintenance? Corrective maintenance - Means the maintenance for correcting the software faults. Adaptive maintenance - Means maintenance f

What is software life cycle, Software life cycle starts when a software pro...

Software life cycle starts when a software product is first conceived and ends when it is no longer in use. It contains aspects such as initial concept, requirements analysis, inte

Illustrate key process areas of cmm, Q. Illustrate key process areas of CMM...

Q. Illustrate key process areas of CMM? The key process areas of CMM are 1. Requirements management that establishes a common relationship between the customer and developer

What is parameter, In software QA or software testing, a parameter is an it...

In software QA or software testing, a parameter is an item of information - like a name, number, or selected option - that is approved to a program, by a user or another program. B

What are the various types of system testing, What are the various types of...

What are the various types of system testing? 1. Recovery testing - is planned to check the system's ability to recover from failures. 2. Security testing - determines t

What is the best effort estimation for software phases?, Hello, I am a CS ...

Hello, I am a CS graduate and i just got a new job in a software development company. My boss assigned me to come up with what he called "the perfect pie chart" basically he says

Define measure and metrics, Define measure and metrics. Measure is  a q...

Define measure and metrics. Measure is  a quantitative indication of the extent, dimension, amount or size of some attribute of a product or process. Metrics is termed as th

Write short notes on decision table, Q. Write short notes on Decision Table...

Q. Write short notes on Decision Table? Decision Table: While the process logic for a process involves multiple conditions as well as is very complicated it isn't advisable t

Software Metircs, I have a comprehensive question for Software Metrics ...i...

I have a comprehensive question for Software Metrics ...it is 16 question

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