Test- Driven Development

Build better quality software, faster.

Why?

We know from decades of experience that Test-Driven Development (TDD) will help you developer better quality code, faster.

If your teams are suffering from any of these problems, TDD will help:

  • Regressions found in production after launch
  • Delayed releases due to last minute defects
  • Gradually slowing velocity
  • Growing areas of the code considered 'no-mans-land' - too dangerous to touch or change

What?

Test-Driven Development (TDD) is an incremental and iterative approach to developing software that follows a simple 3-step cycle:

  1. Write a failing test (RED)
  2. Make it pass (GREEN)
  3. Refactor

This simple practice has a huge impact on the kinds of issues listed above. The means by which this happen are numerous, but include:

  • Catching regressions as soon as they are introduced means less time spent resolving them:
    • The knowledge of how to resolve it is fresh, and the cause is obvious - it must be the code introduced in the last few minutes. (Compare with the experience of discovering the defect weeks later in manual testing).
  • Small increments reduce the cognitive load in each cycle, reducing risk of introducing defects
  • You are discouraged from adding code/features that aren't needed yet
    • These are a common cause of the most tragic defects - releases held up due to bugs caused by functionality added 'just in case', that nobody really needs yet!
  • Frequent refactoring makes future changes easier
    • The cost of refactoring rises exponentially as the code accumulates cruft. Frequently clearing out the cruft, which is enabled by the high test coverages, keeps that cost low.
  • Valuable practices like continuous delivery are enabled because the code is always in a releasable state

This course takes an experiential training approach - there is a limited amount of slides/theory, most of the time is either spent watching live demos or doing active practical work in teams.

How?

Module 1 - Getting Started

Running tests, TDD cycle intro, pairing & ensembling, assertion styles

Module 2 - Dependencies

Implicit Dependencies, Explicit Dependencies (Mocking)

Module 3 - Outside-in TDD

Behaviour Driven Tests
Layering & Temporary Tests
Refactoring & Code Smells

Module 4 - Inside-out TDD

Domain-Driven Tests
State Management, Test Object Factories

Module 5 - Existing Code

TDD with Untested Code, Snapshot & Approval Tests

Module 6 - On the Job

Working together on the team’s real code

Schedule Options

Weekly 3 Hours

6 weeks
1 x 3hr session per week

Weekly 1.5 Hours

12 weeks
1 x 1.5hr session per week

Intensive

3 days
2 x 3hr sessions per day

Notes
  • Schedule can be tailored to suit team availability
  • If multiple teams are on the course, each session includes a mix of all together for the theory, and separate teams for exercises
  • Module 6 scheduled separately with each team