Em português

BDD

without
any tools

ThoughtWorks Logo

Warning!

experimental session

Before anything else...

three important activities

Technique to bring everyone back together

Rearranging groups

Who are the people around you?

Show of hands

ever heard of BDD

gave it a try

uses it on a daily basis

BDD

What words come to mind?

What I hear most?

Tool

followed by Cucumber

Noooooo...

Obsession with tools

DANGER!

Tools are fine; but the solution to the software apocalypse is not more tools.

The solution is better programming discipline.


Uncle Bob @ Tools are not the answer

BDD is discipline

not tools

BDD - "Rules"

Test names must be sentences

Test names should be expressive

Start with the most relevant behavior

Automate the tests

BDD - Process

Think about the feature

... before doing it

Break it into scenarios

Pick one to start

Let's start with the requirements

what format?

[title]

In order to...

I, as a...

Want...

Jedi Early Bird Agile Brazil registration

In order to... make sure I'm going to Agile Brazil paying the least possible amount

I, as a... interested agilist

Want... pay way less if I buy it before everyone else does

Jedi Early Bird Agile Brazil registration

In order to... get the money wheel rolling and measure the interest on next year's conference

I, as a... conference organizer pig

Want... tp offer a great discount for registrations that happen in 2017, limited to 100

[2'] In groups...

What is the most important scenario?

[5'] Refactor it!

Defined format

Given... pre-conditions

When... action

Then... expected outcome

What are we missing?

What we need to discuss is...

1. Why do we all have to think about the behavior?

Caipira Agil attendees mentioned...

  • Leveling information about the feature
  • Focus on what needs to get done
  • Avoidance of bad surprises on validation
  • 2. Why think about the behavior before coding?

    Caipira Agil attendees mentioned...

  • Possibility to pre-validate behavior
  • Estimates get easier with a broader understanding
  • Focusing on what is important
  • Avoiding doing more than necessary (simplicity)
  • Test code reuse, maybe
  • 3. What are the advantages of acceptance test automation?

    And what are the costs?


    Example: Calopsita Project automated tests Further reading: Acceptance Tests at AgileAlliance.org

    Caipira Agil attendees mentioned...

  • Safety, regression and coverage
  • Avoiding domino effect
  • Mimics the user, but without human variation
  • Cheaper and faster than manual testing
  • Easier for newcomers to understand the business
  • Less effort for deliveries and development
  • Way slower and more expensive to run than unit tests
  • Acceptance tests cost more to implement, too
  • More unstable than other kinds of tests
  • 4. What are the advantagem of writing "natural language" tests?

    And what are the costs?


    Example: Cucumber scenarios Further reading: James Shore's experiences on natural language testing

    Caipira Agil attendees mentioned...

  • The client can understand automated tests too
  • It helps if your client requires a test report in natural language
  • Theoretically, the client can be involved in test writing
  • In real life, the client won't read tests on our code
  • An extra layer of code increases complexity
  • The code behind natural languages are harder to understand
  • It can be more difficult to identify repeated code
  • The compiler won't help you (in many tech stacks)
  • BDD

    without
    any tools

    Ceci Fernandes
    & Caipira Agil attendees

    @cecifernandes

    cecifernandes.com

    ThoughtWorks Logo