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 types of software maintenance, What are the types of software m...

What are the types of software maintenance? Corrective maintenance - Means the maintenance for correcting the software faults. Adaptive maintenance - Means maintenance for a

Explain the process of prototyping, Explain the process of Prototyping ...

Explain the process of Prototyping Prototyping is a process which enables developer to create a small model of software. IEEE 610.12 standard defines prototype as a preliminary

Software design by using stacks and queues, Instructions: For this assignm...

Instructions: For this assignment, you will be using stacks and queues to solve a maze in a couple of different ways. You are supplied with code to start you off. When run, it ope

What is dfd, What is DFD? Data Flow Diagram depicts the information flo...

What is DFD? Data Flow Diagram depicts the information flow and the transforms that are applied on the data as it moves from input to output.

What is process involved in maturity levels in seis cmm, What is process in...

What is process involved in maturity levels in SEIs CMM. Level 1: Initial - a small number of processes are defined and individual efforts are taken. Level 2: Repeatable - T

What do you understand by the term integrity, Question: (a) What do yo...

Question: (a) What do you understand by the term "integrity"? (b) Which type of attack denies authorized users access to network resources? (c) You have discovered tha

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

State the system engineering hierarchy, State the System Engineering Hierar...

State the System Engineering Hierarchy? The world view is composed of a set of domains (Di), which can each be a system, or system of systems. WV = {D1,D2,D3,...........,Dn}

What are the proper testing strategy, What are the proper testing strategy ...

What are the proper testing strategy It is necessary to develop a proper testing strategy to ensure all possible scenarios are covered and that all error trapping techniques ar

State the categories of software maintenance, Categories of software mainte...

Categories of software maintenance There are three categories of maintenance:  i) Corrective Maintenance ii) Adaptive Maintenance iii) Perfective Maintenance

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