Ready-to-use TDD templates for Code Katas/ Coding Dojos
Kata (programming), Wikipedia:
A code kata is an exercise in programming which helps a programmer hone their skills through practice and repetition.
The problem. Before you can start working on a kata, you have to prepare a development environment for the programming language and test framework you want to use. Ideally this environment includes a build automation tool that simplifies compiling and running your tests and application.
The solution. These templates provide you with such environments. Use them and focus on the coding: all necessary files exist and common build automation tools make it easy to compile and run your tests and application.
The current focus lies on unit tests but integration tests might follow in the future.
Getting started with unit testing/ test-driven development (TDD)
Choose a template and start coding. The README files will explain everything you need to know to get started.
Playing around with unit tests/ working on a code kata
Just select a programming language along with a unit testing framework and start by adding your tests. It is a repeatable way for quickly getting started with a deliberate practice session.
- Start coding right away. Everything is in place; no further setup is needed.
- Build targets make it easy to compile and run your tests or application.
- Minimal dependencies. No
autotools
, no advanced build systems. - Distributable application binaries do not include any built-in tests.
- Clone this repo:
$ https://github.com/makomi/tdd_templates.git
- Enter the template's folder:
$ cd tdd_templates/C_CppUTest
- Checkout a new branch:
$ git checkout -b dojo_yyyy-mm-dd
- Have a look at the template's README. It explains how to perform a typical TDD cycle with the template, c.p. C_CppUTest.
- Write code by following the 3 step TDD cycle: red, green, refactor
- Commit your results for each step, e.g.
$ git commit -am "Add test for 'loneliness'"
Last but not least: Have fun :)
You can switch to the TDD examples repository to see these templates in action with actual application and test code.
Have a look at Dave Thomas' website if you want to learn more about the concept of code katas or are looking for some katas to work on.
This collection still lacks many common programming languages and unit testing frameworks. For additional ideas on how to contribute, have a look at the open issues. Furthermore, if you have a neat idea for a new feature or some other improvement, I am looking forward to recieving a pull request from you:
- Fork this repo
- Create your feature branch:
$ git checkout -b my_new_feature
- Commit all your changes:
$ git commit -am 'Add some feature'
- Push to your feature branch:
$ git push origin my_new_feature
- Submit a pull request
Please follow the contribution guidelines prior to making a pull request.
MIT
See LICENSE for details.
You can get the newest version from the project's website.