Kata #4: Make your own plan

Objective: You've been practising TDD with a given plan. In this kata, you are to devise your own plan.

You are to TDD a SingleLinkedList from scratch. It should provide the following functions:

  • Create an emply list.
  • Create a list from an array of Objects
  • list.size()
  • list.insertAfter(Node n, Object o)
  • list.delete(Node n)
  • list.first() returns the first node
  • list.last() returns the last node
  • list.before(Node n) returns the node right before n
  • list.after(Node n)
  • list.find(Object o) returns a node that holds o, if there is one.
  • list.append(Object data) adds a new node that holds data to the end of the list.
  • list.insertFirst(Object data) adds a new node to the beginning of the list.

    Explore a different plan, i.e. an order of features to implement, each time you restart the kata. Try to figure out your own strategy to pick the next feature.