Course contentsShow
← Software Engineering
Lesson 402 of 1,93312. Testing FundamentalsFree lesson

What to Test: Risk-Based Testing

Prioritize testing critical paths, complex logic, and areas with high change frequency or business value.

What to Test: Risk-Based Testing

You'll learn: How to prioritize your testing efforts by focusing on the parts of your code that matter most.

The Core Idea

You can't test everything exhaustively—there simply isn't enough time. Risk-based testing means directing your testing energy toward the code that poses the highest risk if it fails. Think of it like home insurance: you insure your house, not every sock you own, because the house failure has catastrophic consequences.

Risk in software comes from several factors:

Critical paths are the core workflows users depend on. If your e-commerce site's checkout process breaks, you lose money immediately. Test this relentlessly.

Complex logic harbors more bugs. A function with nested conditionals, intricate calculations, or multiple edge cases deserves thorough testing. Complexity breeds defects.

High change frequency areas are risky because they're constantly being modified. That authentication module you've touched five times this month? It needs strong test coverage because each change might introduce regressions.

Business value determines impact. A reporting feature used by two admins monthly is lower priority than the login system used by thousands daily.

Applying Risk-Based Thinking

Ask yourself: "What would happen if this broke?" If the answer is "catastrophic data loss," "security breach," or "complete service outage," test it thoroughly. If the answer is "a minor UI glitch in an admin panel," it's lower priority.

This doesn't mean skip testing low-risk areas entirely—just allocate your limited time wisely. Cover high-risk code with comprehensive tests first, then expand coverage as time permits.

Key Takeaway: Focus your testing on critical paths, complex logic, frequently changed code, and high-value features—test where failure hurts most, not everything equally.