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

State the software measure, What is software measure? A software measu...

What is software measure? A software measure is a mapping from a set of objects in the software engineering world information a set of mathematical construct like numbers or v

Define the term - case, What is CASE? CASE tool stands for Computer Aid...

What is CASE? CASE tool stands for Computer Aided Software Engineering. Computer Aided Software Engineering tools helps software engineering manages and practitioners in every

What is version description document, Explain version description document ...

Explain version description document (VDD)? Ans) Version description document (VDD) is a document that accompanies and signifies a given version of a software product. Typically

What is software maintenance and cocomo model, What is software maintenance...

What is software maintenance? Software maintenance is a set actions in which program are customized after it has been put into use. COCOMO model :- COnstructive COst MOd

Software engineering, Software Engineering A  high technology system e...

Software Engineering A  high technology system encompasses a  number of  elements like   people, hardware, software, database, documentation, and process.  System engineering

Explain the sequential circuit, Sequential circuit:- A sequential circu...

Sequential circuit:- A sequential circuit is an interconnection of gates and flip-flops.  The gates by themselves constitute a combinational circuit, but when contained with th

Systems Design Lifecycle, What is the development lifecycle? Why is it usef...

What is the development lifecycle? Why is it useful? Describe the activities carried out at each stage Determination of scope Requirements specification Design Coding Testing Maint

Software development, SOFTWARE DEVELOPMENT: Software development is a ...

SOFTWARE DEVELOPMENT: Software development is a human activity. It involves a clear understanding of the field of application, such as library and information science; knowled

What is structured programming explain, Q. What is structured programming a...

Q. What is structured programming and why is it important? Ans. Structured programming is a term that was coined in the late 1960's to mean programming without using go to st

Memorandum for circulation to members, Question: You work with Mr Aksha...

Question: You work with Mr Akshay Kapoor, Human Resource Manager of an IT Company called LTZ. Mr Kapoor is the Chairperson of the Human Resource Policy Committee. Other members

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