How to Start Unit Testing WordPress Plugins
I really appreciated this article from Carl Alexander about getting better at developing WordPress plugins. When most people (myself included) first hear about unit tests, you want to go set all old code on fire. But you can’t do that, so Carl offers some practical advice about how to incorporate testing practices into places where you’ve not historically been doing it. For most of us in WordPress, that’s everywhere.
Here’s a clip:
Start by unit testing bugs
One way is to create unit tests for every bug that you fix. This is a common recommendation by a lot of developers that promote unit testing. They see it as a great way to get into unit testing for two reasons.