JavaOne 2013 – 10 things you should know when writing Good Unit Test Cases in Java

netbeans_javaone_2013_icon125Today was the first day of JavaOne 2013 and it was jammed packed full of sessions. The best one I went to gave these 10 clear ideas to write good tests.

1. Think before you act (ie planning!)

2. Make your tests understandable.

3. Keep your tests small and simple.

4. Test one thing only.

5. Fast tests only.

6. Absolute repeatability.

7. Independent tests only.

8. Provide diagnostic output on failure.

9. No hard coding your environment.

10. No extraneous output.

Tomorrow is another full day at JavaOne. What was your favourite Monday talk?

If you want more information on JavaOne 2013 and further coverage of the entire event check out our JavaOne 2013 Series Index, which covers everything that is happening and is constantly updated, keep checking back for new info!

If you’re a first-time reader, or simply want to be notified when we post new articles and updates, you can keep up to date by social media (TwitterFacebook and Google+) or the Blog RSS.

 

The following two tabs change content below.

Mark Stephens

System Architect and Lead Developer at IDRSolutions
Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX. He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

Related Posts:

Markee174

About Mark Stephens

Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX. He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

4 thoughts on “JavaOne 2013 – 10 things you should know when writing Good Unit Test Cases in Java

  1. Hi Mark,

    I will soon publish a book about antipatterns and good practices of testing (named ‘Bad Tests, Good Tests’). Stay tuned and follow me to learn about the details.

    Cheers!

    • Thanks for the heads up. That sounds like it will be very useful.

  2. Hi, thanks for your interest in the BOF that Paul Thwaite and I did at JavaOne this year. [1] I’m glad it was the best thing you saw that day! The ten points came from Paul. He’s posted his slides here [2]. There’s actually a lot more information in the discussion between Paul and me on stage and with the audience. I’m not sure if the session was recorded, though.

    Again, thanks for your interest!

    [1] https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=4255

    [2] http://www.slideshare.net/PaulThwaite/ten-things-you-should-know-when-writing-good-unit-test-cases-in-java-java-one-2013

    • Thanks for the links Stuart. It was one of my favourite talks of javaOne 2013. And the little insights into the OpenJDK were fascinating…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>