Skip to content

Latest commit

 

History

History

tire-pressure-kata

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Tire Pressure Code Kata

A copy of Emily Bache's tire pressure kata, part of the so-called racing car katas.

The idea is to test whether or not the alarm goes off whenever the tire pressure happens to go beyond the (hard-coded) boundaries.

Possible approaches

There are almost countless ways of approaching this task/kata. Some possibilities are mentioned below.

Option 1: peel strategy

The peel strategy is explained by Emily Bache (www.sammancoaching.org).

Option 2: slice strategy

The slice strategy is explained by Emily Bache (www.sammancoaching.org).

Option 3: ports & adapters

The ports & adapters approach can frequently be used in these kinds of situations.

If we allow ourselves to modify the code, we can create an interface for the tire pressure sensor and have the alarm class depend on that interface instead of the concrete sensor class. The interface can then easily be stubbed.

Option 4: Language-specific approaches

Monkey patching

For dynamic languages, we can use monkey patching.