BDD de fuera a dentro
-
Upload
luismi-cavalle -
Category
Technology
-
view
776 -
download
3
Transcript of BDD de fuera a dentro
![Page 1: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/1.jpg)
BDD de fuera a dentro
![Page 2: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/2.jpg)
Luismi Cavallé
![Page 3: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/3.jpg)
BDD de fuera a dentro
![Page 4: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/4.jpg)
BDD de fuera a dentro
![Page 5: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/5.jpg)
TDD?
![Page 6: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/6.jpg)
Behaviour- Driven
Development
![Page 7: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/7.jpg)
BDD = TDD bien hecho?
![Page 8: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/8.jpg)
Enough is enough
Deliver stakeholder value
It’s all behaviour
![Page 9: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/9.jpg)
Enough is enough
Deliver stakeholder value
It’s all behaviour
![Page 10: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/10.jpg)
Enough is enough
Deliver stakeholder value
It’s all behaviour
![Page 11: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/11.jpg)
Enough is enough
Deliver stakeholder value
It’s all behaviour
![Page 12: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/12.jpg)
Acceptance Test-Driven Planning
Domain-Driven Design
Test-Driven Development
![Page 13: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/13.jpg)
Acceptance Test-Driven Planning
Domain-Driven Design
Test-Driven Development
![Page 14: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/14.jpg)
Acceptance Test-Driven Planning
Domain-Driven Design
Test-Driven Development
![Page 15: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/15.jpg)
Acceptance Test-Driven Planning
Domain-Driven Design
Test-Driven Development
![Page 16: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/16.jpg)
Acceptance Test-Driven Planning
Domain-Driven Design
Test-Driven Development
![Page 17: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/17.jpg)
BDD = TDD hecho proceso
![Page 18: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/18.jpg)
BDD de fuera a dentro
![Page 19: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/19.jpg)
BDD de fuera a dentro
![Page 20: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/20.jpg)
Outside-in
![Page 21: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/21.jpg)
ObjectObjectTest
Interface
![Page 22: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/22.jpg)
El ciclo BDD
![Page 23: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/23.jpg)
⓿ Inception
![Page 24: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/24.jpg)
Visión
Metas
Temas
![Page 25: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/25.jpg)
Requerimientos
Funcionalidades
Historias
Escenarios
![Page 26: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/26.jpg)
❶ Scenario
![Page 27: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/27.jpg)
Listado de usuarios
Dado que hay 2 usuarios en el sistema
Cuando visito la página de usuarios
Entonces debería ver 2 usuarios
![Page 28: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/28.jpg)
Listado de usuarios
Dado que hay 2 usuarios en el sistema
Cuando visito la página de usuarios
Entonces debería ver 2 usuarios
![Page 29: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/29.jpg)
❷ Red acceptance
spec
![Page 30: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/30.jpg)
scenario 'List of users' do create_user 'mary' create_user 'paul' visit users_page assert page.has_content?('mary') assert page.has_content?('paul')end
![Page 31: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/31.jpg)
scenario 'List of users' do create_user 'mary' create_user 'paul' visit users_page assert page.has_content?('mary') assert page.has_content?('paul')end
![Page 32: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/32.jpg)
$ rails g model User name:string
![Page 33: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/33.jpg)
scenario 'List of users' do create_user 'mary' create_user 'paul' visit users_page assert page.has_content?('mary') assert page.has_content?('paul')end
![Page 34: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/34.jpg)
$ rails g controller users index
![Page 35: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/35.jpg)
scenario 'List of users' do create_user 'mary' create_user 'paul' visit users_page assert page.has_content?('mary') assert page.has_content?('paul')end
![Page 36: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/36.jpg)
![Page 37: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/37.jpg)
❸ Red unit spec
![Page 38: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/38.jpg)
describe 'users/index.html.erb' do it 'renders the list of users' do render_view :users => [mock(:name => 'Joe')] assert_contains rendered, 'Joe' endend
![Page 39: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/39.jpg)
describe 'users/index.html.erb' do it 'renders the list of users' do render_view :users => [mock(:name => 'Joe')] assert_contains rendered, 'Joe' endend
![Page 40: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/40.jpg)
describe 'users/index.html.erb' do it 'renders the list of users' do render_view :users => [mock(:name => 'Joe')] assert_contains rendered, 'Joe' endend
![Page 41: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/41.jpg)
❹ Green unit spec
![Page 42: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/42.jpg)
<h2>Users</h2><ul> <%= @users.each do |user| %> <li> <%= user.name %> </li> <% end %></ul>
![Page 43: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/43.jpg)
<h2>Users</h2><ul> <%= @users.each do |user| %> <li> <%= user.name %> </li> <% end %></ul>
![Page 44: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/44.jpg)
<h2>Users</h2><ul> <%= @users.each do |user| %> <li> <%= user.name %> </li> <% end %></ul>
![Page 45: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/45.jpg)
❺ Refactor
![Page 46: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/46.jpg)
❻ Green acceptance
spec?
![Page 47: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/47.jpg)
scenario 'List of users' do create_user 'mary' create_user 'paul' visit users_page assert page.has_content?('mary') assert page.has_content?('paul')end
![Page 48: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/48.jpg)
![Page 49: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/49.jpg)
❸ Red unit spec
![Page 50: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/50.jpg)
describe UsersController do describe 'GET index' do it 'assigns the users' do User.stub(:all => users_stub) get :index assert_equal users_stub, assigns[:user] end endend
![Page 51: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/51.jpg)
describe UsersController do describe 'GET index' do it 'assigns the users' do User.stub(:all => users_stub) get :index assert_equal users_stub, assigns[:user] end endend
![Page 52: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/52.jpg)
describe UsersController do describe 'GET index' do it 'assigns the users' do User.stub(:all => users_stub) get :index assert_equal users_stub, assigns[:user] end endend
![Page 53: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/53.jpg)
describe UsersController do describe 'GET index' do it 'assigns the users' do User.stub(:all => users_stub) get :index assert_equal users_stub, assigns[:user] end endend
![Page 54: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/54.jpg)
❹ Green unit spec
![Page 55: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/55.jpg)
class UsersController def index @users = User.all endend
![Page 56: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/56.jpg)
class UsersController def index @users = User.all endend
![Page 57: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/57.jpg)
❺ Refactor
![Page 58: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/58.jpg)
❻ Green acceptance
spec?
![Page 59: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/59.jpg)
scenario 'List of users' do create_user 'mary' create_user 'paul' visit users_page assert page.has_content?('mary') assert page.has_content?('paul')end
![Page 60: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/60.jpg)
![Page 61: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/61.jpg)
❼ Refactor
![Page 62: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/62.jpg)
![Page 63: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/63.jpg)
❶ Scenario
❷ Red acceptance spec
❸ Red unit spec
❹ Green unit spec
❺ Refactor
❻ Green acceptance spec
❼ Refactor
![Page 64: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/64.jpg)
De fuera a dentro
![Page 65: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/65.jpg)
El código que te gustaría
tener
![Page 66: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/66.jpg)
Dejar que el diseño emerja
![Page 67: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/67.jpg)
Escribir el software que
importa
![Page 68: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/68.jpg)
Gracias!
![Page 69: BDD de fuera a dentro](https://reader033.fdocuments.us/reader033/viewer/2022060109/5553b726b4c905d9448b4dd6/html5/thumbnails/69.jpg)
Love-Driven Development