BDD
http://dannorth.net/introducing-bdd/
テスト結果がこういう感じになる
code:txt
CustomerLookup
- finds customer by id
- fails for duplicate customers
- ...
テスト名の表現力が豊かなので、使用が変わったのかわかりやすいとしている
TDDでも普通にやっていそうだけれどkadoyau.icon
XとしてYがほしいのでZするのようなストーリーを定義して、そこからシナリオを書き、シナリオに対してテストする
code:story
Title: Customer withdraws cash**
As a customer,
I want to withdraw cash from an ATM,
so that I don't have to wait in line at the bank.
code:senario
Scenario: Account is in credit
Given the account is in credit
And the card is valid
And the dispenser contains cash
When the customer requests cash
Then ensure the account is debited
And ensure cash is dispensed
And ensure the card is returned
code:シナリオの読み方
Given some initial context (the givens),
When an event occurs,
Then ensure some outcomes.