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

Analysis and design techniques - unified modeling language, Case Study: ...

Case Study: LHM is a London based privately owned hospital which provides healthcare to its patients.  The hospital uses in-house software to manage and service its patients whi

What is quality assurance and standards, What is Quality assurance and stan...

What is Quality assurance and standards? Standards are the key to efficient quality management. They may be international, national, and organizational or project standards.

Explain practical process quality, Practical process quality Explain pr...

Practical process quality Explain process standards such as how reviews should be conducted, configuration management, etc. Monitor the development process to make sure that

What is a data object, What is a data object? Data object is a collecti...

What is a data object? Data object is a collection of attributes that act as an aspect, characteristic, quality, or descriptor of the object.

Determine ways to handle concurrency, How to handle concurrency:  Mech...

How to handle concurrency:  Mechanisms Locks Semaphores Monitors Synchronized methods Methods Deadlock avoidance Verification Sim

What is transform mapping, What is Transform mapping? The transform map...

What is Transform mapping? The transform mapping is a set of design steps applied on the DFD in order to map the transformed flow characteristics into exact architectural style

What are the related data items, What are the Related data items Relate...

What are the Related data items Related data items captures details of related attributes. Range of values store total possible values of that data. Data structure definition c

Determine the higher order programming languages, Determine the Higher orde...

Determine the Higher order programming languages Higher order programming languages such as COBOL and PASCAL came into existence. Use of these made programming much easier. In

Why is maintenance of a software important, Q. Why is maintenance of a soft...

Q. Why is maintenance of a software important? Discuss some of the problems that are faced during maintenance of software. Ans: The modification of a software product subsequ

What is sci, What is SCI? Software Configuration Item is in order that ...

What is SCI? Software Configuration Item is in order that is carried as part of the software engineering process.

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