Unit Testing

What is a Unit Test?

  • Is a level of software testing where individual units/components of software are tested.
  • A unit is the smallest testable part of any software.
  • It usually has one (or possibly a few) inputs and a single output.

Function of Unit Tests:

  • The purpose is to validate that each unit of the software performs as designed.
  • Unit testing should increase confidence in changing and maintaining code.
  • Makes code more reusable since this testing validates small chunks of code are functioning as expected.
  • The more code that is written without being tested, the more paths the developer has to check for errors.

Test Results:

  • The result of this test are used to decide if a unit is stable enough to proceed with further testing and integration. If it fails, halt and fix bugs.

Unit/Component Example:

5 buttons on a page. Each button is considered a unit or component.

Reference(s):


Index of Testing Types: https://ultra.guide/bin/view/Testing/DifferentTypesSoftwareTestingIndex
Topic revision: r3 - 28 Apr 2020, KellyEverlyHall
© 2020 Ultranauts - 75 Broad Street, 2nd Floor, Suite 206, New York, NY 10004 - info@ultranauts.co