Workshop Testing Kata Setup
Please make sure that you have a working setup of:
- PHP 5.3 (or newer)
- Run "composer.phar install"
You can find different katas in the
katas/ directory. A good first pick is
String Calculator Kata.
The basic rule is to complete the Katas in a test driven way:
Write a new test – the test should fail.
Write code to fulfil the test case. Do not anticipate future problems just yet.
The test should succeed. Commit.
Feel free to refactor the code or tests while all tests are green. (Commit afterwards..
Repeat from 1) until all requirements are fulfilled
You can optionally follow these additional rules:
As an additional rule to teach you focus you can set yourself a timer (2
minutes for example). If you do not have all green tests after this time revert
all local changes (
git reset --hard). Only if your tests are green again
after the given "baby step" you are allowed to commit.
At maximum one level of indentation per method.
Don’t use else.
Wrap out primitves and strings (unless required by the kata itself).
First class collections. Wrap any collection in a typed collection object.
At maximum one object access operator per line (excluding
No class with more than 50 LOC, no package (namespace) with more than 10 classes.
No class with more than two instance variables (properties).