Agile Glossary

Unit Testing

What is Unit Testing?

A unit test, as Agile teams understand the term, is a short program fragment written and maintained by the developers on the product team, which exercises some narrow part of the product’s source code and checks the results. The outcome of a unit test is binary: either “pass” if the program’s behavior is consistent with the recorded expectations, or “fail” otherwise. Developers will typically write a large number of unit tests (corresponding to a large number of program behaviors of interest), called a “test suite”. By common convention dating back at least to the JUnit family of tools, the color red (as in “getting a red bar”) represents the failure of one or more tests. The color green (“a green bar”) denotes the successful execution of “all” unit tests associated with a program.

Also Known As

The term Unit Testing has a different meaning in the industry, denoting an activity or phase in the classical Software Development Life Cycle, which distinguishes it from (for instance) System Testing. These terms do not necessarily imply anything about automation. To avoid creating confusion, some Agile authors have therefore advocated using the term “developer testing”, distinguishing it from “customer testing” and emphasizing the roles responsible for various types of testing.

Common Pitfalls

The shifts in terminology noted above have been the source of much confusion, and debate continues over what “testing” means in Agile teams. Agile has led to a strong emphasis, among developers, on the use of automated checking procedures, and this has tended to marginalize other forms of testing, in particular, that done by professional testers. Yet this work (which some Agile teams call “exploratory” testing) is no less important in an Agile context. Also keep in mind the distinction between the practice of automated unit testing, used by developers to check their own code, and the more structured and more constraining practice of test-driven development.

Expected Benefits

  • a team relying on automated unit tests can expect to reap some of the benefits of test-driven development, in particular, a decrease in defect rates

Origins

  • 1976: a series of articles by D. Panzl describing tools with features closely resembling those of JUnit attest to the long history of automated unit testing
  • 1988-1990: the rise of event-driven GUI software and their specific testing challenges create an opportunity for “capture and replay” test automation tools provided by companies such as Segue or Mercury; this type of tool dominates the market for the next decade
  • 1997: the testing tool JUnit is written by Beck and Gamma, inspired by Beck’s earlier work on SUnit; its growing popularity over the next few years marks the end of the “capture and replay” era.
Add to Bookmarks Remove Bookmark
Add to Bookmarks Remove from Bookmarks
Add to Bookmarks Remove from Bookmarks

Thank you to our Annual Partners​

Join us today!

Agile Alliance offers many online and in-person events and workshops for our members. If you’re not currently a member, you can join now to take advantage of our many members-only resources and programs.

Get the latest Agile news!

  • This field is for validation purposes and should be left unchanged.

By subscribing, you acknowledge the Agile Alliance Privacy Policy, and agree to receive our emails.

Additional Agile Glossary Terms

An acceptance test is a formal description of the behavior of a software product, generally expressed as an example or a usage scenario. A number of different notations and approaches have been proposed for such examples or scenarios.
Test-driven development (TDD) is a style of programming where coding, testing, and design are tightly interwoven. Benefits include reduction in defect rates.
The team meets regularly to reflect on the most significant events that occurred since the previous such meeting, and identify opportunities for improvement.
A product backlog is a list of the new features, changes to existing features, bug fixes, infrastructure changes or other activities that a team may deliver in order to achieve a specific outcome.
An acceptance test is a formal description of the behavior of a software product, generally expressed as an example or a usage scenario. A number of different notations and approaches have been proposed for such examples or scenarios.
Test-driven development (TDD) is a style of programming where coding, testing, and design are tightly interwoven. Benefits include reduction in defect rates.
The team meets regularly to reflect on the most significant events that occurred since the previous such meeting, and identify opportunities for improvement.

Help us keep the definitions updated

Discover the many benefits of membership

Your membership enables Agile Alliance to offer a wealth of first-rate resources, present renowned international events, support global community groups, and more — all geared toward helping Agile practitioners reach their full potential and deliver innovative, Agile solutions.

Privacy Preference Center

Not yet a member? Sign up now