Test-Driven Development is a must
I applied TDD during the first development half of my master thesis project, I had to drop it out because of the work load I got when I started my study abroad period on the second semester of the year. I know it’s not the way to go, but I had to do it, otherwise I wouldn’t have been able to deliver it on time. Surprisingly, this decision gave me some valuable insights that I want to share.
I really struggled to make my code testable at the beginning, I discovered that the main problem was that I mixed object graph construction with application logic and I didn’t inject the dependencies to the components. As a result I couldn’t test the modules in isolation, since I didn’t have the needed seams. Besides I found a couple of big challenges more, apart the smaller ones, like stop designing upfront letting the design emerge, or stick to the new development cycle. Actually I spent more time reading about how to resolve the problems that arose than coding, it was a hard learning process but it was totally worth it.
Once the “hard work” had been done in the backend, I had to start in the frontend, with AngularJS, a framework I hardly knew, and a way to develop tests completely different. I started to learn about it, but as soon as I realized the process could be too long, and the work load from my university abroad was growing day after day I had to stop and take a decision. Finally, as you know, I decided dropped it out, because I knew if I kept applying it I won’t meet the deadline, I even thought about quitting for the next year, but, actually, I couldn’t wait more to work on the real world, hopefully, a startup.
The next sprint went well, but not the followings. I didn’t have that feedback for refactoring and the code started to be duplicated and coupled, besides I was working against time, the experience was like previous times in the classroom projects, I placed a patch over another to make it to work out. Definetly, I don’t want that my future professional life become in something like that.
I can perfectly understand to the people who refuses to apply TO, the process hits everything they have done so far, and the beginnings aren’t easy at all, actually there’s not such a thing, TDD is a continuous process of learning and improvement. However, IMHO, I still have a lot to learn, the trade off of develop a code you are proud of, and don’t be afraid to change it for adapt to whatever comes, because your code is ready for that, is priceless.
That’s why Test-Driven Development is a must, at least, for me.