Notes
The problem
Lists of fifty testing types confuse more than they teach, because the names answer different questions. Some describe the level: how big is the thing under test, from one function to the whole system. Some describe the type: which quality are we checking, like function, speed or security. Some describe the trigger: why are we testing right now, like a new build or a bug fix. Ask those three questions and the vocabulary falls into place.
- LEVEL: how big is the thing under test? unit → integration → system → acceptance
- TYPE: which quality? functional, performance, security, usability ...
- TRIGGER: why now? smoke, sanity, confirmation, regression
Test levels
Test levels go from small to big. A unit test checks one function alone, like the ShopRung discount function giving five hundred and five cents for a fifty dollar forty five cart. Integration testing checks that parts work together, like the API saving an order in the database. System testing checks the whole application end to end. Acceptance testing asks whether it meets the real business need. Developers own most unit tests. Testers live mostly at system level.
- unit discount(5045) = 505 cents
- integration API saves the order in the DB
- system browse → cart → coupon → order
- acceptance does checkout meet the business need? (UAT)
Integration styles
There are several ways to integrate. Big bang joins everything at once and then tests, which makes failures hard to locate. Top down starts at the user interface and replaces lower parts with stubs. Bottom up starts at the database and works upwards. In modern microservice systems, teams add contract tests, where each service checks the API it agreed with its neighbours. You will build one in Part four. Interviewers like to hear you know the trade offs.
- big bang: join everything, then test (hard to locate failures)
- top-down: start at the UI, stub the lower parts
- bottom-up: start at the database, drivers call up contract tests: each service checks the agreed API (Part 4)
Acceptance
Acceptance testing has a few flavours. User acceptance testing, or UAT, is business users checking the acceptance criteria on a near final build. Alpha testing is people inside the company using it before release. Beta testing gives it to a group of real customers early. Operational acceptance checks things like backups, monitoring and restore. And contract or regulatory acceptance checks what a contract or the law requires.
- UAT: business users check the acceptance criteria
- alpha: users test inside the company, before release
- beta: a group of real customers try it early
- operational acceptance: backups, monitoring, restore
- contract / regulatory: rules the law requires
Functional types
Now the second question: which quality? Functional testing checks what the system does against its requirements. Does save ten work from fifty dollars? Do orders move through the right states? Is search case insensitive? All the design techniques you have learned so far, partitions, boundaries, decision tables and states, are mostly used for functional testing. It is the bulk of a tester's day.
- checks WHAT the system does
- against the requirements
- ShopRung examples: SAVE10 from $50.00 (PRICE-3) order states (ORD-4) search not case-sensitive
- techniques: partitions, boundaries, tables, states
Non-functional types
Non functional testing checks how well the system does its job. Performance: search returns in under a second, which is rule search five. Load and stress: many users at once. Security: Bob must not see Alice's order. Usability: messages say how to fix the problem. Accessibility: every field has a label. Compatibility: it works on the main browsers. Each has its own part later in this track, because each needs its own tools.
- performance search < 1 s (SRCH-5)
- load, stress many users
- security ORD-7: no peeking
- usability clear messages (NF-3)
- accessibility labels (NF-2)
- compatibility browsers (NF-1)
- reliability, recovery
Smoke testing
The third question: why test right now? A smoke test runs on every new build and answers one thing: is this build stable enough to test at all? It is wide and shallow. For ShopRung: the app starts and the health check says up, products load, Alice can log in, add to cart and place an order. Fifteen minutes, usually automated. If smoke fails, the build goes back, and nobody wastes a day testing a broken build.
- when: every new build
- goal: is it worth testing?
- breadth, not depth
- ShopRung smoke set: app starts, /api/health UP products list loads alice can log in add to cart, place order
- 15 minutes, mostly automated
Sanity testing
A sanity test is narrow. After a small fix or change, you quickly check that the changed area behaves sensibly before deeper testing. The coupon fix went in, so does save ten now work at fifty dollars, and do the totals look right? Smoke is wide and shallow across the whole app. Sanity is narrow, focused on one change. Honestly, many teams use the two words loosely, so in a new job, ask what your team means by them.
smoke sanity
whole app one area
wide, shallow narrow
every new build after a
small fix
"can we test?" "is this
change sane?"
teams use the words loosely:
ask what they mean Regression
After a bug fix, two kinds of testing follow. Confirmation testing, or re testing, runs the failed case again to confirm the bug is gone. Regression testing runs a wider set of tests to check the fix broke nothing else. A change to rounding could shift a total under the free shipping line, so shipping and order totals need checking too. Regression suites grow with every release, which is exactly why they are the first thing teams automate.
- confirmation (re-testing): run the failed case again → the bug is gone
- regression testing: run the wider suite → nothing else broke
- fix to rounding (PRICE-6) could break shipping (PRICE-9) or order totals
Box approaches
One more pair of terms. Black box testing designs tests from the requirements without looking at the code, which is what partitions and boundaries are. White box testing designs tests from the code, aiming for coverage of statements and branches. Grey box sits in between: you test the user interface but also look inside, at the API calls or the database. Most modern testers work grey box, which is why the next episodes teach SQL and DevTools.
- black box: test from the requirements, no code (partitions, boundaries)
- white box: test from the code (statement, branch coverage)
- grey box: some inside view, e.g. read the API or the DB while testing the UI
A release
Here is how they fit into one release week. Monday, the new build gets a smoke test, then functional testing and exploratory sessions on the new features. Tuesday, bug fixes get confirmation tests and a sanity check of their area. Wednesday, the full regression suite runs, mostly automated. Thursday, performance and security checks, and the business does user acceptance. Friday, the release, and a quick smoke test in production.
- Mon new build → smoke
- Mon new features: functional + exploratory sessions
- Tue bug fixes → confirmation + sanity on that area
- Wed full regression suite (mostly automated)
- Thu performance + security checks, UAT with business
- Fri release, smoke in prod
Common mistakes
Mix ups interviewers listen for. Saying regression testing means re testing, when re testing confirms a fix and regression checks everything else. Using smoke and sanity as the same word without knowing the difference. Doing only functional testing and forgetting performance, security and accessibility. UAT done by testers alone, without business users. And regression suites that only grow, with nobody pruning or automating them.
- "regression = re-testing" (they are different)
- smoke and sanity as the same thing, without asking
- only functional testing
- UAT run by testers alone
- regression suites nobody prunes or automates
- calling every bug a "regression"
Say it like this
The classic pair of interview questions. Smoke versus sanity: smoke is a wide, shallow check that a new build is stable enough to test; sanity is a narrow check that one change behaves sensibly. Re testing versus regression: re testing confirms a fixed bug is really gone; regression testing checks the fix broke nothing else, which is why regression is the first suite a team automates.
- "Smoke is a wide, shallow
- check that a new build is testable. Sanity is a narrow
- check that one change makes
- sense. Re-testing confirms
- a fixed bug is gone;
- regression checks the fix
- broke nothing else, so it is the first suite we automate."