Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Next Generation Java Testing - Related to Agile?

 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Cedric Beust
author
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Hani
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Hani Suleiman
author
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic