A polyglot scaffolding for your TDD Katas

Feel free to clone a repo which has a scaffolding for Test Driven Development coding for Scala, Java, Javascript/NodeJS ES6, python3

git clone https://github.com/GA1/algo-tdd-starters

The project is divided into 4 directories. Each directory contains three dummy classes and corresponding unit tests. Also in each directory you will find a README.md with instructions on how to run the unit tests from the terminal.

Alternatively, you can have a look at this video in which I use the same repo for explaining what Test Driven Development is.

That’s it. Keep reading if you’d like to understand why this repo was created.

From time to time a software engineer has to code something quick from scratch, an algorithm, a simple hello_world-like server, a prototype, a regular expression, a TDD kata.

  • When I am to code a TDD Kata exercise, I prefer using es6 + Jest, thanks to Jest’s UX and speed.
  • When I am to code a graph algorithm I keep prefering using Java + unit tests. (influenced by this great coursera course)
  • When I am to code a quick http scrapper I prefer to do it with Python.
  • And lastly but not least, when I am to play with collections I keep doing it with Scala.

You might say something like:

Really? Do you encounter such small/isolated problems?
by Giphy

Yes, I do! I can give you a couple of examples I have stumbled upon:

  • I took part in the recent Google code Jam (chose python).
  • I applied once for a job in a company. They sent me a Codility graph problem, which I was encouraged to code outside the web browsers, in an IDE of my choosing (chose Java).
  • Another company required me to code a solution in as TDD way as possible (chose js ES6).

I know other coders stumble upon similar problems from time to time. They lose precious seconds of their coding stamina when setting up environments. Hopefully this project will prevent it.

Even if none of these languages is of any practical use to you. I can give you another use case:

Let’s say you are a TDD advocate in an organization where a bunch of programming languages is used. You’d like to organize a kata for your workmates, and make it accessible for coders of as many languages as possible. There might be people who would like to participate, but eventually do not. Their excuse? Necessity of setting up everything before coming to the meeting.

Which one sounds more intimidating for a Javascript developer who never writes tests but who would actually like to try TDD?:

  • We organize TDD workshops. Come to us with your computer. All you need is git . We will provide you with ready environments for any of the languages: Java, Javascript, Python, Scala
  • We organize a TDD workshop. Come to us with your computer. You have to have a project structure ready for running unit tests seamlessly.

Let’s care about our users (in this case people who are considering participating in the workshop) and keep it simple.

PRs are more than welcome

Would you like to add more languages into the repo or to improve what is there? Let me know!