QA AND TEST AUTOMATION · PART 0 · INTRODUCTION AND CAREERS · BASICS · 6 OF 112

The 7 Principles of Software Testing, With Examples

The seven principles of software testing, each shown on the ShopRung shop: why a green suite is not proof, why exhaustive testing is impossible (46 billion carts), why early testing saves money, how defects cluster, why tests wear out, why context decides, and the absence-of-defects fallacy, plus the misquotes interviewers listen for.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 67
  63. 68
  64. 69
  65. 70
  66. 71
  67. 72
  68. 73
  69. 74
  70. 75
  71. 76
  72. 77
  73. 78
  74. 79
  75. 80
  76. 81
  77. 82
  78. 83
  79. 84
  80. 85
  81. 86
  82. 87
  83. 88
  84. 89
  85. 90
  86. 91
  87. 92
  88. 93
  89. 94
  90. 95
  91. 96
  92. 97
  93. 98
  94. 99
  95. 100
  96. 101
  97. 102
  98. 103
  99. 104
  100. 105
  101. 106
  102. 107
  103. 108
  104. 109
  105. 110
  106. 111
  107. 112
1 / 16

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Presence not absence
  • no exhaustive testing
  • test early
  • bugs cluster
  • tests wear out
  • context
  • right thing

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.

The seven (ISTQB v4.0)
  • 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.

Bug on, suite still green
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.

The buggy line
// 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.

Count the carts
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.

SAVE10: 4 tests, not 46 billion
$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.

One wrong rule, found at...
  • 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.

ShopRung bug switch
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.

Keep the suite alive
  • 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.

Same principles, different depth
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.

Bug-free, still failing
  • 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.

In one sprint
  • 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.

Rules of thumb
  • 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.

Common misquotes
  • "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.

In the interview
  • "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."

Interview questions

Q1What are the seven principles of software testing?

Testing shows the presence, not the absence, of defects; exhaustive testing is impossible; early testing saves time and money; defects cluster together; tests wear out (the pesticide paradox); testing is context dependent; and the absence-of-defects fallacy.

Q2All your tests pass. Can you say the software has no bugs?

No. You can say no failures were found by the tests you ran, and list what was and was not covered. Testing can show that defects are present but can never prove that they are absent.

Q3If you have 100% code coverage, are you done testing?

No. Coverage shows which code ran, not whether the right values and outcomes were checked. A test at $60.00 covers a buggy "> $50.00" check completely and still misses the defect that only $50.00 reveals.

Q4Why is exhaustive testing impossible, and what do you do instead?

Inputs and combinations explode: a 12-product shop already has billions of possible carts. Instead you prioritise by risk and use test design techniques such as equivalence partitioning and boundary value analysis to pick a few values that can each catch a different defect.

Q5What is the pesticide paradox, and how do you deal with it?

Repeating the same tests makes them stop finding new defects (ISTQB v4.0 calls it "tests wear out"). Keep them for regression, but review and update them, add new cases and data, and add exploratory testing.

Q6What does defect clustering mean for your test plan?

A few modules usually contain most defects, often the complex or frequently changed ones. Use bug history and change data to test those areas more deeply, while still covering the rest at a lighter level.

Q7What is the absence-of-defects fallacy? Give an example.

Software with no known defects can still fail if it does not meet user needs. A shop that passes every written rule but forces sign-up before the cart may still lose customers who wanted guest checkout.

Q8Why does early testing save money?

A defect found in a requirement review costs a conversation; the same defect found after release means code changes, retesting, regression, a new release and possibly harm to users. Reviews and tests early in the cycle prevent that rework.