Articles

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

Share

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.

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

On the basis of above table, create DD graph.

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.

From above table, find du and dc paths.

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

Sandeep Verma

Published by
Sandeep Verma
Tags: data flow testing software testing software testing lab st ST lab test cases triangle problem