In a few recent projects, I’ve been unit testing WordPress code and doing more general test-driven development than normal. I’m no stranger to TDD, but it’s not something I am religious about using. For me, it depends on the nature of the project.
There’s a lot of writing on TDD and its advantages, and a lot of people who use it swear by it. It builds a level of quality into a project and helps with adding new features, solving bugs, and modularizing code.

Unit testing WordPress code is a bit of a mixed bag, and it comes down to the fact that object-oriented code in WordPress is often tightly coupled to both the business logic and the WordPress API.
Since TDD can help designing the architecture of a project, it can help guide how we can create more testable classes.

