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

How messages can be used in software engineering, Q. How Messages can be us...

Q. How Messages can be used in software engineering? Messages:- The interaction or communication between the different objects and classes is done by passing messages. The ob

Information engineering, Information engineering is a system  engineering ...

Information engineering is a system  engineering approach which is used to describe architectures which enable a business to use data professionally. The intent of information eng

What is test suite, What is Test Suite - It is a collection of tests t...

What is Test Suite - It is a collection of tests that are used to validate the behavior of an application or product. - Generally a test Suite is a high level concept, grou

Explain in brief the concept of functional independence, Explain in brief t...

Explain in brief the concept of Functional independence ?

Define the term - inspection, Define the term - Inspection - An inspec...

Define the term - Inspection - An inspection is more formal than walk through. - It includes 3-8 people - a moderator, reader as well as a recorder to take notes. - Subj

Define aggregation among objects, Q. Define Aggregation among objects? ...

Q. Define Aggregation among objects? Aggregation between objects represents a relationship. It is a whole/part relationship. Aggregation may perhaps imply containment.

Develop a test case for any under development application, An application w...

An application which is under development. How would you develop a test case for it? When application is under development, Business Requirement Document is used as primary doc

Explain about the incremental model, Explain about the incremental model. ...

Explain about the incremental model. Have same phases as the waterfall model. Phases are Analysis. Design. Code. Test. Incremental model deliver

Iterative Enhancement Model, what is the advantage of Iterative Enhancement...

what is the advantage of Iterative Enhancement Model in developing a system?

What are the elements of analysis model, What are the elements of Analysis ...

What are the elements of Analysis model? i. Data Dictionary ii. Data Flow Diagram iii. Entity Relationship Diagram iv. State Transition Diagram v. Process specifica

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