Test Types: Functional, Non-Functional, Regression, and More
Test levels answer "how much of the system," test types answer "what kind of question." Learn the vocabulary that shows up in every real test plan.
What you'll learn
- Distinguish functional from non-functional testing
- Explain the specific purpose of regression, smoke, and sanity testing
- Choose the correct test type for a given testing goal
Prerequisites
Explanation
Test levels (the previous lesson) describe how much of the system you're exercising — one function, several connected, or the whole thing. Test types describe what kind of question you're asking, and that question can be asked at almost any level.
Functional testing asks: does the system do what it's supposed to do? Given this input, is this the correct output? It's checked directly against requirements and is usually what people picture first when they hear "testing."
Non-functional testing asks a different family of questions entirely: not "is the answer correct" but "is the way it answers acceptable." Performance (how fast, under how much load), security (can it be misused to leak data or bypass controls), usability (can real people actually use it), and compatibility (does it work across browsers, devices, screen readers) are all non-functional — the feature can be functionally perfect and still fail every one of these.
Three more test types matter constantly in day-to-day work, and they're often confused with each other:
Regression testing re-runs previously passing tests after a change, to confirm the change didn't break something that used to work. It's not about the new feature at all — it's about protecting everything that already existed. This is the type of testing that automation earns back the most time on, because the same checks repeat every release.
Smoke testing is a quick, shallow pass across the most critical paths — does the app even start, can a user log in, does the homepage load — run immediately after a new build, before investing time in deeper testing. It answers "is this build stable enough to bother testing further?" A failed smoke test means: stop, don't proceed to detailed testing yet.
Sanity testing is narrower still: a focused check that a specific recent fix or small change works as intended and hasn't broken the immediately related area, without the broader scope of a full regression pass. If a bug fix for the search box just shipped, a sanity test checks the search box; it does not re-check the entire application the way regression testing would.
Knowing these distinctions matters because they imply different scope and different cost: skipping regression testing to save time on a "small" change is exactly how old bugs come back, and running a full regression suite when a five-minute smoke test would answer the real question wastes everyone's time.
Example
A function's correctness (functional) versus how long it takes to run (non-functional) are two separate questions about the same code.
function sortLargeList(list) {
return [...list].sort((a, b) => a - b);
}
const result = sortLargeList([5, 3, 1, 4, 2]);
console.log(result); // functional question: is this correctly sorted?
const start = performance.now();
sortLargeList(new Array(100000).fill(0).map(() => Math.random()));
const elapsedMs = performance.now() - start;
console.log("Elapsed ms:", elapsedMs); // non-functional question: is this fast enough?Try it yourself
Change the list size below and re-run — notice the functional correctness never changes, only the performance question does.
Code editor. Press Escape then Tab to leave the editor if keyboard focus becomes trapped. Press Control+Shift+M inside the editor to toggle Tab-key focus trapping.
Guided exercise
Guided exercise
Classify two testing goals using the strings 'functional' or 'non-functional': goalA = 'confirm the discount calculation returns the correct total'. goalB = 'confirm the checkout page loads within 2 seconds on 3G'.
Checks: correctly classifies goal A as functional · correctly classifies goal B as non-functional
Code editor. Press Escape then Tab to leave the editor if keyboard focus becomes trapped. Press Control+Shift+M inside the editor to toggle Tab-key focus trapping.
Stuck? Get a hint.
Independent exercise
Independent exercise
Classify three testing situations using the strings 'regression', 'smoke', or 'sanity': situationA = 'right after deploying a new build, quickly confirm login and homepage both still work before deeper testing'. situationB = 'a bug fix just shipped for the password-reset email; confirm just that flow still works'. situationC = 'before a major release, re-run the full suite of previously passing tests across the whole app'.
Checks: correctly classifies situation A as smoke · correctly classifies situation B as sanity · correctly classifies situation C as regression
Code editor. Press Escape then Tab to leave the editor if keyboard focus becomes trapped. Press Control+Shift+M inside the editor to toggle Tab-key focus trapping.
Stuck? Get a hint.
Common mistakes
- Using "regression testing" and "sanity testing" interchangeably — regression is broad and re-checks old behavior; sanity is narrow and checks one recent change.
- Skipping smoke testing and going straight to deep testing on an unstable build, wasting detailed-testing time on a build that was never going to survive basic use.
- Treating non-functional requirements as optional "nice to haves" rather than testable requirements with their own pass/fail criteria.
Knowledge check
Takeaway
Test levels answer "how much of the system"; test types answer "what kind of question" — and mixing up regression, smoke, and sanity testing leads to either wasted time or missed defects.
Summary
This lesson distinguished functional from non-functional testing and clarified the specific, non-interchangeable purposes of regression, smoke, and sanity testing.
References
Your notes
Notes save automatically.
Finished this lesson?
Mark it complete to track your progress and schedule a future review.
AI tutor
The optional AI tutor isn't enabled in this deployment. All lessons, exercises, quizzes, and search work fully without it.