Testing Types

Learn about the testing tool Karma, the testing framework Jasmine, and the three types of testing: unit, integration, and end-to-end testing.

Before we create and test our features, it’s worth discussing the tools and languages we’ll use to test our code, along with the different types of tests and some basic examples.

Why do we test?

We test to prevent software defects. We write code with the expectation that it will behave a certain way, so we write automated tests to verify this behavior.

In the past, when a small piece of code in the codebase was updated, the developer manually opened their browser to verify that the code still worked. Updates to a specific section of code made by one developer would require another developer to open their browser to run tests of their own to verify that the changes didn’t break any existing functionality.

As codebases grow, manual QA such as this becomes expensive, time-consuming, and error-prone. When a feature is removed, does every developer remember all of its potential side effects? Is each developer manually testing in the same way? Probably not.

We write automated tests to do this for us. Not only does automation remove human error, but it also gives us a reference that states how various parts of our application should behave.

Testing tools

Karma

Get hands-on with 1200+ tech skills courses.