(In SoftwareEngineering) 행동중심개발. TestDrivenDevelopment의 변형.
http://blog.daveastels.com/?p=53 :링크가 바뀐 듯~ -yy
10분 정도 살펴본 후 드는 생각:
- 대체적으로 훌륭하다.
TestDrivenDevelopment의 Test는 Blackbox 혹은 Whitebox가 아니라 Graybox 테스트라는 말이 있다. 하지만 BehaviorDrivenDevelopment의 Behavior는 PsychologicalBehaviorism - Blackbox - 을 연상시킨다.
MockObject framework의 사용을 장려하는 점.
Template:
<Story>:
<Story Title>
<Narrative>
As a <Role>
I want <Feature>
So that <Benefit>
<Acceptance Criteria> - Set of <Scenario>s
<Scenario Title>
Given <Given>, and <Given>, ..., and <Given>
When <Event>
Then <Outcome>, and <Outcome>, ..., and <Outcome>
Example:
- Title: Customer withdraws cash
- Narrative
- As a customer
- I want to withdraw cash from an ATM,
- So that I don't have to wait in line at the bank.
- Acceptance Criteria
- Scenario 1: 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(그냥 한번...):
with(JSSpec.DSL) {
Epic('Account management')
Given('The account', 'The credit card')
Story('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')
Scenario('Account is in credit')
Given('The card is valid', 'The dispenser contains cash')
When(function() {
// event
})
Then(function() {
// expected outcome
})
Scenario('Account is in credit')
Given('The card is valid', 'The dispenser contains cash')
When(function() {
// event
})
Then(function() {
// expected outcome
})
Story('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')
Scenario('Account is in credit')
Given('The card is valid', 'The dispenser contains cash')
When(function() {
// event
})
Then(function() {
// expected outcome
})
Scenario('Account is in credit')
Given('The card is valid', 'The dispenser contains cash')
When(function() {
// event
})
Then(function() {
// expected outcome
})
}
Implementations:
GSpec for GroovyLanguage
JBehave for JavaLangauge (developed by ThoughtWorks)
JDave for JavaLanguage
JSSpec for JavaScript