My Approach to TDD
I’ve been applying TDD (Test Driven Development) religiously for the past 5 years and now cannot imagine where I would even start from, in any code if it’s not from a test. The advantages TDD brought along with it are numerous and in my case, vital, for working on projects of a certain calibre. Even though the complexity of any code is now irrelevant to me when it comes to TDD as I always apply it. In a form or another, every code I write follows a test I’ve written.
This post is not a tutorial of either Unit Testing nor PhpUnit. The main purpose is to help you adjust your mindset in a way that facilitates TDD. I will do this by highlighting the issues I experienced myself when thinking tests firsts and then I will continue on this series of posts -Developing a Command Bus in PHP with developing some initial features using the TDD approach, to hopefully walk you through how the mindset evolves for TDD to become a natural and obvious way to drive code development.