Print Page | Close Window

Control Structure testing

Printed From: One Stop Testing
Category: Software Testing @ OneStopTesting
Forum Name: Beginners @ OneStopTesting
Forum Discription: New to the Club...!!! Don't Worry, We are here for you...!!! Learn the very basics of Software Testing and other pertinent Informations.
URL: http://forum.onestoptesting.com/forum_posts.asp?TID=3017
Printed Date: 03Feb2025 at 9:58am


Topic: Control Structure testing
Posted By: tanushree
Subject: Control Structure testing
Date Posted: 18Oct2007 at 12:56am
Control Structure testing.
In programs, conditions are very important and testing such conditions is more complex than other statements like assignment and declarative statements. Basic path testing is one example of control structure testing. There are many ways in which control structure can be tested.

Conditions Testing
Condition testing aims to exercise all logical conditions in a program module. Logical conditions may be complex or simple. Logical conditions may be nested with many relational operations.
Can define:
•   Relational expression: (E1 op E2), where E1 and E2 are arithmetic expressions. For example, (x+y) – (s/t), where x, y, s and t are variables.
•   Simple condition: Boolean variable or relational expression, possibly proceeded by a NOT operator.
•   Compound condition: composed of two or more simple conditions, Boolean operators and parentheses along with relational operators.
•   Boolean expression: Condition without relational expressions.
Normally errors in expressions can be due to due to one or all or the following:
•   Boolean operator error
•   Boolean variable error
•   Boolean parenthesis error
•   Relational operator error
•   Arithmetic expression error
•   Mismatch of types
Condition testing methods focus on testing each condition in the program of any type of conditions. There are many strategies to identify errors.
Some of the strategies proposed include:
•   Branch testing: Every branch is executed at least once.
•   Domain Testing:  Uses three or four tests for every relational operator depending on the complexity of the statement.
•   Branch and relational operator testing: Uses condition constraints. Based on the complexity of the relational operators, many branches will be executed.
Example 1: C1 = B1 & B2
•   where B1, B2 are boolean conditions..
•   Condition constraint of form (D1,D2) where D1 and D2 can be true (t) or false(f).
•   The branch and relational operator test requires the constraint set {(t,t),(f,t),(t,f)} to be covered by the execution of C1.
Coverage of the constraint set guarantees detection of relational operator errors.



Print Page | Close Window