What is TDD?
Test-driven development (TDD) is a technique for
building software that guides software development by
writing tests first.
- Martin Fowler
● Req: Calculation engine to be able to add 2 numbers
assertEquals(calculator.add(1, 2), 3);
assertEquals(calculator.add(-1, -2), -3);
assertEquals(calculator.add(“one”, “two”), 3);
So, BDD then?
People are moving towards BDD
But what is BDD?
When asked what is BDD
● It’s just TDD right?
● That Given-When-Then thing
● Business driven development
● The BA/PO writes the requirements and then the devs
A collaborative way to define what behaviour in a system
should be tested, by using the same language (natural
language) and grammar used to capture the business need.
As a [Role]
I want [Feature]
So that I receive [Value]
As an online shopper
I want to search for products
So that I can make buying decision
When [Event Occurs]
Given that I have logged in
When I search for a product
Then list of related items are displayed
A Badly Written Test
Given that I am on the home page
When I click on the “login” link
And I type text “Mahendra” in the “name” text box
And I type “pwd” in the “password” text box
And I click the “login” button
Then I can see my profile
A Well Written Test
Given I land on the homepage
When I log into my account with username “Mahendra” and
Then I am on the “profile” page
Another Well Written Test
● Open Home Page
● Login with with username “Mahendra” and password
● “Profile” page is displayed
In a tool we want...
because who doesn’t like simple!!
because everyone has been on a long running project and we
know it is hell to keep tests working
because we all have our own preferences
because we all have that need for speed
What if we want to break away from every form of
syntax and write specifications in natural
Like you’d write an email
● Open Source
● Simple Markdown syntax
● Multiple Language Support (Java, C#, Ruby)
● First class parallel execution support
● Extensible and Hackable
● IDE support (IntelliJ, VS, Eclipse)
● First class CI / CD integration support