All articles

Why testing software costs money, and how much it saves

Almost every software quote has one line that is hard to defend: testing. It adds no new screen, and the program seems to work the same with it or without it.

That is why it is the first thing to be cut when time is short. Before cutting it, it helps to know what you are paying for and what you lose without it.

What automated tests are

An automated test is a small program that checks another one. It does what a person would do by hand: it creates an order, calculates an invoice, tries to log in with a wrong password. Then it compares the result with the one that should come out.

The difference is that it does this in seconds, every time someone changes the code. A person checks what they have just touched. The tests also check everything that already worked.

What they cost

Tests are not free, and anyone who says otherwise has never maintained them.

  • Writing them. Someone on the team spends hours programming the checks. Those are paid hours that produce no new feature.
  • Running them. Every change runs the whole set of tests on a server. That computing time is paid for.
  • Maintaining them. When the program grows or a business rule changes, the tests that depended on it have to be updated.

It is a fixed cost, paid every week, whether anything fails or not. That is why it is unpopular.

What you get in return

You get certain guarantees that the software works. Not all of them. No serious team promises a program without failures, with tests or without them.

What changes is who finds the failure, and when. With tests, many of the errors show up on the programmer’s screen, minutes after they are made, when fixing them costs little.

Without tests, a client finds them, or your accounts team at the end of the month. By then the failure has had consequences: orders that never came in, invoices calculated wrongly, payments that were not taken.

The sums of automated testing: what you pay is writing and maintaining the tests, what you get is seeing the failure before the client does, and what you avoid is lost sales and days of repairs. WHAT YOU PAYWriting and maintaining the tests WHAT YOU GETSeeing the failure before the client WHAT YOU AVOIDLost sales and days of repairs
The cost of testing is paid every week. The cost of a failure is paid all at once.

Two failures that made the news

In late July 2012, the trading firm Knight Capital released new code in its order system. On 1 August, in the first 45 minutes of trading, the system sent more than 4 million orders into the market when it only had 212 customer orders to fill. The firm lost more than 460 million dollars.

The US regulator found that Knight had left an old function in the system that was no longer used, that the new code was deployed incorrectly, and that the firm did not have adequate controls and procedures for deploying and testing that code. It is in the SEC’s statement on the case.

On 19 July 2024, an update from the security company CrowdStrike crashed Windows computers around the world. Microsoft estimated that 8.5 million devices were affected.

In its preliminary report, CrowdStrike explained that a bug in its own validator let a faulty update through. The measures it announced include more types of testing and releasing updates in stages, not to every customer at once.

These are extreme cases, and your company is not a trading firm. But the mechanism is the same in an invoicing program or an online shop: a change nobody checked reaches production, and the client is the one who finds it.

How to do the sum

Both sides of the scale can be turned into euros.

An example with round numbers, only to show the sum. One person on the team spends 4 hours a week writing and maintaining tests. With 46 working weeks a year and a cost of 40 euros an hour, that is 7,360 euros a year.

On the other side, a failure in the ordering part that reaches clients. The shop sells 2,500 euros a day and spends 2 days unable to take payments: 5,000 euros in sales. Finding the error, fixing it and redoing by hand what went wrong takes 5 days of work: another 1,600 euros. In total, 6,600 euros.

With those numbers, two failures like that in a year cost 13,200 euros, about 5,800 euros more than the tests. And the sum leaves out what is hard to measure, such as the client who does not come back.

Your figures will be different. The sum is the same: hours of testing a year times the cost of an hour, against what a day of failure costs you times the days it lasts, plus the work of fixing it.

Sometimes the sum comes out the other way. A small program that changes little, and whose failure is only a nuisance, may not justify many tests. Saying so is part of the job too.

Where to start

You do not need to test everything. You need to test first what costs the most when it fails.

  • Start with the money. Payments, invoices, orders, payroll. If that fails, the cost is immediate.
  • Add tests before changing a delicate part. That way you know what you have broken at once, not weeks later.
  • Make them run by themselves. Tests that someone has to remember to run end up not being run.
  • Turn every failure into a test. If an error reached a client, the test that would have caught it is written that same day, so that it does not happen again.

Tests are also one of the ways to avoid piling up technical debt: they let the team change the code with confidence.

Testing software costs money every week. Not testing it costs money on the day it suits you least. The reasonable choice is to put the tests where a failure costs you more than they do.