Quick Code Kata Restrospective

I’ve been doing Coding Katas three to five days a week for the last several weeks. I mentioned this to a friend, and he asked to join me. We did the reversi Kara, and learned some good stuff.  We learned to start with empty test cases and progress slowly from there.  We discovered we had to trust ourselves to pick which test cases to write, rather than doing complete comprehensive tests.  Finally, we wrote down lessons learned, which let us contemplate the process later.

The first thing we learned was to start with null/empty test cases. We learned this by not following this rule. We started with the starting board position, then we added pieces. Going with The Simplest Thing that Could Possibly work, we ended up with a complex if-then, comparing the input to a const string and returning a construction string. It quickly got unwieldy, and when we went to refractor, we realized that to evolve the design we had to start simpler. We added an empty board test. Then a board with one piece. The next test was two pieces and one legal move. After we fixed that, we saw that our design wasn’t working for us. The simpler tests lead us to a more simple design. Time ran out during the refactoring. If we had started with the simple test cases, we would have been pointed to the simple solution from the start.

We had a discussion about which tests to write, and decided we should trust ourselves. We had it working for our several test cases, then we wanted to add a test we knew would pass. The idea was that it would give us a more comprehensive set of tests, and double check in case we were wrong. But it was extra work, not explicitly required, and writing all those tests would lead to test bloat. We decided the best approach would be to trust ourselves that we knew enough about the code to know which tests were really necessary. That would give us solid unit tests; QA could do the comprehensive tests.

Finally, we learned that we should keep a piece of paper to record lessons learned. That helped focus our learning and allowed me to write this post.  Future sessions we’ll keep the lessons learned paper, and, hopefully, you’ll see more Kata retrospectives.


Tags: , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: