Improving software delivery in every organisation

Test Driven Development

Summary

  1. Can demonstrate using the discipline of TDD by doing it.
  2. Can describe a broad range of strategies to achieve an acceptable test-suite performance.
  3. Can describe the family of Test Doubles and can demonstrate how to hand-roll those Test Doubles. Can describe the problems introduced by Test Doubles on Test Design.
  4. Is able to refactor a test to make it follow the 4 components of a single Test and also in relation to a suite of tests.
  5. Can identify smells in test code, and describe why each smell is a problem.
  6. Can demonstrate strategies to achieve Simulation of a “Remote Service”. Can weigh up contextual appropriateness of common tooling (e.g. WebMock, VCR)
  7. Can describe practical scenarios when TDD is not appropriate. Can explain what to look for when discovering new impractical scenarios.
  8. Can demonstrate Triangulation and describe its relationship to TDD discipline.

Sections

  1. Demonstrating the Discipline
  2. Test Suite Performance
  3. Test Doubles
  4. Well-written tests
  5. Well-designed tests
  6. Testing remote services
  7. Inappropriate TDD
  8. Triangulation

Mark Scheme

Giraffe

Giraffe

Assessment

TDD a kata or feature of your choice. Keeping in mind the mark scheme below.

Wolf

Wolf

You will be shown some preprepared test code, and will need to identify the test double used inside it.

You will need to create a test using each of the 5 test doubles, a Dummy, a Stub, a Fake, a True Mock and a Spy.

You will need to TDD a feature which interacts with a remote service of your choice, e.g. a class which retrieves Tweets from twitter.

Dragon

Dragon

Review, refactor and improve an existing test suite.