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 the process specification, Define Process Specification . Proces...

Define Process Specification . Process Specification is used to clarify all flow model processes that appear at the final level of refinement. Check & Convert pressure

What are dynamic testing tools, Q. What are dynamic testing tools? Explain ...

Q. What are dynamic testing tools? Explain the functions that they must support. Ans. Dynamic testing tools: 1: coverage analyzers (execution verifiers): A coverage anal

Explain test archiving systems, Q. Explain Test archiving systems? Tes...

Q. Explain Test archiving systems? Test archiving systems: the goal is to keep follow of series of tests ant to act as the basis for documenting that the tests have been done

What are the advantages and disadvantages of size measure, What are the adv...

What are the advantages and disadvantages of size measure? Advantages: Artefact of software development which is simply counted. Many existing methods use LOC as a key input. A

State the term software is engineered, Justify the term "Software is engine...

Justify the term "Software is engineered" Software is engineered not manufactured. Although some similarities exist between software development and hardware manufacture, the t

What are the aims of testing, What are the aims of testing? i. T...

What are the aims of testing? i. Testing is a process of executing a program with the target of finding an error. ii. A good test case is one that has high possibilit

First-cut entity relationship, A University has asked you to design and imp...

A University has asked you to design and implement a simple database to store student and module details (including details of which school students belong to and which schools run

Explain the static testing and dynamic testing, Static testing and dynamic ...

Static testing and dynamic testing Static testing is checking the application without actually running the application while dynamic testing checks the application by running i

Explain the concept of decision tables, Explain the concept of Decision Tab...

Explain the concept of Decision Tables Decision table models complex logic into precise yet compact way. A decision table lists causes and effects in a matrix. Every column

Explain the instruction pipelines, Explain the Instruction pipelines In...

Explain the Instruction pipelines Instruction pipelines: - An instructin pipeline reads consecutive instructions from memory whereas previous instructions are being implemented

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