Your SlideShare is downloading. ×
BDD e TDD (Café Ágil)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

BDD e TDD (Café Ágil)

1,902
views

Published on

Published in: Technology, Education

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,902
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
25
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. garantia de qualidade Bdd e TddBdd e Tdd
  • 2. @danielvlopes Daniel Lopes
  • 3. cursos e-Genial consultoria | desenvolvimento | UI area
  • 4. voltando . . .
  • 5. Software !
  • 6. DEADLINE 48 horas
  • 7. BUGS ZERO
  • 8. CÓDIGO !
  • 9. Sou o cara !!!
  • 10. PESQUISAR !
  • 11. Software Automatização =
  • 12. user = User.new user.do_something
  • 13. user = User.new x = user.do_something puts x
  • 14. user = User.new x = user.do_something if x == "magic" puts "OK" else puts "FAIL" end
  • 15. user = User.new x = user.do_something if x == "magic" puts "OK" else raise "FAIL" end
  • 16. user = User.new x = user.do_something unless x == "magic" raise "FAIL" end
  • 17. user = User.new x = user.do_something raise "FAIL" unless x == "magic"
  • 18. def assert(expr) raise "Fail" unless expr end
  • 19. class UserTest < TestUnit def test_do_something user = User.new assert user.do_something == "magic" end end
  • 20. Test::Unit
  • 21. Automatização ?
  • 22. Automatização ? CONFIRMADO
  • 23. def create(login, password, remember_me, auth_token) current_user = User.authenticate(login, password) if current_user.logged_in? if remember_me current_user.remember_me! cookies[:auth_token] = { :value => current_user.remember_token , :expires => current_user.remember_token_expires_at } end redirect_to home_page else redirect_to login_page end end
  • 24. def test_create session = User.new.create(...) assert ??? end
  • 25. Teste
  • 26. Teste
  • 27. Teste Código
  • 28. Teste Código
  • 29. Código bonito
  • 30. Código TESTÁVEL
  • 31. KENT BECK
  • 32. Test Driven Dev.
  • 33. Test Driven Dev. APROVADO
  • 34.
  • 35. ClientDetailsValidatorTest test_fail_with_missing_name test_fail_with_missing_title assert ["missing name"], client.errors ☹
  • 36. Código Comunicação =
  • 37. Trecho do vídeo http://bigthink.com/ideas/21596
  • 38. def test_fail_with_missing_name assert_equal "missing name", client.errors.first end
  • 39. it should fail without name client errors should include "missing name" end
  • 40. DAN NORTH
  • 41. Test method como sentenças
  • 42. Template simples de sentenças = foco
  • 43. Nomes de testes expressivos
  • 44. “Behaviour” é mais útil que “test”
  • 45. David Chelimsky
  • 46. RSpec
  • 47. describe Client do it "should fail without name" do client.errors.should include("missing name") end end
  • 48. describe Client do it "should fail without name" do client.errors.should include("missing name") end end
  • 49. describe Client it should fail without name client errors should include “missing name”
  • 50. Teste como documentação
  • 51. Teste como documentaçãoAPROVADO
  • 52. Requisitos do software?
  • 53. Requisitos Comportamento =
  • 54. In order to _______ As _______ I want _______
  • 55. In order to use the app As a guest I want register
  • 56. Detalhamento ou Passos
  • 57. Given _______ When _______ Then _______
  • 58. Given I am on signup page When I fill email with “jonh@gmail.com” And fill password with “123456” Then I should see a success message
  • 59. Aslak Hellesøy
  • 60. Cucumber
  • 61. # language: en Feature: Addition In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbers Scenario Outline: Add two numbers Given I have entered 10 And I have entered 5 When I press add Then the result should be 15
  • 62. Before do @calc = Calculator.new end Given /I have entered (d+)/ do |n| @calc.push n.to_i end When /I press (w+)/ do |op| @result = @calc.send op end Then /the result should be (.*)/ do |result| @result.should == result.to_f end
  • 63. Mas meu projeto é web ...
  • 64. Behavior Driven Development
  • 65. Behavior Driven DevelopmentAPROVADO
  • 66. voltando . . .
  • 67. CÓDIGO BUGS REQUISITOS DOC’s ☐ ☐ ☐ ☐
  • 68. CÓDIGO BUGS REQUISITOS DOC’s ☑ ☑ ☑ ☑
  • 69. DEADLINE
  • 70. • Rspec Book - http://bit.ly/3PxKUs • Kent Beck Vídeos - http://bit.ly/ahiFEX • Curso de BDD e-Genial - http://bit.ly/a0VqW6 Por onde começo ?
  • 71. CURSOS egenial.com.br/cursorails egenial.com.br/imersaorubyonrails CONTATOS twitter @danielvlopes danielvlopes@gmail.com