gotochicago thejayfields
play

#gotochicago @thejayfields Tuesday, May 12, 15 @thejayfields JUnit - PowerPoint PPT Presentation

#gotochicago @thejayfields Tuesday, May 12, 15 @thejayfields JUnit version 4.11 ......... Tuesday, May 12, 15 @thejayfields JUnit version 4.11 .......................................................E.E.. Tuesday, May 12, 15 @thejayfields


  1. #gotochicago @thejayfields Tuesday, May 12, 15

  2. @thejayfields JUnit version 4.11 ......... Tuesday, May 12, 15

  3. @thejayfields JUnit version 4.11 .......................................................E.E.. Tuesday, May 12, 15

  4. @thejayfields JUnit version 4.11 .E.E.. There were 2 failures: 1) statement(CustomerTest) org.junit.ComparisonFailure: expected:<...or John Godfather 4[ ]9.0 Amount owed is 9...> but was:<...or John Godfather 4[ ]9.0 Amount owed is 9...> 2) htmlStatement(CustomerTest) org.junit.ComparisonFailure: expected:<...</h1> <p>Godfather 4[ ]9.0</p> <p>Amount ow...> but was:<...</h1> <p>Godfather 4[ ]9.0</p> <p>Amount ow...> FAILURES!!! Tests run: 4, Failures: 2 Tuesday, May 12, 15

  5. @thejayfields JUnit version 4.11 .E.E.. There were 2 failures: 1) statement(CustomerTest) org.junit.ComparisonFailure: expected:<...or John Godfather 4[ ]9.0 Amount owed is 9...> but was:<...or John Godfather 4[ ]9.0 Amount owed is 9...> 2) htmlStatement(CustomerTest) org.junit.ComparisonFailure: expected:<...</h1> <p>Godfather 4[ ]9.0</p> <p>Amount ow...> but was:<...</h1> <p>Godfather 4[ ]9.0</p> <p>Amount ow...> FAILURES!!! Tests run: 4, Failures: 2 Tuesday, May 12, 15

  6. @thejayfields Tuesday, May 12, 15

  7. @thejayfields Tuesday, May 12, 15

  8. @thejayfields Tuesday, May 12, 15

  9. @thejayfields Tuesday, May 12, 15

  10. @thejayfields Tuesday, May 12, 15

  11. @thejayfields Tuesday, May 12, 15

  12. @thejayfields Tuesday, May 12, 15

  13. @thejayfields Tuesday, May 12, 15

  14. @thejayfields Tuesday, May 12, 15

  15. @thejayfields Tuesday, May 12, 15

  16. @thejayfields Tuesday, May 12, 15

  17. @thejayfields Tuesday, May 12, 15

  18. @thejayfields Tuesday, May 12, 15

  19. @thejayfields Tuesday, May 12, 15

  20. @thejayfields Tuesday, May 12, 15

  21. @thejayfields Tuesday, May 12, 15

  22. @thejayfields Tuesday, May 12, 15

  23. @thejayfields Tuesday, May 12, 15

  24. @thejayfields Tuesday, May 12, 15

  25. @thejayfields Tuesday, May 12, 15

  26. @thejayfields Tuesday, May 12, 15

  27. Tuesday, May 12, 15

  28. 1. statement() Tuesday, May 12, 15

  29. 2. customer[] Tuesday, May 12, 15

  30. 3. Customer Assignment Tuesday, May 12, 15

  31. 4. Digest setup Tuesday, May 12, 15

  32. 5. Object mother Tuesday, May 12, 15

  33. 6. OBJECT Mother customer variations Tuesday, May 12, 15

  34. 7. expected string building Tuesday, May 12, 15

  35. 8. rentalInfo() Tuesday, May 12, 15

  36. 9. rentalinfo implemtation Tuesday, May 12, 15

  37. 10. find and digest expstatement() Tuesday, May 12, 15

  38. Tuesday, May 12, 15

  39. @thejayfields why? Tuesday, May 12, 15

  40. @thejayfields we write tests we don’t need with time we don’t have to satisfy people we don’t like. Tuesday, May 12, 15

  41. Tuesday, May 12, 15

  42. @thejayfields motivators? enable refactoring, immediate feedback, and breaking a problem up into smaller pieces Tuesday, May 12, 15

  43. @thejayfields motivators? enable refactoring, immediate feedback, and breaking a problem up into smaller pieces Tuesday, May 12, 15

  44. @thejayfields motivators? enable refactoring, immediate feedback, and breaking a problem up into smaller pieces Tuesday, May 12, 15

  45. @thejayfields motivators? enable refactoring, immediate feedback, and breaking a problem up into smaller pieces Tuesday, May 12, 15

  46. @thejayfields motivators? enable refactoring, immediate feedback, and breaking a problem up into smaller pieces Tuesday, May 12, 15

  47. @thejayfields motivators? enable refactoring, immediate feedback, and breaking a problem up into smaller pieces Tuesday, May 12, 15

  48. @thejayfields To create a tiny universe where the software exists to do one thing and do it well. -- @delitescere Tuesday, May 12, 15

  49. @thejayfields To create a tiny universe where the software exists to do one thing and do it well. -- @delitescere Tuesday, May 12, 15

  50. @thejayfields DRY Tuesday, May 12, 15

  51. @thejayfields Suite / Fixture / Test Tuesday, May 12, 15

  52. @thejayfields Suite / Fixture / Test Tuesday, May 12, 15

  53. Testing unrelated customers Tuesday, May 12, 15

  54. Creating unrelated customers Tuesday, May 12, 15

  55. overextracting Tuesday, May 12, 15

  56. relevant data only Tuesday, May 12, 15

  57. Dry Suites , dry locals, Else Damp Tuesday, May 12, 15

  58. one: replace loop with individual tests Tuesday, May 12, 15

  59. Tuesday, May 12, 15

  60. Tuesday, May 12, 15

  61. @thejayfields It’s only after we’ve duplicated everything that we’re free to dry anything Tuesday, May 12, 15

  62. @thejayfields two: expect literals Tuesday, May 12, 15

  63. @thejayfields Tuesday, May 12, 15

  64. @thejayfields Tuesday, May 12, 15

  65. @thejayfields three: inline setup Tuesday, May 12, 15

  66. @thejayfields Tuesday, May 12, 15

  67. @thejayfields Tuesday, May 12, 15

  68. Tuesday, May 12, 15

  69. Tuesday, May 12, 15

  70. @thejayfields Motivators Tuesday, May 12, 15

  71. @thejayfields validate the system feedback prevent regression Tuesday, May 12, 15

  72. @thejayfields code coverage Tuesday, May 12, 15

  73. @thejayfields enable refactoring Tuesday, May 12, 15

  74. @thejayfields enable refactoring Tuesday, May 12, 15

  75. @thejayfields document the system Tuesday, May 12, 15

  76. @thejayfields manager told you to Tuesday, May 12, 15

  77. @thejayfields tdd break up a problem improved design Tuesday, May 12, 15

  78. @thejayfields customer acceptance Tuesday, May 12, 15

  79. Tuesday, May 12, 15

  80. @thejayfields Any fool can write a test that helps them today. Good programmers write tests that help the entire team in the future. Tuesday, May 12, 15

  81. what can we do? Tuesday, May 12, 15

  82. This is your career and it’s ending one test suite run at a time Tuesday, May 12, 15

  83. @thejayfields def: Solitary Unit Test 1. never cross boundaries 2. the Class Under Test should be the only concrete class found in a test Tuesday, May 12, 15

  84. @thejayfields def: Solitary Unit Test 1. never cross boundaries 2. the Class Under Test should be the only concrete class found in a test Tuesday, May 12, 15

  85. @thejayfields def: Sociable Unit Test 1. any unit test that isn’t solitary Tuesday, May 12, 15

  86. + Sociable Tuesday, May 12, 15

  87. + Sociable - solitary Tuesday, May 12, 15

  88. + Sociable + Solitary Tuesday, May 12, 15

  89. @thejayfields Tuesday, May 12, 15

  90. @thejayfields Tuesday, May 12, 15

  91. @thejayfields Tuesday, May 12, 15

  92. @thejayfields Tuesday, May 12, 15

  93. @thejayfields Tuesday, May 12, 15

  94. Confidence Tuesday, May 12, 15

  95. isolation Tuesday, May 12, 15

  96. integration Tuesday, May 12, 15

  97. @thejayfields Tuesday, May 12, 15

  98. @thejayfields how else can I improve the test suite? Tuesday, May 12, 15

  99. @thejayfields one assertion per test Tuesday, May 12, 15

  100. @thejayfields Tuesday, May 12, 15

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend