Why Unit Testing is Important in WordPress

In June, I wrote a three part series for Envato called Introduction To WordPress Unit TestingThe series provided an overview of how to configure local environment for tests and how to begin writing basic tests.

Last month, I continued to discuss the topic by giving a case for why unit testing is important in WordPress.

The series consists of three articles:

  • Part 1 covers a high level definition of unit testing, understanding units, the relationship between tests and functions, and the difference in units and suites.
  • Part 2 builds a case for how unit testing can help discover problems early in the project, provide a level of documentation, and drive the project’s architecture.
  • Part 3 ends the series by looking at both the advantages and disadvantages of unit testing, how to incorporate it into an existing project, and provides a list of resources related to unit testing.

Though the articles are geared more towards those building products on top of WordPress, the points are still relevant for why unit testing in WordPress is important for the core application.

If you’re just getting started with unit testing, be sure to check out the other; however, if you’re a developer looking for a way to contribute back to WordPress Core, consider writing a few unit tests – there are plenty of opportunities for just that.