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
- Are you introducing fundamentally new ways of testing? - What makes your test methods specific to Java?
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?
posted 12 years ago
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.
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
Is your method of testing also suitable for other technologies such as .NET?
Hendy Setyo Mulyo
SCJP 1.4 (95%), SCWCD 1.4 (94%)
posted 12 years ago
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.
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!