Lably
Skip to content

Unit testing

Validating the behavior of isolated source code

  • 16 min read
  • 14 chapters

Related on Lably

Through Java (programming language), Google and Object-oriented programming

Unit testing describes tests that are run at the unit-level to contrast testing at the integration or system level.

History

Unit testing, as a principle for testing separately smaller parts of large software systems, dates back to the early days of software engineering. In June 1956 at US Navy's Symposium on Advanced Programming Methods for Digital Computers, H.D. Benington presented the SAGE project. It featured a specification-based approach where the coding phase was followed by "parameter testing" to validate component subprograms against their specification, followed then by an "assembly testing" for parts put together.

In 1964, a similar approach is described for the software of the Mercury project, where individual units developed by different programmers underwent "unit tests" before being integrated together. In 1969, testing methodologies appear more structured, with unit tests, component tests and integration tests collectively validating individual parts written separately and their progressive assembly into larger blocks. Some public standards adopted in the late 1960s, such as MIL-STD-483 and MIL-STD-490, contributed further to a wide acceptance of unit testing in large projects.

Unit testing was in those times interactive or automated, using either coded tests or capture and replay testing tools. In 1989, Kent Beck described a testing framework for Smalltalk (later called SUnit) in "Simple Smalltalk Testing: With Patterns". In 1997, Kent Beck and Erich Gamma developed and released JUnit, a unit test framework that became popular with Java developers. Google embraced automated testing around 2005–2006.

Sign in to keep reading

13 more chapters are free with a Lably account.

More in Computing and communication