aspose file tools*
The moose likes Testing and the fly likes Next Generation Java Testing: what's new? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Next Generation Java Testing: what Watch "Next Generation Java Testing: what New topic
Author

Next Generation Java Testing: what's new?

Robert Spielmann
Greenhorn

Joined: Sep 05, 2007
Posts: 5
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

Joined: Oct 12, 2004
Posts: 46
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

Joined: Oct 12, 2004
Posts: 46
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

Joined: Jul 11, 2001
Posts: 14112
You can remove double posts by using the "edit/delete post" icon at the top of each post.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30352
    
150

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Hendy Setyo Mulyo
Ranch Hand

Joined: Dec 01, 2004
Posts: 219

Hi Cedric,

Is your method of testing also suitable for other technologies such as .NET?


Hendy Setyo Mulyo
SCJP 1.4 (95%), SCWCD 1.4 (94%)
Robert Spielmann
Greenhorn

Joined: Sep 05, 2007
Posts: 5
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

Joined: Nov 18, 2007
Posts: 22
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!
 
wood burning stoves
 
subject: Next Generation Java Testing: what's new?