What is control structure testing?

What type of testing come under this?explain with an example

Questions by smitha5

Showing Answers 1 - 6 of 6 Answers

satish

  • Nov 22nd, 2007
 

Control structure testing is a part of white box testing. it includes following methods:
1) Condition testing
2) Loop testing
3) Data validation testing.
4) Branch testing/Path testing.

  Was this answer useful?  Yes

neha

  • Mar 25th, 2019
 

Control structure testing
Control structure testing is a group of white-box testing methods.
CONDITION TESTING
• It is a test case design method.
• It works on logical conditions in program module.
• It involves testing of both relational expressions and arithmetic expressions.
• If a condition is incorrect, then at least one component of the condition is incorrect.
Types of errors in condition testing are
• boolean operator errors
• boolean variable errors
• boolean parenthesis errors
• relational operator errors
• arithmetic expression errors
- Simple condition: Boolean variable or relational expression, possibly proceeded by a NOT operator.
- Compound condition: It is composed of two or more simple conditions, Boolean operators and parentheses.
- Boolean expression: It is a condition without Relational expressions.
DATA FLOW TESTING
- Data flow testing method is effective for error protection because it is based on the relationship between statements in the program according to the definition and uses of variables.
- Test paths are selected according to the location of definitions and uses of variables in the program.
- It is unrealistic to assume that data flow testing will be used extensively when testing a large system, However, it can be used in a targeted fashion for areas of software that are suspect.
LOOP TESTING
- Loop testing method concentrates on validity of the loop structures.
- Loops are fundamental to many algorithms and need thorough testing.
- Loops can be defined as simple, concatenated, nested, and unstructured.
Simple loops :
• The following set of tests can be applied to simple loops, where n is the maximum number of allowable passes through the loop.
• Skip the loop entirely.
• Only one pass through the loop.
• Two passes through the loop.
• M passes through the loop where m < n
• n –1, n, n + 1 passes through the loop.

Nested loops : If we were to extend the test approach for simple loops to nested loops, the number of possible tests would grow geometrically as the level of nesting increases. This would result in an impractical number of tests.
1. Start at the innermost loop. Set all other loops to minimum values.
2. Conduct simple loop tests for the innermost loop while holding the outer loops at their minimum iter
3.Conducting tests for the next loop, but keeping all other outer loops at minimum values and other nested loops to “typical” values.
4. Continue until all loops have been tested.
Concatenated loops : Concatenated loops can be tested using the approach defined for simple loops, if each of the loops is independent of the other. However, if two loops are concatenated and the loop counter for loop 1 is used as the initial value for loop 2, then the loops are not independent
Unstructured loops: Whenever possible, this class of loops should be redesigned to reflect the use of the structured programming constructs

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions