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

Cs304, Following is the description of all data member and member functions...

Following is the description of all data member and member functions of respective classes: ? Data members for PropertyCategories: o SocietyName: This data member will be used

What is test objective, An identified set of software features to be calcul...

An identified set of software features to be calculated under specified conditions by comparing actual behavior with the needed behavior described in the software documentation.

Process assessment, how can we improve requirements Engineering process ass...

how can we improve requirements Engineering process assessment model

State the process of white box testing, State the process of White box test...

State the process of White box testing White box testing:   This method, also termed as glass box testing, is performed early in testing process.  By using this, software engi

Define the procedural abstraction, State Procedural abstraction. A Pro...

State Procedural abstraction. A Procedural abstraction is a named series of commands that has a specific and limited function. Eg: Open Walk to the door, reach out & grasp

What is meant by throw away prototyping, What is meant by Throw away Protot...

What is meant by Throw away Prototyping? Giving the user a system which is incomplete and then changing and augmenting it as the user requires become clear. The objective

Elaborate on the characteristics of a good team player, Question 1: In ...

Question 1: In his book Tales of a New America, Robert Reich describes the importance of teamwork in an increasingly technological age: Rarely do even Big Ideas emerge any l

Explain walk-through, Explain Walk-through? Ans) A walk-through (in soft...

Explain Walk-through? Ans) A walk-through (in software QA) is a casual meeting for evaluation or informational purposes. A walk-through is also a method at an abstract level. It

What is incremental analysis, Incremental analysis happens when (partial) a...

Incremental analysis happens when (partial) analysis may be performed on an incomplete product to permit early feedback on the development of that product.

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