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

Explain silktest and its methodology behind silk test, Describe SilkTest? W...

Describe SilkTest? What is the methodology behind Silk test? SilkTest is a software testing automation tool which is developed by Segue Software, Inc. Methodology behind thi

What is operational requirements, What is Operational Requirements? Ans)...

What is Operational Requirements? Ans) Qualitative and quantitative parameters that states the desired operational capabilities of a system and serve as a basis for determining

Define kpas level associated with maturity model, Define KPAs level associa...

Define KPAs level associated with maturity model KPAs are defined by SEI and associated with different maturity levels.  These are described below: Level 1 KPAs : There is

What is compatibility testing, What is Compatibility testing - It's a n...

What is Compatibility testing - It's a non-functional test performed on a software system or component for checking its compatibility with the other parts in computing environm

Black box and white box testing, I am not properly understanding the basis ...

I am not properly understanding the basis difference between black box testing and white box testing. Please explain in simple way and with some example so that I can easily under

Define graph matrix and connection matrix, Q. Define graph matrix and conne...

Q. Define graph matrix and connection matrix. Ans: Graph matrix: A graph matrix is a square matrix whose size that is a number of rows and columns is equal to the number of n

SYSTEM ANALYSIS AND DESIGN, A program is to be developed to simulate the op...

A program is to be developed to simulate the operations of a scientific calculator. List the facilities to be provided by this calculator. Analyze this using a DFD 0 - level and 1

Show the advantages of incremental model, Q. Show the Advantages of increme...

Q. Show the Advantages of incremental Model? As product is to be conveying in parts total cost of the project is distributed. Limited number of persons is able to be pu

Evaluate the usefulness of roce, Present an evaluation of the current perfo...

Present an evaluation of the current performance of your chosen company using ROCE, RI, EVA and SVA.  (All figures employed should be up to date , clearly explained / justified an

How do stubs and drivers are related to manual testing, How do stubs and dr...

How do stubs and drivers are related to manual testing? - Drivers and stubs are a part of incremental testing. - The two different techniques used in incremental testing are

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