terug naar overzicht

07/01/22

Insight insight

Applicatieontwikkeling

Daan Stolp

+31 35 539 09 09


07/01/22

Getting started with TDD

Learning Test-Driven Development (TDD) isn’t very difficult. There are only a few rules you need to follow when doing TDD. And you can find plenty of resources that teach you the basics. But it is often a big leap from learning the basic TDD exercises to applying it in your day job on real-life production software. I know it certainly was for me! So, what can you do to make that leap easier? Let’s look at a number of strategies.

Accept that learning takes time

Learning TDD is just like learning how to drive a car: you don’t u003cemu003ereallyu003c/emu003e learn how to drive until u003cemu003eafteru003c/emu003e you have gotten your drivers license. Similarly, you only u003cemu003ereallyu003c/emu003e learn TDD after having learnt the basics and after you have accumulated some experience applying it in real-world code bases.rnrnThe best way to accelerate that process? Practice! Practice the exercises, both classicist style and outside-in style. Repeat the code kata. Practice testing and refactoring legacy code. Practice applying it in your day job, even if that initially takes some extra time. Eventually, you’ll pick up more and more tricks along the way and you will notice that the practice starts to pay off: you write code faster, easier, and with less defects, and you’ll hardly ever need to use the debugger anymore.rnrnI hope one of these tips resonates with you. Let me know in the comments. Now go and practice your kata!

Delen