2.7. Something Different

  • What if we could do something different?

  • Specify & write tests – But not tightly coupled with the APIs.

  • Specify what you want to happen, not how:

    What

    Maps to specification

    How

    Maps to implementation

  • What ever tests we specify now, should be executable, so avoid test implementation stage after test specification review stage.

2.8. Given, When, Then

Generally speaking, all our tests can be specified under these three keywords:

GivenWhenThen

../../_images/given-when-then.jpeg
Given

Some existing pre-condition.

When

Some action happens.

Then

Then there is a re-action / effect.