Use Data Structures and Algorithms Problems as TDD Katas!

| Comments

I was doing some code katas last week and it suddenly dawned up on me how awesome data structures and algorithms problems are to practice TDD. They provide such a well defined problem space and expected API that you can fully concentrate in the red-green-refactor flow until it becomes second nature. One pass and you focus on the red-green-refactor, another pass and you can improve your knowledge of jasmine, another and you focus on sinon, another and you try to improve your abstractions, another and you concentrate on writing the most readable of tests, and so on until eternity :)

I have created a new repository to harbor my algorithms and data structures TDD katas in JavaScript that you are welcome to use if you like. There’s only some simple linked lists exercises right now with a basic ES6 setup but I expect it to grow over time.

Not interested in practicing TDD? Don’t panic! You can use any of these exercises to practice other stuff, becoming more proficient and productive using your favorite IDE or text editor, learn new ReSharper shortcuts, new vim commands, functional programming, other languages, etc. Just decide what you want to practice in each session and be awesome.

And here are some other places where you can find lots of different exercises and katas: