18 Jun 2019

Developing Together - Classification Kata

Lets write some code together - intro to pairing and TDD

Had a really interesting chat with Emma and Shane from Digital Gurus. The outcome was a both being excited about running a kata together.

The goal is to bring people (whom may not consider themselves to be code warriors) and programmers (who should know better than to think of themselves as code warriors) together, work together and learn something new whilst having a ton of fun.

This will likely turn out to be a bunch of developers hopefully with diverse skill levels.

This problem is not intended to be hard. It is merely intended to have enough complexity that you have some options in how to approach it. If you have no idea how to approach it I have suggested a set of steps you could take below.

Learning Objective

Development is all about communication, working together and figuring out how to move forward releasing value as early as possible to get feedback. As such several things will be done to enable this.

  1. Slicing the problem. Ask what options do we have in delivering the solution? Is delivering a smaller part of the problem going to get us some useful feedback or help customer evaluate assumptions?
  2. Find someone you have never worked with before and come up with something together.
  3. If you are in an experienced pair, then introduce some constraints on yourselves. Eg 2 minute timer - if no commit under green then revert, Object Calisthenics, only refactor according to Connascence, only use your ide shortcuts to refactor.

The Kata

Lets build a simple classification engine!

The Problem

Koala Co has discovered that the height of eucalyptus trees has a strong signal in terms of correlation of the chances of reproductive success in their shrinking Koala Community.

The problem they have is that it is costly to send people out to measure the heights of trees. It is however possible using the latest trained neural nets of HeightCo to find the heights of trees as a drone flies over.

The problem is that we only care about the chance to producing a Male or Female koala. What Koala Co needs is some signal analysis to figure out what trees are of interest - also if possible what sex of koala will be produced.

The Solution

Another team is constructing a sensor that will return a stream of data corresponding to the height of the trees.

Our job is to write the logic that will live in the consumer of this stream. The consumer needs to replace values with data that will instruct downstream systems what to do with the data. This piece of logic will be called and an string passed into it.

We need to leave any unaffected data in place so that the subscribers can be chained together and act as handler sinks.

All we want to produce is a class with some tests that demonstrate that it does what you think it does - and also hopefully what the customer wants.

Example Input and Output
Input Output
1 1
2 2
3 Male
connifer connifer
4 4
5 Female
6 Male
7 7
8 8
9 Male
10 Female
11 11
fungus fungus
12 Male
13 13
14 14
15 MaleFemale
16 16
17 17
18 Male
19 19
20 Female

Go Deliver

You have about an hour. Have fun - TDD this. Commit and release value as often as possible.

Finished?

Ok come talk to me for more steps - there are lots of ways we can extend this.

Ask the Customer (IE me)

If you have a question then show me your last commit and ask the question (We will simulate a deployment)