Design the test cases and test the program of Triangle Problem by using Data Flow testing

In this article, we will formulate test cases for triangle problems using data flow testing in such a way that all the du and dc paths get covered. The first step is to generate flow graph from the code ( Here’s the code).

Same as path testing make flow graph.

path testing practical problem 1

Now, make Decision-to-Decision table in which consecutive nodes are counted as an individual.

path testing practical problem

On the basis of above table, create DD graph.

path testing practical problem 2

After DD graph, it is time to figure out du and dc paths. For this, create ‘ defined node and used at node’ table to view variable’s definition and initialization.

data flow testing triangle problem

From above table, find du and dc paths.

data flow testing triangle problem 1

Based on du and dc paths create test cases, covering each and every variable definition and usage.

Test IDabcExpected OutputProgram OutputTested Outcome
15105Not a triangleInvalid InputFail
21095Scalene triangleScalene trianglePass
3515Isosceles triangleIsosceles trianglePass
4555Equilateral TriangleEquilateral TrianglePass
5-155Invalid InputInvalid InputPass

Leave a Reply