Testing 2
Testing 2
Equivalence Class Testing (ECT) is a black-box testing technique used to reduce the number of test cases while
maintaining good coverage. It involves dividing input data into partitions or classes, where the system is expected to
behave similarly for all members of a class. Key characteristics of ECT include:
1. Partitioning Input Data: Input data is divided into equivalence classes, with the assumption that the system
will process all values in a class similarly. Typically, there are two types of classes:
2. Reduces Redundancy: By testing one representative from each equivalence class, the number of test cases is
reduced, eliminating the need to test every input. This streamlines testing without sacrificing coverage.
3. Increased Test Efficiency: ECT helps identify the minimum number of test cases needed to cover all possible
scenarios, leading to more efficient testing. The assumption is that if one test case in a class works (or fails),
others in that class will behave similarly.
4. Maximizes Coverage: ECT ensures broad coverage by testing the boundaries and representative cases of
each equivalence class. It helps uncover defects related to incorrect handling of data ranges, types, or
formats.
5. Boundary Consideration: ECT often pairs with boundary value analysis (BVA), where the edges of each
equivalence class (e.g., minimum and maximum values) are tested. This is particularly useful when errors are
likely to occur at boundaries.
The decision table testing strategy is a black-box technique used to handle complex business logic by mapping inputs
(conditions) to outputs (actions) in a structured tabular format. It helps in ensuring that all possible combinations of
conditions are tested for expected outcomes.
Let's say we are testing the conditions for withdrawing money from an ATM.
Explanation:
• Rule 1: All conditions are valid (valid card, sufficient balance, correct PIN), so withdrawal is allowed.
• Rule 2: Valid card and PIN but insufficient balance, so withdrawal is denied.
This structured approach ensures all condition-action combinations are covered, improving test completeness.
Q4 Explain cause effect graphing technique with the help of an appropriate example.
The Cause-Effect Graphing technique is a black-box testing method used to represent logical relationships between
inputs (causes) and outputs (effects) using a graphical notation. It helps in identifying combinations of inputs that
affect system behavior, leading to the creation of efficient test cases.
Key components:
• Graph: The logical relationships between causes and effects are represented as a graph, and test cases are
derived based on these relationships.
Cause-Effect Graph:
• C1 and C2 → E1: Both valid username and password lead to a successful login.
• C1 not true or C2 not true → no E1: If either username or password is invalid, login fails.
• C1 → Valid username.
• C2 → Valid password.
• E1 → Successful login.
This technique helps to ensure all logical combinations of inputs (causes) are tested to verify the system's response
(effects).
Q5. Discuss the four portions of decision table in decision table-based testing.
In decision table-based testing, a decision table is divided into four main portions, which help in systematically
representing and testing various combinations of input conditions and their corresponding outputs. These portions
are:
1. Conditions (Inputs):
These are the possible input factors or scenarios that influence the system's behavior. Each condition
represents a specific criterion to be tested.
o Example: "Is the ATM card valid?" or "Is the balance sufficient?"
3. Actions (Outputs):
These are the outcomes or system responses that occur based on the conditions. The actions represent what
the system should do in response to a given set of conditions.
o Example: If the card is valid and the balance is sufficient, the action is "Allow withdrawal."
Summary:
By combining these four portions, testers ensure that all possible input combinations and outcomes are covered
efficiently in testing.
The process of generating a graph from a program, also known as control flow graph (CFG) generation in software
testing, involves creating a graphical representation of a program's control structure. This helps in understanding the
flow of execution and is used in white-box testing for coverage analysis. The steps are:
o The edges represent the possible flow of control between nodes, showing how one block leads to
another based on conditional or unconditional branching.
o Conditional branches (e.g., if-else, loops) are shown with different edges based on the condition
outcomes.
This control flow graph helps testers visualize program execution paths, identify unreachable code, and design test
cases to cover all possible paths.
Path Testing is a white-box testing technique that focuses on ensuring that all possible execution paths in a program
are tested. The key steps involved in path testing are:
6. Evaluate Results:
Compare the actual output with the expected output for each test case. Check whether all paths are
executed as intended and whether any defects are uncovered.
Summary of Steps:
Path testing ensures thorough testing of all logical flows within the program, aiming for comprehensive code
coverage.
Control Flow Testing is a white-box testing technique that focuses on ensuring that all possible paths through a
program's control structure are tested. It helps in validating the program’s flow of execution. The main steps involved
are:
o Edges represent the flow of control between these nodes (e.g., conditional branches or loops).
2. Identify Control Flow Paths:
Determine all possible paths through the control flow graph. These paths represent the possible execution
sequences based on the program’s control structures (e.g., if, while, switch).
Summary of Steps:
Control flow testing ensures that all logical flows in the program are exercised, improving code quality and
uncovering potential errors in the control structures.
Q9 State the ways by which we calculate the Cyclomatic Complexity of an enclosed graph.
Q10. Discuss in detail the objectives of Mutation Testing. based on software testing simple and short
Mutation Testing is a white-box testing technique aimed at evaluating the effectiveness of existing test cases by
intentionally introducing small errors, or "mutations," into the code. The objective is to check whether the test cases
can detect these introduced faults. Key objectives of mutation testing are:
Mutation testing measures the strength and effectiveness of the test cases by determining whether they can catch
errors in the code. If the test cases fail to detect the mutations, it indicates weak test coverage.
If certain mutations go undetected, it suggests that some test cases are not adequately covering specific parts of the
code, or there might be redundant tests that don’t add value in finding faults. This helps in improving and optimizing
the test suite.
The process encourages the development of more comprehensive test cases that cover edge cases or less obvious
branches of the code. The goal is to improve overall code coverage by identifying missing or incomplete test
scenarios.
Mutation testing validates whether the test suite can effectively detect faults that could lead to failures. It ensures
the test cases are not just running but are actively checking for defects in the program.