Notes
The idea
The seven principles come from the ISTQB syllabus, the shared vocabulary of the testing world, and they hold for manual and automated testing alike. One, testing shows defects are present, not that they are absent. Two, exhaustive testing is impossible. Three, early testing saves time and money. Four, defects cluster together. Five, tests wear out. Six, testing depends on context. Seven, a product with no defects can still fail. Let us take them one at a time.
- 1 testing shows the presence, not the absence, of defects
- 2 exhaustive testing is impossible
- 3 early testing saves time and money
- 4 defects cluster together
- 5 tests wear out 6 testing is context dependent
- 7 absence-of-defects fallacy
1 · Presence, not proof
Principle one. Testing can show that defects are present, but it can never prove there are none. Here is proof from ShopRung. Turn on the coupon boundary bug, so SAVE10 wrongly refuses a subtotal of exactly fifty dollars. Now run three tests: SAVE10 at sixty, SAVE10 at a hundred, FLAT5 at twenty. All three pass. The suite is green, and the bug is still there. A green run means no failures were found by these tests, nothing more.
SHOPRUNG_BUGS=coupon-boundary SAVE10 at $60.00 PASS SAVE10 at $100.00 PASS FLAT5 at $20.00 PASS all green, yet SAVE10 at exactly $50.00 is refused green = no failures found here
Coverage is not proof
This is where developers and SDETs get caught. The buggy line in ShopRung says subtotal greater than the minimum, where it should say greater than or equal. The sixty dollar test runs that exact line, so a coverage tool reports it as covered. One hundred percent line coverage, and the bug survives, because no test used the value that tells the two versions apart. Coverage shows what code ran. It does not show that the right values were checked.
// should be: subtotal >= min enough = subtotal > min test at $60.00 runs this line line coverage: 100% bug found: no coverage tells you what ran, not what was checked well
2 · Exhaustive testing
Principle two. Exhaustive testing is impossible, except for tiny cases. ShopRung sells only twelve products, and each cart line holds zero to ten, limited by stock. Multiply the choices and you get about forty six billion different carts. Before coupons, users or browsers. At one test per second, that is over fourteen hundred years. So testers never try everything. They choose, using risk and test design techniques, which is most of what part one of this course teaches.
12 products, quantity 0 to 10, capped by stock: 11^8 x 4 x 1 x 9 x 6 = 46,301,518,296 carts x coupons, x users, x browsers at 1 test per second: over 1,400 years
Choose, do not count
So how do you choose? Pick values where bugs live. For SAVE10: forty nine ninety nine, just below the line, must be refused. Exactly fifty must get five dollars off. Sixty is a typical case. And fifty forty five tests rounding: ten percent is five dollars and four and a half cents, and rule price six says half a cent rounds up, so the discount is five oh five. Four tests, and each one can catch a different real bug in ShopRung.
$49.99 refused (just below)
$50.00 $5.00 off (boundary)
$60.00 $6.00 off (typical)
$50.45 $5.05 off (PRICE-6:
$5.045 rounds up)
5 x Sticker Pack $4.99
+ Wireless Mouse $25.50
each value can catch a
different real bug 3 · Early testing
Principle three. Early testing saves time and money. Imagine nobody asked whether free shipping is judged before or after the discount. Found in refinement, it costs one question and one changed sentence. Found in code review, a small edit. Found in system testing, a fix, a retest, regression and a new build. Found in production, real customers have wrong totals, and you face refunds, support tickets and lost trust. That is why testers review requirements, not just software.
- refinement: one question, one sentence changed
- code review: a small edit
- system test: fix, retest, regression, new build
- production: wrong totals on real orders, refunds, support tickets, trust
- cost grows at every step
4 · Defects cluster
Principle four. Defects cluster together. A small number of modules usually holds most of the defects, often the complex ones or the ones that change a lot. ShopRung shows the pattern: five of its eleven known bugs live in one small file, the pricing rules. In real projects, your bug tracker tells you where the clusters are. Use that to aim your testing: go deeper where bugs have been found before, but never stop looking elsewhere.
known bugs by file pricing.js 5 of 11 coupon, rounding, shipping, expiry, quantity limit api.js 6 of 11 search, orders, sign-up one small rules file holds almost half the bugs
5 · Tests wear out
Principle five. Tests wear out. Older material calls it the pesticide paradox. If you run the same tests again and again, they keep confirming the same paths, and stop finding new bugs. The SAVE10 test at sixty dollars may pass for a year and will never find the boundary bug. So keep old tests as a regression safety net, but regularly review them, add new cases, vary the data, and explore with fresh eyes.
- old name: pesticide paradox
- the same SAVE10 test at $60.00 has passed for a year
- and will never find the boundary bug
- fix: review and add tests, vary the data, explore with fresh eyes
6 · Context dependent
Principle six. Testing is context dependent. There is no one right way. A shop like ShopRung cares most about money, privacy, browsers and speed. A banking app adds security and audit trails. A medical device needs formal evidence that regulators will check. A mobile game cares about fun, crashes and thousands of devices. Even the process changes: a startup shipping daily tests differently from a team releasing twice a year. Always ask what is at stake here.
online shop money, privacy,
browsers, speed
banking app security, audit,
exact amounts
medical device safety, formal
evidence, rules
mobile game fun, devices,
crashes, store 7 · Absence-of-defects
Principle seven, the absence of defects fallacy. Finding and fixing every defect does not guarantee success. Suppose ShopRung passes all forty one written rules. Rule account eight says the cart needs an account. If shoppers wanted guest checkout, many may leave before paying, and the shop fails anyway. The software was built right, but it was not the right thing. Testers help here too, by questioning requirements and watching how real users behave.
- ShopRung passes all 41 rules
- but ACC-8: the cart needs
- an account
- if shoppers want guest
- checkout, many may leave
- before they ever pay
- verification passed;
- validation failed
All seven at work
In practice, the principles show up as decisions, not as a list. In refinement you ask questions early, principle three, and question whether the rule is right, principle seven. In planning you choose depth by risk and context, principles two and six, and aim at the pricing code, principle four. In design you choose boundaries and refresh old data, two and five. And when you report, you say no failures in what we tested, which is principle one.
- refinement: ask early (3) and question the rule (7)
- planning: depth by risk and context (2, 6), pricing first (4)
- design: boundaries and fresh data (2, 5)
- report: "no failures found in what we tested" (1)
Rules of thumb
Turn each principle into a habit. Always report what you tested and what you did not. Test at the boundaries, not only typical values. Review stories before code exists. Follow the bug history to find the clusters. Refresh a few tests every sprint, so the suite keeps finding things. And as well as asking does it work, ask is this the right thing for the user. These habits are what the principles look like on an ordinary day.
- report what you tested and what you did not
- test at the boundaries, not only typical values
- review stories before code
- follow the bug history
- refresh a few tests every sprint
- ask "is this the right thing?" as well
Common mistakes
Watch for the common misquotes. Testing proves it works: no, it shows where it does not. Full coverage means no bugs: no, coverage shows what ran. We automate, so we test everything: automation runs more tests faster, but never all of them. Tests wear out, so delete old ones: no, keep them for regression and add new ones. Bugs cluster, so ignore the rest: no, aim deeper there but keep looking. And no bugs does not mean success.
- "testing proves it works"
- "100% coverage, so no bugs"
- "we automate, so we test everything"
- "tests wear out, so delete old tests"
- "bugs cluster, so ignore the rest"
- "no bugs means success"
Say it like this
A common question: what are the seven testing principles? List them in one breath. Testing shows presence, not absence. Exhaustive testing is impossible. Test early. Defects cluster. Tests wear out. Testing depends on context. And no defects does not mean success. Then prove you understand one with a story. For example, a suite with full line coverage missed a greater than that should have been greater than or equal, until I added a test at exactly fifty dollars.
- "Presence not absence, exhaustive is impossible, test early, defects cluster, tests wear out, context matters, and no defects is not success. For example, a suite with full coverage missed a > that should be >=, until I tested $50.00."