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

Let's make this test suite run faster! - BeJUG

dgageot
April 05, 2012

Let's make this test suite run faster! - BeJUG

dgageot

April 05, 2012
Tweet

More Decks by dgageot

Other Decks in Programming

Transcript

  1. “ I firmly believe it can make your product better.

    Faster to test leads to faster to write, deploy and use ” Anonymous bearded freelance developper
  2. “ I firmly believe it can make your product better.

    Faster to test leads to faster to write, deploy and use ” Anonymous bearded freelance developper
  3. Use all the cores with Maven3 mvn -T1 clean install

    : 5:05s mvn -T4 clean install : 3:10s Beware of tests with side effects
  4. Work in a sandbox In-memory database H2 behaves much like

    MySql As simple as changing an xml file The database is slow
  5. It’s Not only SQL If going for NoSQL, choose a

    server that can run in-process eg. Voldemort The network is slow
  6. The

  7. Action #1 - Break the longer integration Into one faster

    integration test and a lot of small
  8. Action #2 - Mock the slowest layers Mocks are not

    just for unit tests eg. with Spring and Mockito spies
  9. Action #3 - Don’t test through the Selenium is often

    overkill «But my application is complex!» «My users want complex features, My users want Ajax» «I need to test browser compatibility!»
  10. One more thing™ Action #0 - Simplify and optimize your

    code Tests will run faster Keep that one secret...