0% found this document useful (0 votes)
8 views40 pages

Cucumber

The document discusses the Waterfall model and Agile software development, highlighting the limitations of Agile such as traditional testing models and lack of collaboration. It introduces Test Driven Development (TDD) and Behavior Driven Development (BDD) as methodologies that promote better communication and understanding among team members. Additionally, it outlines practices for BDD, including discovery workshops and example mapping, while debunking common myths associated with BDD.

Uploaded by

Tushar Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views40 pages

Cucumber

The document discusses the Waterfall model and Agile software development, highlighting the limitations of Agile such as traditional testing models and lack of collaboration. It introduces Test Driven Development (TDD) and Behavior Driven Development (BDD) as methodologies that promote better communication and understanding among team members. Additionally, it outlines practices for BDD, including discovery workshops and example mapping, while debunking common myths associated with BDD.

Uploaded by

Tushar Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 40

The Waterfall model

Requirements Software Requirement Specifications

Design Design documents

Implementatio
Software under test
n

Testing Final software


The Waterfall model

Requirements • Working in silos


• The process is sequential
• Change is costly
• Delays can lead to low quality
Design • Building the right thing?

Implementatio
n

Testing
Agile Software Development

“An umbrella term for a set of frameworks and


practices based on the values and principles
expressed in the Manifesto for Agile Software
Development and the 12 Principles behind it”

Scrum, Extreme Programming, Kanban, BDD, etc.


Agile Software Development
Analyz
Deploy Plan
e
Desig
Test Where Agile Fall Short
n

Testing still follows traditional model


Build

Deploy Deploy
Analyz
Deploy Plan
Desig
e
n
Test Where Agile Fall Short
Build
Testing still follows traditional model
Testing happens in the
end
Deploy

Deploy
Where Agile Fall Short

Testing still follows traditional model

Tech debt
Where Agile Fall Short

Lack of collaboration
Where Agile Fall Short

User stories not clear


Commi
Analyz
Plan
Desig
t
e
n
Test Where Agile Fall Short
Build
Safety net
Regression

Commit

Commit
Where Agile Fall Short

Bad automation
Where Agile Fall Short
Test Driven Development

Write a testTest
Code
Refactor
that fails Write just enough
code to make
the test pass

Refactor the code


Test Driven Development

Test
Code
Refactor public class CustomerTest {

@Test
public void
testSearchCustomer(){}

}
Test Driven Development

Test
Code
Refactor public class CustomerTest {

@Test
public void testFindCustomerByfirstName(){}

@Test
public void
testFailsForCustomerWithAnEmptyfirstName(){}

}
Test Driven Development

Test
Code
Refactor Customer lookup,
- Find customer by first name
- Fails for customer with an empty
first name
Test Driven Development

Behaviors and not test!


Test Driven Development

Requirements are behaviors, too!


Test Driven Development

• Consistent vocabulary
• Eliminate ambiguity
• Eliminate miscommunication
Behavior Driven Development
What is BDD?

• Collaboration
• Build shared understanding
• Fast feedback
• Produce system documentation
BDD, TDD and Agile

Agile
principles:
 Collaboration through face-to-face conversations
[#6]

 Business people and developers must work


together daily throughout the process [#4]

 Working software is the primary measure of


progress [#7]
What is BDD?

Ubiquitous language
What is BDD?

Concrete, real-world examples


What is BDD?

Acceptance Criteria

Acceptance
Criteria
What is BDD?

Executable specifications
What is BDD?

Living Documentation
What is BDD?

It’s all about conversations


BDD, TDD and Agile

Can BDD and TDD happen together

When to start BDD

When to start TDD


BDD, TDD and Agile
Test
Formulate

Write a failing
scenario
Refactor
Discover Code
Code Write a failing
BDD Unit test
User
Story

TDD
Analyz
Deploy Plan
BDD, TDD and Agile
Formu
e
Test
late

Day Code
Discov
Refact
er
Day n
or
1 …

BDD BDD BDD

TDD TDD TDD

Deploy Deploy

User User User story


story 1 story 2 n…
BDD Practices
Discovery workshop

• When should you hold a discovery workshop?


when user story creation begins or at time of sprint
planning
• Who should attend?
5-6 members: dev, qa, ba po
• How long does a discovery workshop take?
20-30 mins
• How to conduct a discovery workshop?
example mapping model
Example Mapping

User
Story
Example Mapping

User
Story

Rule Rule Rule Question

Example Example Question

Example
Example Mapping

Thumb rules:
• Story with too many questions => more research nee
• Story with too many rules => break into new story
• Rule with too many examples => multiple rules need
• Rule with no example
• Story that cannot be scoped in one session
• Avoid Gherkins
Example Mapping
Quoting Matt Wynne:
The real benefit of example mapping is to be able to focus on the smallest pieces of
behavior inside your story, find the core of the behavior you want and defer the rest
until later. With this level of scrutiny, example mapping acts like a filter, preventing big
fat stories from getting into your sprint and exploding with last minute surprises three
days before demo-day.
BDD Myths

• Using Cucumber means you are doing


BDD

• Discovery workshops are not needed to


do BDD

• The business should write the Gherkin

• Converting manual tests to scenarios


means you’re doing BDD

• You can automate scenarios after the


code is implemented
Installation
Installation

• Java JDK [17 LTS]

• IDE [IntelliJ/Eclipse]

• Plugins

You might also like