The concept of automated unit testing predates the web; the xUnit family of frameworks (JUnit 1997, PHPUnit 2004, pytest 2010, Jest 2014) made it the default practice of professional software engineering.
Kent Beck wrote the first xUnit framework (SUnit, for Smalltalk) in 1989 and, with Erich Gamma, ported it to Java as JUnit in 1997 during a flight to Zurich. The pattern spread through the XP and agile communities in the 2000s, and by the 2010s it was a baseline expectation of any professional codebase. The test pyramid — the distribution of test types across a suite — was formalised in the same period (see test-pyramid).
1989 — Beck's SUnit for Smalltalk
1997 — JUnit released, brings unit testing to Java
2003 — Feathers' legacy-code framework defines "unit" by isolation
2009 — Cohn's Succeeding with Agile formalises the test pyramid
2015 — Google's 70/20/10 split published (Wacker)
2025 — GitLab publishes 218k unit tests at 75.66% of the total suite
Code without tests is bad code. It doesn't matter how well written it is; it doesn't matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behaviour of our code quickly and verifiably. Without them, we really don't know if our code is getting better or worse.
— Michael Feathers, *Working Effectively with Legacy Code*, 2004