Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Testing and the fly likes Next Generation Java Testing - Related to  Agile? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Next Generation Java Testing - Related to  Agile?" Watch "Next Generation Java Testing - Related to  Agile?" New topic
Author

Next Generation Java Testing - Related to Agile?

Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3353

Hi C�dric Beust and Hani Suleiman,

That was nice to read about the book description. I think you might have got something new apart from the explanation of testing frameworks like JUnit, HttpPerfTest etc.,

As the initial few points used to speak of the same. Like when to test, what to test etc. Is it someway related to Agile Methodology and its feature/test driven processing?

Thank you.


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Cedric Beust
author
Ranch Hand

Joined: Oct 12, 2004
Posts: 46
Hi Raghavan,

Originally posted by Raghavan Muthu:
Hi C�dric Beust and Hani Suleiman,

That was nice to read about the book description. I think you might have got something new apart from the explanation of testing frameworks like JUnit, HttpPerfTest etc.,

As the initial few points used to speak of the same. Like when to test, what to test etc. Is it someway related to Agile Methodology and its feature/test driven processing?

Thank you.


No, the book is not specifically about the Agile Methodology. We do mention it along with a few other related concepts such as Test-Driven Development, but mostly at the end of the book (in the chapter "Digressions").

All the concepts and techniques we describe in this book can be applied by Agile and non-Agile developers alike.

--
Cedric
Hani Suleiman
author
Greenhorn

Joined: Nov 18, 2007
Posts: 22
Hi Raghavan,

One thing we do stress throughout the book is that the techniques and approaches we recommend do not mandate a specific methodology.

Sure, a lot of it is also recommended by Agile, but (in my experience at least). In my case my company doesnt really come across many agile projects, yet testing is still a crucial part of development. One thing we like to stress in the book is that testing is equally valid whether its done up front, or whether it happens after the code is written (or even deployed!) In that sense, we're not requiring that you do it up front, or that you use it to capture use cases. Our view of testing is simply that it is a very useful tool in a developer's toolbox, but is not a golden hammer!
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3353

Originally posted by Cedric Beust:

No, the book is not specifically about the Agile Methodology. We do mention it along with a few other related concepts such as Test-Driven Development, but mostly at the end of the book (in the chapter "Digressions").

All the concepts and techniques we describe in this book can be applied by Agile and non-Agile developers alike.

--
Cedric


That was nice. I thought so. But now got it cleared.

Thank you Cedric
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3353

Originally posted by Hani Suleiman:

One thing we do stress throughout the book is that the techniques and approaches we recommend do not mandate a specific methodology.

Sure, a lot of it is also recommended by Agile, but (in my experience at least).


That's correct. But it did appear to me as such.


One thing we like to stress in the book is that testing is equally valid whether its done up front, or whether it happens after the code is written (or even deployed!)


Very true and well said!


In that sense, we're not requiring that you do it up front, or that you use it to capture use cases. Our view of testing is simply that it is a very useful tool in a developer's toolbox, but is not a golden hammer!


Any specific tool you suggest here Hani?

Thank you
Hani Suleiman
author
Greenhorn

Joined: Nov 18, 2007
Posts: 22
TestNG of course

I actually am not of a fan of many of the third party addons that supposedly make your life easier. While of course there are cases where you have to use things like cactus or htmlunit, I consider the use of these tools to illustrate a more fundamental flaw with your testing strategy.

For example, if you're using cactus, then your backend needs to be refactored so it can run outside of a container, so you can eliminate cactus. The container dependency makes things much less pleasant from a testing perspective.

Similarly for htmlunit. If you're testing generated html, then you're focussing on the wrong thing, and you're better off testing the backend more directly, rather than the presentation layer.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3353

Thank you Hani
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Hani,
Originally posted by Hani Suleiman:
If you're testing generated html, then you're focussing on the wrong thing, and you're better off testing the backend more directly, rather than the presentation layer.

I appreciate the point about testing the backend more directly. Developer tests are important. I'm curious, though, what are your thoughts about automated functional tests for web applications? How do you do it, if you do it?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Hani Suleiman
author
Greenhorn

Joined: Nov 18, 2007
Posts: 22
Hi Lasse,

I'll be honest and say that every method I've tried for functional testing of webapps has, basically, sucked.

There are some guidelines that I think help a bit, but I still don't feel that we (the developer community) have a robust solution that encourages this sort of testing and makes it easy.

For example, using htmlunit/selenium to drive a webapp, and making assertions on the resulting responses/pages is one approach. However, it's quite a fragile approach since it's often tricky to find the right balance between specificity (where UI changes can break your assertions) and vague generalizations (where tests pass even though something's broken).

Another interesting approach for testing javascript is to do it in the browser itself. Writing javascript tests (which in turn leads to following testable design for javascript, a highly under-explored topic!) and invoking those instead.
Walter Bernstein
Ranch Hand

Joined: Dec 19, 2007
Posts: 57
Originally posted by Hani Suleiman:
I'll be honest and say that every method I've tried for functional testing of webapps has, basically, sucked.

Thanks for this truth.
 
Consider Paul's rocket mass heater.
 
subject: Next Generation Java Testing - Related to Agile?