NPTEL
NPTEL
• Faults & Failures: A failure occurs when a fault (or bug) manifests during execution. Not all
faults lead to failures.
• Errors, Faults, and Failures: Defined by IEEE 1044 (1993, revised in 2010) to distinguish
between them.
• Bug Distribution:
• Cost of Poor Testing: Example of Ariane 5 rocket failure ($1 billion loss) due to an unhandled
exception during type conversion.
• Effort Required: Software testing takes 50% of development effort but only 10% of
development time due to parallel testing phases.
• Testing Phases:
• Test Plan: Documents testing scope, strategy, criteria, schedule, and resources.
• Black-box Testing:
• White-box Testing:
• Gray-box Testing:
• Pesticide Effect: The same tests repeatedly fail to detect new bugs.
• Testing helps identify faults, defects, and bugs that may lead to failures.
• 2. Importance of Testing
• Software testing takes 50% of development effort but only 10% of development time.
• Example of impact: Ariane 5 rocket failure due to an undetected software exception bug
(costing $1 billion).
• 3. Testing Process
• Steps:
• Observe outputs.
• Review
• Testing
• Formal verification
• 5. Levels of Testing
• 6. V-Model of Testing
• Strengths:
• Weaknesses:
• No phase overlaps.
• 7. Testing Techniques
• Methods:
• Grey-Box Testing
• 9. Pesticide Paradox
• Evolution:
• Manual testing → Capture & replay → Model-based testing → Fully automated testing.
Week 2
1. Equivalence Class Partitioning
• Concept:
o Divide input values into equivalence classes where each class is expected to
behave similarly.
o Testing one value from each class is as effective as testing all values from
the class.
• Guidelines:
o If input is a range (e.g., 1-5000), define one valid and two invalid
equivalence classes.
o If input is a set of values (e.g., {a, b, c}), define one valid and one invalid
equivalence class.
o If input is Boolean, define one valid and one invalid class.
• Example:
o A function computing the square root of numbers between 1-5000
o Equivalence classes:
▪ Valid: 1 to 5000
▪ Invalid: Less than 1, greater than 5000
o Test cases: { -5, 500, 6000 }
3. Combinatorial Testing
• Concept:
o Some bugs appear only when multiple inputs interact in a specific way.
o Instead of testing all possible combinations, pair-wise testing can be used.
• Example:
o A mobile app must work across different screen sizes, operating systems,
and versions.
o Instead of testing every combination (which is impractical), pair-wise testing
selects the most relevant combinations.
R1 Yes No 6%
Rule Condition: Deposit < 1 Year Deposit > 3 Years Action
R2 No Yes 8%
5. White-Box Testing
• Concept:
o Tests the internal structure of the code.
o Focuses on coverage of code paths, conditions, and logic.
• Types:
1. Statement Coverage – Ensures every line of code is executed at least once.
2. Branch Coverage – Ensures both true & false conditions of every decision point are
tested.
3. Path Coverage – Ensures every possible execution path is tested.
4. Condition Coverage – Ensures each boolean condition takes true & false values.
• Example:
c
CopyEdit
while (x != y) {
if (x > y) x = x - y;
else y = y - x;
}
o Statement coverage: Test {(x=3,y=3), (x=4,y=3), (x=3,y=4)}
o Branch coverage: Test {(x=3,y=3), (x=3,y=2), (x=4,y=3), (x=3,y=4)}
Final Summary
This document provides a deep understanding of systematic test case design techniques. It
covers:
• Equivalence Class Partitioning – Grouping input values into classes.
• Boundary Value Testing – Focusing on input boundaries.
• Combinatorial Testing – Selecting test cases for input interactions.
• Decision Table Testing – Handling conditional logic.
• White-Box Testing – Ensuring code coverage at different levels.
Week 3
Important Concepts from the Document on Software Testing
1. Condition Testing
• Basic Condition Testing: Ensures every atomic condition (Boolean expression) has both
True and False values.
• Multiple Condition Coverage (MCC): Tests all possible combinations of truth values.
• Unachievable Coverage: Some conditions cannot take both True and False due to
dependencies.
• Goal: Reduce the number of test cases while ensuring each condition independently
affects the decision.
• Requirements:
4. Path Testing
• Path Coverage: Ensures all linearly independent paths are executed at least once.
• Control Flow Graph (CFG): A representation of how control flows in the program.
• Definition-Use (DU) Chain: Ensures that defined variables are properly tested.
6. Mutation Testing
• Idea: Introduce small faults (mutants) in a program and check if the test suite catches
them.
• Mutation Operators:
7. Integration Testing
• Big Bang Testing: All modules are integrated at once and tested.
Week 4
The document provides an in-depth understanding of software testing techniques, focusing on
integration testing, system testing, regression testing, object-oriented testing, and state-based
testing. Below is a structured summary of key concepts:
1. Integration Testing
Integration testing focuses on combining individual modules and verifying their interactions.
Approaches include:
• Big Bang Approach: Combines all modules and tests them together.
System testing validates the fully developed software against its requirements. Types include:
3. Regression Testing
Regression testing ensures that code changes do not introduce new bugs. Key tasks include:
4. Object-Oriented Testing
Key Challenges
Testing Strategies
• Integration Strategies:
Defines the thoroughness of testing. Traditional coverage methods may not apply to OO programs,
requiring new strategies.
Conclusion