Skip to content

The QA-Challenge: Reproducers with JUnit

by on May 11, 2012
Racetrack

Common development – if you are not test driven – goes like this:

  1. Implement Feature
  2. Write Test
  3. Run Test

If you are lucky, your test will never break and your test covers all necessary boundaries like MAX_INT etc.

If you have to fix a bug in your product it typically goes like this:

  1. Reproduce bug manually.
  2. Debug
  3. Fix the bug.
  4. Write Test – of course you should do that as obviously your current tests were not able to detect the bug.
  5. Run Test

To do it this way was a bad decision: You missed the Challenge.

The Challenge

The challenge is to write a reproducer test for this bug. And to do this before you actually fix the bug.

Why that?

  • Only if you write the test before fixing the bug you will know if the test is able to actually detect the bug.
  • It gives you the opportunity to learn how to write robust tests: Robust tests…
    • can deal with the failure
    • don’t block the complete test-run
    • clean up their data not to make other tests fail

The more you learn about robust testing the more you learn about try/finally statements, how to use @After/tearDown() in your tests and you will learn about tests which are able to automatically end after a given timeout.

So – do you take the challenge?

From → Dev

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s