Stop complaining, do it now.

I’ve been working with software development for 4 years now with different groups and different companies. But nothing has changed as much as TDD did with my style of programming, thinking and solving problems.

Fear, comfort zone

Since I decided to learn TDD and apply it to my work I had a lot of questions. Does TDD work? Why should I spend my time writing tests first?

Though those are questions often asked by those who are starting with TDD but we can’t stop on the first rock, we must keep going. Instead what I’ve seen in many developers are the same excuses to not apply TDD or even worse to not stop and learn an amazing subject that will improve their productivity, will improve their code. “Look I’m out of my deadline and I can’t spend my time on tests”, “I’ll apply TDD after I finish my project”.

TDD certainly is a change of paradigm. Especially for PHP developers who are often dealing with structured, these developers will be forced to use OOP instead. Unfortunately, humans are creatures of habit and I can’t do anything to change you either your friends or your parents. Just you can make the difference and make you a better professional.

It is not bad at all

The biggest issue I’ve crossed is to talk with developers who are not in the TDD world and when I face this situation I expose some advantages when using TDD.

OOP

This is often an issue for developers who are not familiar with abstraction, design patterns and the quality of code. Those developers often do their code with many responsibilities and often is impossible to test without refactoring.

The first step to applying TDD is to learn and understand OOP and its benefits. (I saw projects without any abstract class or interface, are they using OOP?)

SOLID

Is directly related to TDD and SOLID follows TDD in all of its stages

Design Patterns

Usually are testable and therefore are not easy to understand but once applied the maintenance is easy and the developers have a huge of information about Design Patterns on the internet.

Understand first, Apply after

TDD is changing the way we developers do our jobs for a better way, it gives us tremendous confidence in our code. Unfortunately, it does not come in the blink of an eye it takes time and dedication, researching and making mistakes.

Please don’t try to apply TDD in your project at the company at first, do it when you feel comfortable at home or any place that you like to start a blank project and try to build something simple such as a calculator or a classic app to do.

Do you have any suggestions or questions? Please let me know in the commentary section below this post I’d like to hear from you!