2. BDD
Domain Driven Design - DDD
● Common understanding
● Common language
● Test Driven Development - TDD
● Good technical practices
● Small steps
● Combined → Behaviour Driven Development
3. Test automation
Test Driven Development, TDD – Develop it the
right way
Behaviour Driven Development, BDD –
Develop the right thing
4. Three core principles
• Business and Technology should refer to the same system in
the same way
• Any system should have an identified, verifiable value
• Up-front analysis, design and planning all have a diminishing
return
6. Verifiable value
• Protect revenue
• Increase revenue
• Manage cost
• Increase brand value
• Make the product remarkable
• Provide more value to your customer
7. Big design up-front
• No big design up-front
• The further you plan ahead, the less accurate you will be
8. Three questions
• What is the most important thing the system should do?
• What is the next most important thing the system doesn't do
yet?
• If we were to switch off the system, where and what would be
the biggest impact?
11. Interpret and translate
We need to read the spec.
Understand it
Translate it into code
Parse and execute it?
No, not all specs are created equal
16. Why Cucumber
It is one of the least technical tools
It is a very active open source project
It supports a variety of languages
17. A concrete example
Feature: Life of IT guys
In order to get good salary
As a it guy
I want to keep my boss happy
Scenario: I am a tester
Given I am a bad tester
When I go to work
Then I mess with it
And my boss fires me
But the developer likes me
19. Parse and execute
● A parser is developed
● Add native code to implement the steps
Setup – Given
Execute – When
Assert - Then
20. Write a step definition in Java
@Given("^I am a bad tester$")
public void I_am_a_bad_tester(){
System.out.println("@Given--I am a bad tester");
}
@When("^I go to work$")
public void I_go_to_work(){
System.out.println("@When---I go o work");
}
@Then("^I mess it$")
public void I_mess_with_it(){
System.out.println("@Then--I mess it");
}
@And("^my boss fires me$")
public void my_boss_fires_me(){
System.out.println("@And---my boss fires me");
}
@But("^the developer likes me$")
public void the_developer_likes_me(){
System.out.println("@But--the developer likes me");
Assert.assertTrue(false);
}
22. Write code to make the step pass
@Given("^I am a [a-zA-Z]{1,} tester$")
public void I_am_a_bad_tester(){
System.out.println("@Given--I am a bad tester");
}
@When("^I go to work$")
public void I_go_to_work(){
System.out.println("@When---I go o work");
}
@Then("^I [a-zA-Z]{1,} it$")
public void I_mess_with_it(){
System.out.println("@Then--I mess it");
}
@And("^my boss [a-zA-Z]{1,} me$")
public void my_boss_fires_me(){
System.out.println("@And---my boss fires me");
}
@But("^the developer [a-zA-Z]{1,} me$")
public void the_developer_likes_me(){
System.out.println("@But--the developer likes me");
}
24. Why is Cucumber better
● Compared to well known tools like JUnit?
● It isn't, it's just easier to read for non coders
● The readability has increased
● Communication is easier