I started the kata in a Barcelona Clojure Developers event.
The truth is that, since I was learning how to use the Component library, I didn't use TDD.
Instead I worked on the REPL to get everything in place and make it work.
Then I wrote the tests I would have liked to write if I had used outside-in TDD with Midje.
I find that, when I'm learning something new, it works better for me what Brian Marick describes in these tweets:
Now I'll show you the tests I actually wrote afterwards, in the order I would have written them doing outside-in TDD.(6) the immediately-following writing of tests to capture what I've learned counts as Schön-style reflection on just-prior practice.
— Brian Marick (@marick) July 26, 2016
This is the acceptance test I would have started with:
Then I would have written this unit test for Account:
And these are the ones for InMemoryTransactions, ConsoleStatementPrinter and NiceReverseStatementFormat:
You can check the rest of the tests and code in this GitHub repository.
Doing this kata I learned and practiced how to use Component.
I also learned how to use Midje's defrecord-openly and provided macros to mock protocols which helped me correct something I did wrong in another kata.
No comments:
Post a Comment