• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Next Generation Java Testing: what's new?

 
Robert Spielmann
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cedric,
Hi Hani,

as a consultant and developer I'm used to testing applications using a variety of tools:

JUnit during development
Webtest for HTML interfaces
JUnit and commercial tools for load testing

My questions:

- Are you introducing fundamentally new ways of testing?
- What makes your test methods specific to Java?

Regards,
Robert
 
Cedric Beust
author
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Robert,

Originally posted by Robert Spielmann:
Hi Cedric,
Hi Hani,

as a consultant and developer I'm used to testing applications using a variety of tools:

JUnit during development
Webtest for HTML interfaces
JUnit and commercial tools for load testing

My questions:

- Are you introducing fundamentally new ways of testing?
- What makes your test methods specific to Java?

Regards,
Robert


Your second question first: all the examples of the book are written in Java, and we use TestNG to illustrate all the concepts we introduce. This makes the book fairly specific to Java, but I guess that people who work in other languages could reuse some of the techniques we describe and that are not Java-specific (such as performance testing or multi-thread testing).

Obviously, Java-specific frameworks that we discuss suchs as Guice, Spring or Java EE in general are only applicable in Java.

As for your first question, well, yes, we tried hard to describe new topics. A lot of the content of the book comes from the experience we acquired by participating on the TestNG mailing-list these past three years, and if you're not familiar with TestNG, you will notice that its evolution has been essentially driven by user requests.

What prompted the creation of the book in the first place was the realization that although unit testing has been covered in books such as "JUnit in Action", we still didn't have any reference material when it comes to broader testing (e.g. functional testing).

Some of the questions we try to answer in our book are:

Whether your code will scale as expected.
How you can make sure your code is reasonably multithread safe.
How to test a servlet and how to use the various Java Web testing frameworks.
How to use dependency injection in practice.
How to test a Spring application.
etc...

Does this answer your questions?

--
Cedric
 
Cedric Beust
author
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the multiple post but I keep getting errors from the web site ("what in tarnation...") and so I press the Back button and "Add reply" again.

Which seems to be a bad idea...
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can remove double posts by using the "edit/delete post" icon at the top of each post.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34198
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:
You can remove double posts by using the "edit/delete post" icon at the top of each post.

I took care of this on Cedric's behalf to make the thread easier to read. Hope you don't mind Cedric.
 
Hendy Setyo Mulyo
Ranch Hand
Posts: 219
Firefox Browser Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cedric,

Is your method of testing also suitable for other technologies such as .NET?
 
Robert Spielmann
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cedric,

thanks a lot for your answers. If I got you right, you use TestNG for the examples in the book. I'm used to working with JUnit and have no knowledge about TestNG. So, if I may ask two short additional questions:

- what were the fundamental reasons for choosing TestNG and
- can the examples be implemented using JUnit as well, or does JUnit lack essential features related to your tests?

I'm very interested in reading the book, especially because I have met several situations where JUnit didn't help me out for testing.
 
Hani Suleiman
author
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Robert,

Some of the techniques are definitely applicable to JUnit. In particular, much of the integration and EE testing principles and tools can be used directly with JUnit.

However, many of the patterns we discuss are just too awkward to implement with JUnit. For example, anything that uses dependencies (like async testing) or timeouts/success percentages (QoS tests).

The reason for using TestNG is probably very similar to your current frustrations. JUnit simply didnt cut it for some of the testing scenarios we were encountering, hence TestNG was born.

I'd be curious to hear of what specific situations you're running across where JUnit isnt helping. It's also possible that you have something more fundamental going on that makes testing very difficult!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic