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

Role of measurement in software engineering, Question: (a) (i) Describ...

Question: (a) (i) Describe briefly the role of measurement in software engineering. (ii) List three types of entities, their attributes and related measures in software eng

Jenny Smith, RE : Website Google Ranking Hi, We can fairly quickly promot...

RE : Website Google Ranking Hi, We can fairly quickly promote your website to the top of the search rankings with no long term contracts! We can place your website on top of the

What are the aims of analysis modelling, What are the aims of Analysis mode...

What are the aims of Analysis modelling? i. To make apparent what the customer wants. ii. To set up a basis for the creation of software design. iii. To devise a set of v

Project or process, Mentoring a class at a university. is project or proce...

Mentoring a class at a university. is project or process??

How the class concept used in software engineering, Q. How the Class concep...

Q. How the Class concept used in Software Engineering? Class:- A class encapsulates data and procedural abstractions required to describe the content and behavior of some real

Applications of a stochastic model , Aims: The aims of this report are to e...

Aims: The aims of this report are to enable you to explore the background, motivations, history,  development and/or applications of one of the stochastic models.   You may choose

How to perform risk analysis during software testing, Describe how to perfo...

Describe how to perform Risk Analysis during software testing. Whereas a test plan is being formed, risks involved in testing the product are to be taken into consideration al

Write a valid schema for the container, A storage tank has a container to k...

A storage tank has a container to keep a certain amount of fuel and it also has an indicator to inform about the level of fuel inside the container. The container cannot exceed

What is process improvement, What is Process improvement? Understanding...

What is Process improvement? Understanding existing processes and introducing process changes to improve product quality, decrease costs or accelerate schedules. Most proces

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