27
Acceptance Test-Driven Development (ATDD) Behavior-Driven Development (BDD) Specification by Example (SBE) @rmueller

Specification By Example - BluDotNet

Embed Size (px)

DESCRIPTION

Palestra que ministrei no BluDotNet em 06/04/2013 sobre specification by example

Citation preview

Page 1: Specification By Example - BluDotNet

Acceptance Test-Driven Development (ATDD)

Behavior-Driven Development (BDD)

Specification by Example (SBE)

@rmueller

Page 2: Specification By Example - BluDotNet

Software sem bugs não é suficiente, é preciso escrever o software certo.

Fracasso Comercial Sucesso

Lixo Pesadelo

Produto Certo

Construir sem defeitos

Page 3: Specification By Example - BluDotNet

ATDD“The first rule of any technology used in a business is that automation applied to an

efficient operation will magnify the efficiency. The second is that automation applied to an

inefficient operation will magnify the inefficiency.”

Bill Gates

Page 4: Specification By Example - BluDotNet

ATDD• Transformar user stories em testes

• TDD em um nível mais alto

Page 5: Specification By Example - BluDotNet

BDD“a second-generation, outside-in, pull-based,

multiple-stakeholder, multiple-scale, high-automation, agile methodology”

Dan North, 2009

Page 6: Specification By Example - BluDotNet

BDD• Maior foco no cliente

• Preocupação maior com entrega de valor

• Descoberta de novas informações

Page 7: Specification By Example - BluDotNet

SBE• Foca nos exemplos• Busca a colaboração • Busca a descoberta • Não tem a carga de má interpretações• Fornece uma documentação viva• Amigável para não técnicos

Page 8: Specification By Example - BluDotNet
Page 9: Specification By Example - BluDotNet

Derivar escopo dos objetivos

Page 10: Specification By Example - BluDotNet

Especifique em colaboração

Page 11: Specification By Example - BluDotNet

Ilustre utilizando exemplos

Page 12: Specification By Example - BluDotNet

Refine a especificação

Page 13: Specification By Example - BluDotNet

Refine a especificação

• Precisa e testável

• Especificação não é script

• Auto explicativa

• Escrita na linguagem do domínio

Page 14: Specification By Example - BluDotNet

Automatize

Page 15: Specification By Example - BluDotNet

Automatize• Trate código de teste com muito

cuidado

• Automatize em diferentes níveis

• Investimento inicial alto

• Feedback imediato, documentação viva e testes de regressão

• Automatize sem alterar as especificações

Page 16: Specification By Example - BluDotNet

Automatize

Page 17: Specification By Example - BluDotNet

Valide com frequência

Page 18: Specification By Example - BluDotNet

Construa uma documentação

Page 19: Specification By Example - BluDotNet
Page 20: Specification By Example - BluDotNet
Page 21: Specification By Example - BluDotNet

SpecFlow• Framework open source BDD/ATDD

• Utilizar Gherkin como DSL para as especificações

• Utiliza ferramentas padrões do .net, como o VisualStudio e nUnit, msTest ou xUnit

• Iniciou desenvolvimento em 2009

• Já foi utilizado em vários projetos

Page 22: Specification By Example - BluDotNet

Gherkin• Uma DSL para escrita de especificações no

estilo de estórias. Dado / Ao / Então• Nasceu na comunidade ruby• Permite automatização e execução da

especificação• Utiliza vocabulário próprio• Dado, E, Então, Cenário, Mas...

Page 23: Specification By Example - BluDotNet

Pickles

Page 24: Specification By Example - BluDotNet

DEMO

SpecFlow

Integração

Negócio

Page 25: Specification By Example - BluDotNet

“SBE”• Usar SpecFlow para automatização de teste• Cliente?! Que cliente??• Usar como ferramenta de testes de integração• Ligar o turbo!• Especificar tudo

http://www.jamesshore.com/Blog/Five-Ways-to-Misuse-Fit.html

Page 26: Specification By Example - BluDotNet

SBE!• Colaboração

• Exemplos bem escritos

• Automatização

• Documentação

Page 27: Specification By Example - BluDotNet

Obrigado!

@rmueller

[email protected]