Picture a fictional insurance-quoting product built by a team in Nagpur. Call it PolicyDesk. It has eleven modules: login, customer profile, quote engine, premium calculator, document upload, payments, renewals, agent commissions, reports, notifications and an admin panel. The regression suite has 640 automated tests, spread fairly evenly, and it has been green for four release cycles.
Then a release goes out and customers report wrong renewal premiums. The suite was green. The team is puzzled. Two old ideas explain most of what happened.
Where the bugs actually live
When the team pulls a year of defect records and counts by module, the picture is lopsided. Suppose 130 defects were logged. The premium calculator and renewals together account for 74 of them, about 57 percent, even though they are two modules out of eleven. Login and the admin panel have 3 between them.
This pattern has a name in the ISTQB list of testing principles: defect clustering. A small number of modules contain most of the defects, and the same modules tend to cause most operational failures. It is a Pareto-style observation, not a law, and the exact split varies. What matters is that the shape is almost never flat.
The reasons are not mysterious. Premium and renewal logic is full of business rules, date arithmetic, rounding and exceptions that changed over the years. Code like that is complex, changed often, and understood fully by few people. Login, by contrast, has been stable for three years and is mostly a library call.
Back to PolicyDesk’s even spread: 640 tests over eleven modules is roughly 58 each. The two troubled modules got the same attention as the admin panel. That is fair in a spreadsheet and wasteful in practice.
Why the suite stayed green
The second idea is the pesticide paradox, a phrase credited to Boris Beizer. Spray the same pesticide on a field repeatedly and the surviving insects are the ones it does not kill. Run the same tests repeatedly and the bugs that remain are the ones those tests cannot see.
PolicyDesk’s renewal tests were written two years ago, when renewals meant “same premium plus a loading”. Since then the business added a no-claim discount that applies only after a policy has been continuous for a certain period, and a rule for customers who change their vehicle’s registration city. Nobody added tests for those paths, because the old tests kept passing. A passing test is not evidence that new behaviour works; it is evidence that old behaviour still does.
Also note what a suite of 640 tests gives you: confidence about the 640 things it checks. It says nothing about the 641st.
What the team changes
After the incident, the team does four things, none of them exotic.
First, they weight effort by defect history and by change. Using a simple rule, the next quarter’s new test design time is split roughly in proportion to where defects and code changes have been, with a floor so that no module is ignored. Premium and renewals get the largest share. Login keeps a smoke check.
Second, every production defect now produces a question: which test should have caught this, and why did none? Usually the answer is a missing input combination rather than a missing feature. The fix is a new test, and sometimes a new kind of test, such as a decision table for the discount rules.
Third, they vary the data. The renewal tests had always used the same eight sample policies. They add policies generated across ages, cities, claim histories and policy start dates, including the ones around month ends and leap years. Variation is the antidote the principle itself suggests: change the tests, add new ones, and exercise different parts of the software.
Fourth, they schedule some exploratory sessions on the risky modules, because a person who is not following a script will wander into combinations that nobody wrote down.
Using clustering without being fooled by it
There are ways to misuse this, so a few cautions.
- Defect counts reflect where people looked, not only where bugs are. A module that was never tested will show few defects and look safe. Check whether low counts mean quality or neglect.
- Clusters move. Once the premium calculator is hardened, the next problem may appear in a new integration. Review the data every release, not once.
- Counting defects is a poor way to judge people. If testers are rewarded for bug counts, they will log many trivial ones. Use the counts to steer effort, not to rank anyone.
- Severity matters. Fifty cosmetic defects in the admin panel are not worth more attention than two wrong-premium defects.
The paradox has a limit too. You cannot keep adding tests forever; a suite that grows without pruning becomes slow and fragile. Refreshing means retiring tests that no longer reflect real risk as well as adding new ones. A reasonable habit is to look at each test that has not failed in a long time and ask whether it protects something the business still cares about.
Neither principle tells you what to test. They tell you where your first guess is likely to be wrong: spread too evenly, and frozen too long. In PolicyDesk’s next release the wrong-premium problem did not return, and the team found two smaller rounding bugs in renewals before customers did, which is about the best result this kind of work can promise.
Figures and names in the examples are illustrative.
Leave a Reply