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 in detail about integration testing, Explain in detail about Integr...

Explain in detail about Integration testing. It is a systematic method for constructing the program structure. Incremental integration - The program is constructed and

Determine the aspects of prototyping model., Determine the aspects of proto...

Determine the aspects of prototyping model. Figure below portrays prototyping model. Prototype model has the below aspects: (i)  It helps in determining user requirements

Define a class diagram with example, Q. Define a Class diagram with example...

Q. Define a Class diagram with example? Class diagram: A class diagram in the UML (Unified Modelling Language) is a type of static structure diagram that describes the struct

Discuss in detail about structural modeling, Discuss in detail about Struct...

Discuss in detail about Structural Modeling. Structural model includes a detail refinement of ERD, data flow model and control flow model. Creating an ERD. For example

What are quality management activities, What are Quality management activit...

What are Quality management activities. Quality assurance Establish organisational process and standards for quality. Quality planning Select applicab

Static single variable model and static multivariable model, Q. Static sing...

Q. Static single variable model and static multivariable model? Static single variable model : Methods using this model utilize an equation to estimate the desired value such

#title., Ask EXPLAIN GENERIC PROCESS MODEL & REQUIREMENT ENGINEERING PROCE...

Ask EXPLAIN GENERIC PROCESS MODEL & REQUIREMENT ENGINEERING PROCESSquestion #Minimum 100 words accepted#

Structure, what is structure and design methodology

what is structure and design methodology

State the meaning of data dictionary, What is meant by Data dictionary? ...

What is meant by Data dictionary? The Data dictionary is an organized listing of all data constituents that are related to the system, with precise, accurate definitions so 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

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