Awesome
Extract Till You Drop
Code for my refactoring talk "Extract Till You Drop". See the screencast at http://verraes.net/2013/09/extract-till-you-drop/ (Note that this version of the code has changed since that recording was made.)
Kata
You can do this as a kata. The goal is to cover GroupService with tests, and refactor it into something much nicer along the way.
Rules:
- Don't change the behaviour of the code, unless you have a failing test that proves a bug
- Don't refactor unless the code is covered sufficiently by tests, or when you can use a guaranteed safe refactor (eg the ones that come with PHPStorm).
- Try to express insights about the code in the code
- After 30m or so, compare with other teams, and try again.
Install
Get composer, then run
composer install
bin/phpunit
You should get a warning because there are no tests yet.