Behaviour Driven Development
-
Upload
milfont-consulting -
Category
Technology
-
view
12 -
download
0
description
Transcript of Behaviour Driven Development
![Page 1: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/1.jpg)
Behaviour Driven Development [BDD]
Desenvolvimento guiado a comportamento
Christiano MilfontXPCE 2009, FortalezaCopyleft 2009 Milfont.org
![Page 2: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/2.jpg)
Use Case Um caso de uso captura um contrato entre os interessados de um sistema sobre seus comportamentos.
Writing Effective Use Cases
Alistair Cockburn
User Story Uma estoria descreve funcionalmente o que será valioso para os usuários e aos compradores de um software.
User Stories Applied
Mike Cohn
Behaviour Driven Development
![Page 3: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/3.jpg)
User Story
• Card [cartão]• Conversation [conversação]• Confirmation [confirmação]
“Ron Jeffries, 2001”
Behaviour Driven Development
![Page 4: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/4.jpg)
User Story• Independente• Negociável• Valioso ao comprador• Estimável• Small [Pequena]• Testável
User Stories Applied
Mike Cohn
Behaviour Driven Development
![Page 5: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/5.jpg)
Story Card
Behaviour Driven Development
![Page 6: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/6.jpg)
Story Card
Behaviour Driven Development
![Page 7: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/7.jpg)
Story Card
Behaviour Driven Development
![Page 8: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/8.jpg)
Behaviour Driven Development
Story Card• As a… • I want…• so that…
“BDD fornece uma linguagem ubíqua
para análise”Dan North
![Page 9: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/9.jpg)
Behaviour Driven Development
Story Card• As a [X]• I want [Y]• so that [Z]Onde: Y é alguma funcionalidade ou característica, Z é o benefício ou valor dessa funcionalidade e X é a pessoa ou perfil/papel beneficiado
![Page 10: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/10.jpg)
Behaviour Driven Development
Story Card• As a [role]• I want to [activity]• To do [a task]
![Page 11: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/11.jpg)
Behaviour Driven Development
Story Card• As a “membro do projeto”• I want “Criar uma issue”• so that “Eu possa acompanhar a resolução”
• As a “gerente do projeto”• I want “aceitar a entrada de uma issue”• so that “seja descartada ou resolvida apenas
com minha permissão”
![Page 12: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/12.jpg)
Behaviour Driven Development
Acceptance CriteriaGiven [dado]When [quando]Then [então]
![Page 13: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/13.jpg)
Behaviour Driven Development
Acceptance CriteriaGiven uma issue preenchida e um projeto
informadoWhen um membro requisitar o cadastroThen garantir que ela seja armazenada no
sistema And uma mensagem seja informadaAnd a issue esteja na lista de não-confirmadas
![Page 14: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/14.jpg)
Behaviour Driven Development
Acceptance CriteriaGiven uma issue preenchida
And um projeto informado And um membro autorizado
When um membro requisitar o cadastroThen garantir que ela seja armazenada no sistema
And uma mensagem seja informadaAnd a issue esteja na lista de "novas issues" a serem resolvidas
![Page 15: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/15.jpg)
Behaviour Driven DevelopmentTitulo: Cadastrar IssuesAs a membro do projetoI want criar uma issueSo that eu possa acompanhar a resolução do mesmo.Cenário 1Given uma issue preenchida e um projeto informadoWhen um membro requisitar o cadastroThen garantir que ela seja armazenada no sistema
And uma mensagem seja informada And a issue esteja na lista de não-confirmadas
Cenário 2Given um nome e um tipo e um nivel e um sumario a um projetoWhen o membro requisitar o cadastroThen garantir que seja criada uma issue
And armazenada no sistema And uma mensagem seja informada And a issue esteja na lista de não-confirmadas
![Page 16: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/16.jpg)
Behaviour Driven DevelopmentGiven um nome e um tipo e um nivel e um sumario a um projetoWhen o membro requisitar o cadastroThen garantir que seja criada uma issue
And armazenada no sistema And uma mensagem seja informada And a issue esteja na lista de não-confirmadas
@Given("a $name and a $type and a $level and a $summary and a $project")public void relatar(String name…) throws IllegalArgumentIssueException {
throw new IllegalArgumentIssueException("erro");}
![Page 17: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/17.jpg)
Behaviour Driven DevelopmentGiven um nome e um tipo e um nivel e um sumario a um projetoWhen o membro requisitar o cadastroThen garantir que seja criada uma issue
And armazenada no sistema And uma mensagem seja informada And a issue esteja na lista de não-confirmadas
@Given("a $name and a $type and a $level and a $summary and a $project")public void relatar(String name…) throws IllegalArgumentIssueException {
Issue issue = member.createIssue(name).withType(type).withLevel(level).withSummary(summary).toProject(project);
ensureThat(issue.getStatus(), equalTo(Status.UNCONFIRMED));…
}
![Page 18: Behaviour Driven Development](https://reader036.fdocuments.us/reader036/viewer/2022062613/545610f5af795940578b9eb3/html5/thumbnails/18.jpg)
Behaviour Driven Development
Reference
http://groups.google.com.br/group/xpce