Software Testing Fundamentals
This cheat sheet covers the foundational principles, methodologies, and practices of software testing, from its historical context to modern approaches like Agile and DevOps, emphasizing quality assurance and defect detection.
Core Principles
- Testing shows the presence of defects, not their absence.
- Exhaustive testing is impossible.
- Start testing early in the development cycle.
- Defects tend to cluster together.
- Testing is context-dependent.
- Validation ensures the right product is built; Verification ensures the product is built right.
- Continuous Integration (CI) and Continuous Delivery (CD) are crucial for rapid feedback and quality.
- Automation is key to efficient and effective testing.
- Both sunny-day and rainy-day testing are essential for confidence and security.
Action Steps
- Identify requirements and develop test cases to verify each.
- Develop test cases covering valid and invalid equivalence partitions.
- Select test cases to test boundary conditions.
- Create test cases to ensure every statement and branch is traversed.
- Introduce defects (mutants) and check if test cases can detect them.
- Model the flow of data in a program to identify where variables are defined and used.
- Develop test cases to execute all Definition-Use (DU) paths.
- Document findings carefully during exploratory testing.
- Automate test generation and execution where possible.
- Continuously learn and adapt testing strategies based on results.
Key Terms
- Verification: Ensuring the product is built right; checking if it meets original requirements.
- Validation: Ensuring the right product is built; checking if it meets user needs and stakeholder intent.
- Defect: A flaw or error in the code that causes a failure.
- Failure: The software not doing what it is supposed to do.
- Equivalence Partitioning: Dividing input domain into partitions, assuming all inputs in a partition behave similarly.
- Boundary Value Analysis: Testing at the edges of equivalence partitions.
- Cyclomatic Complexity: A metric to measure the complexity of a program's control flow graph.
- Mutation Testing: Introducing small changes (mutants) into the code to check if existing tests can detect them.
- Fuzz Testing: Generating invalid, random, or unexpected inputs to find system vulnerabilities.
- Metamorphic Testing: Testing without a direct test oracle by using relationships between test cases.
- Defect Based Testing: Deriving test cases from defect taxonomies to target specific defect categories.
- Exploratory Testing: Simultaneously learning, test design, and test execution, exploring the product on the fly.
- Code Coverage: Measuring the proportion of code executed by tests (e.g., statement, branch, condition).
- Data Flow Testing: Analyzing the flow of data through a program, focusing on variable definitions and uses.
- Symbolic Execution: Executing a program with symbolic values to identify path conditions and test data.
Timeline
- 1968: Term 'software engineering' first used at a workshop in West Germany.
- 2011: ISO/IEC/25010 standard released, categorizing quality into 8 characteristics.
- 2018: State of Testing Report published, indicating growth in QA team size and AI adoption.
More like this