3.5 Hours

19. Testing Strategies: When to Test What

Strategy

Knowing what to test is as important as knowing how to test. This module covers testing strategies, priorities, and decision-making. Understanding testing strategies is essential for building efficient test suites.

The key insight is that not all code needs the same level of testing. Core business logic needs comprehensive testing. Simple utilities need minimal testing. Error handling needs thorough testing. Understanding testing strategies helps you allocate testing effort effectively.

This module covers testing priorities, risk-based testing, and test suite management.

Testing Priorities

Testing priorities should be based on: business impact (critical features need more testing), risk (complex code needs more testing), and change frequency (frequently changed code needs more testing). Use these priorities to decide what to test and how thoroughly.

Focus on testing critical paths, complex logic, and error handling. Use lower-level tests for simpler code. Understanding testing priorities helps you build efficient test suites.

Try It Yourself: Developing a Testing Strategy

Follow these steps to develop a testing strategy for your project.

Step 1: Identify critical features
List the most important features of your application.

Step 2: Identify complex code
List the most complex parts of your codebase.

Step 3: Prioritize tests
Write tests for critical features and complex code first.

Step 4: Set coverage goals
Set realistic coverage goals for different parts of your codebase.

Step 5: Review and iterate
Review your test suite regularly and adjust priorities.

Try It Yourself: Develop a testing strategy for a project you're working on. Identify what needs the most testing.

Knowledge Check

Ready to test your understanding of 19. Testing Strategies: When to Test What?

Back