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.

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. LEARN MORE >

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

The "role-feature-reason" template is one of the most commonly recommended aids to write user stories: As a ... I want ... So that ...
A high-level summary of the project's key success factors displayed on one wall of the team room as a flipchart-sized sheet of paper.
Acceptance Test Driven Development (ATDD) involves team members with different perspectives (customer, development, testing) collaborating to write acceptance tests in advance of implementing the corresponding functionality.
Agile teams generally prefer to express estimates in units other than the time-honored "man-hours." Possibly the most widespread unit is "story points."
A Kanban Board is a visual workflow tool consisting of multiple columns. Each column represents a different stage in the workflow process.
Agile teams generally prefer to express estimates in units other than the time-honored "man-hours." Possibly the most widespread unit is "story points."
Agile projects are iterative insofar as they intentionally allow for "repeating" software development activities, and for potentially "revisiting" the same work products (the phrase "planned rework" is sometimes used; refactoring is a good example).

Help us keep the definitions updated

Ready to join Agile Alliance?

Unlock members-only access to online learning sessions, Agile resources, annual conference discounts, and more! And when you join, you’ll be supporting our member initiatives, regional events, and global community groups.

Privacy Preference Center

IMPORTANT: We have transitioned to a new membership platform. If you have not already done so, you will need to SET UP AN ACCOUNT on the new platform to establish your user profile. Your previous login credentials will not work until you do this set up.

When you see the login screen, choose “Set up Account” and follow the prompts to create your new account. You can choose to log in using your social credentials for either Google or Linkedin (recommended), or you can set up your account using an email address.