Sitemap

Unit Testing

2 min readFeb 1, 2023

Simple Defintion:

Unit testing is a way to test small parts of a computer program to make sure they work properly. Think of it like checking that each piece of a puzzle fits together before putting the whole puzzle together. This way, if something is not working right, it’s easier to find and fix the problem.

A unit is the smallest part of a computer program, like a tiny building block. Unit testing makes sure that each tiny building block works well on its own so that when they are put together, the whole program will work well.

Text Book Definition:

Unit testing is a method of testing individual units or components of a software application. It is typically done by developers and is used to ensure that the individual units of the software are working as intended. Unit tests are usually automated and are designed to test specific parts of the code, such as a particular function or method. Unit testing is done at the lowest level of the software development process, where individual units of code are tested in isolation.

Get Venkata Yedida’s stories in your inbox

Join Medium for free to get updates from this writer.

Advanteages:

  1. It helps to identify bugs early in the development process, before they become more difficult and expensive to fix.
  2. It helps to ensure that changes to the code do not introduce new bugs.
  3. It makes the code more modular and easier to understand and maintain.
  4. It helps to improve the overall quality and reliability of the software.

3 Phases in Unit Testing

  1. Initailizing the small piece of an app that needs to tested (System Under Test)
  2. Then apply stimulus/trigger to the system under test
  3. finally , observe the result by asserting