What Are Tests?

Get introduced to the different kinds of tests, their various purposes, and their code coverage.

Overview

Software testing is a fundamental part of software development. Its primary purpose is to check whether our software is behaving in the way we expect it to. Below are some of the reasons we should write tests in our program:

  • Detect bugs: We write tests to detect defects, bugs, regressions, and more.

  • Customer satisfaction: If we fix bugs before releasing the project to the customer, they’ll be more satisfied with our work.

  • Documentation: Tests offer a different way of documenting the usage of our code.

  • Efficiency: We improve our efficiency as we get feedback in the early stage of development. Thus, we can pay extra attention to the most delicate features.

  • Improve knowledge: By writing tests, we also improve our general knowledge of the programming language.

  • Security: We can deliver a more secure program that is well tested against vulnerabilities.

  • Money: Bugs cost money, so the more bugs we fix, the more money will be saved.

History of tests

First, let’s clarify two terms that we will often see when dealing with tests: production code and test ...