Upgrade to Pro — share decks privately, control downloads, hide ads and more …

My own preferred testing techniques

F0887bf6175ba40dca795eb37883a8cf?s=47 dgageot
September 26, 2011

My own preferred testing techniques

F0887bf6175ba40dca795eb37883a8cf?s=128

dgageot

September 26, 2011
Tweet

Transcript

  1. My own preferred testing techniques Paris Java User Group

  2. www.parisjug.org Copyright(c) 2010 Paris JUG, Licence CC-Creatives Commons 2.0 France

    - Paternité - Pas d’utilisation commerciale - Partage des Conditions à l’identique
  3. Frameworks My own preferred testing techniques JUnit 4+ More expressive

    tests More robust Faster Plugins
  4. Personal taste only

  5. Plugins

  6. MoreUnit, a unit test friendly Eclipse http://moreunit.sourceforge.net/ See what’s tested

  7. MoreUnit http://moreunit.sourceforge.net/ Jump to Test

  8. MoreUnit http://moreunit.sourceforge.net/ Run current test Refactoring friendly (move, rename, delete)

    http://moreunit.sourceforge.net/ Demo
  9. Continuous testing Runs all impacted tests after each code change

    Eclipse and Intellij OpenSource, Free http://infinitest.org
  10. Demo

  11. Continuous testing JUnit Max Runs all impacted tests after each

    code change Try to run tests failing most often, first Eclipse and Intellij OpenSource, Free Developed by Kent Beck http://www.junitmax.com/
  12. Frameworks

  13. Hamcrest More readable assertions

  14. Hamcrest More samples + easy to write custom matchers

  15. So

  16. FEST-Assert More readable assertions Demo

  17. FEST-Assert More readable assertions OpenSource http://fest.easytesting.org/

  18. JUnit 4.8.2 Worst logo ever!

  19. Do you known/use all the features? @Test @Before, @After, @BeforeClass,

    @AfterClass @RunWith @Theory, @DataPoint(s) @Rule @SuiteClasses @Category (beta) JUnit 4.8.2 Demo
  20. @Categories and @SuiteClasses JUnit 4.8.2

  21. @Categories and @SuiteClasses JUnit 4.8.2

  22. @Categories and @SuiteClasses JUnit 4.8.2 Cumbersome Need not forget to

    add each test manually in all suites Who doesn’t run all the tests every build? :-)
  23. @Rule Take a look at the code of MethodRule, ExternalResource,

    TestWatchman, Verifier... Write your own rules if they make the tests easier to read. JUnit 4.8.2
  24. Thank you Q/A

  25. www.parisjug.org Copyright(c) 2010 Paris JUG, Licence CC-Creatives Commons 2.0 France

    - Paternité - Pas d’utilisation commerciale - Partage des Conditions à l’identique