Introduction to Testing

Testing your code can save hours in a team environment. Let's learn about what software testing is in this lesson.

We'll cover the following

Introduction to testing

Software is usually tested on various factors, such as speed, usability, and functionality, before it is rolled out to the public. Tests can be done on various levels of software, from the lowest level to the highest. The various levels of testing are:

  1. Unit testing
  2. Integration testing
  3. System testing
  4. Acceptance testing

The unit that is tested grows ‘bigger’ with each level. So, lower levels would involve testing parts of the code, whereas higher levels involve testing the software as a whole unit.

Why test your code?

There are several reasons for testing software:

  • To keep deployments smooth. If you’re working in a team, for example, and the code breaks when merged before deployment, tests can be used to find out exactly what caused the break. This can save many hours of debugging, thus preventing panic when trying to meet a deadline.
  • To ensure that all software requirements are being met. Through thorough testing, you can make sure that all possible cases based on the requirements work.
  • To write higher-quality code. If your code has to pass tests before you can submit it, the process of testing and re-writing code will result in higher-quality code.
  • To reduce ambiguity. If you know your code has to pass certain tests that require certain parameters, you’ll write your code to fit the tests.
  • For documentation. All of the tests together can tell a lot about the code in much fewer lines than the code itself.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.