It’s difficult to overestimate the importance of writing bulletproof tests for the quality of your application. Most developers worth their salt know that but their everyday practice is often limited to only the most popular types such as unit or integration testing. Today, I’m going to show why you should also practice mutation testing and how to go about it in a PHP application.

Without a shadow of a doubt, you definitely need to test. The most popular trio of tests are:

  • unit tests,
  • integration tests,
  • end-to-end tests.

I’m only mentioning this because we will need to take a closer look at unit tests as they’re correlated with the topic of this article. Writing well-defined and implemented unit tests can protect you from making mistakes while implementing features of the application at the same time.

Unit tests (name’s not accidental) are focused on testing small parts of code, in other words – units of code. For example, we can say that the method of a class is a unit and it is a good practice to cover it with suitable tests to avoid mistakes in the development process.

Mutation tests PHP – introduction

OK, now after the quick reminder of what unit tests are, let me introduce another concept related to testing – mutation testing. Why (if at all) you need them to write good quality failproof code for your application?

#php #qa #testing

Mutation testing PHP. How to get more out of QA strategy?
1.40 GEEK