White box testing, also known as structural, glass box, or clear box testing, is a software testing approach that examines the internal workings and code structure of the system being tested. The goal is to validate the correctness of the code, ensure that it meets design specifications, and exercise all possible paths and conditions. White box testing is often performed by developers or specialized testers who have knowledge of the internal code.
Here are some common white box testing techniques:
-
Statement Coverage:
- Objective: Ensures that each statement in the code is executed at least once during testing.
- Technique: Test cases are designed to execute each line of code in the program.
-
Branch Coverage:
- Objective: Ensures that each branch (decision point) in the code is taken at least once during testing.
- Technique: Test cases are designed to cover all possible outcomes of decision points in the code.
-
Path Coverage:
- Objective: Ensures that every possible path through the code is traversed at least once.
- Technique: Test cases are designed to cover all possible combinations of paths, including loops and conditionals.
-
Condition Coverage:
- Objective: Ensures that each Boolean condition in the code is evaluated to both true and false during testing.
- Technique: Test cases are designed to exercise each condition with inputs that make it both true and false.
-
Loop Testing:
- Objective: Focuses on testing the functionality of loops, including loop boundaries, exit conditions, and iterations.
- Technique: Test cases are designed to test loops with various input conditions, including zero, one, and multiple iterations.
-
Data Flow Testing:
- Objective: Examines the flow of data within the program, identifying paths where data is used or modified.
- Technique: Test cases are designed to cover the different data flows within the code.
-
Mutation Testing:
- Objective: Introduces small changes (mutations) to the code and checks if the existing test cases can detect these changes.
- Technique: The code is intentionally modified, and the test suite is run to verify if the tests can identify the introduced mutations.
-
Path Testing:
- Objective: Focuses on testing individual paths through the code to ensure that all paths are covered.
- Technique: Test cases are designed for each possible path through the code, often using a control flow graph.
-
Control Flow Testing:
- Objective: Examines the control flow of the program to identify execution paths.
- Technique: Test cases are designed to execute different control flow paths through the code.
-
Statement/Decision Testing:
- Objective: Combines statement and decision coverage, ensuring that each statement and each decision in the code is executed.
- Technique: Test cases are designed to cover both individual statements and decision points.
White box testing is complementary to black box testing, and together they provide comprehensive test coverage. While black box testing focuses on validating external behaviors and functionality, white box testing delves into the internal structure and logic of the code to ensure thorough testing. Both types of testing are valuable for achieving a high level of software quality.
Read More… Software Testing Training in Pune