wood burning stoves 2.0*
The moose likes Testing and the fly likes Testing techniques and tools Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Testing techniques and tools" Watch "Testing techniques and tools" New topic
Author

Testing techniques and tools

Dushyant Danveer
Ranch Hand

Joined: Jun 08, 2007
Posts: 31
Hello everyone,
I am fairly new to java coding so please bare with me....
I would like to know what are the steps and tools that should be used for testing medium sized applications(50-100 users):
1. A swing application with oracle as backend
2. J2EE based web application
3. Modifying an existing J2EE web application
I have been searching on the net and in this post but not able to find satisfactory result. I have got some insight in load balance testing, code review testing etc but where does all this fit in the testing lifecycle along with the missing pieces.
I am assuming that there must be umpteen number of techniques and tools available, but if you could provide some information based on your experience, it would really helpful.
Thanks in advance and regards.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30382
    
150

Dushyant,
Regardless of what else you choose, you want to unit test the logic with JUnit. You can also write integration/functional tests for your back end layer using JUnit or the Cactus extension.

For the web layer of a J2EE app, it depends on whether you want to test using a program like JWebUnit or through the browser like Selenium or a playback/record tool. For an existing J2EE app, start by adding tests to the code you are about to modify. I haven't done much with Swing, but I know there are tools. Abbot rings a bell.


[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
Dushyant Danveer
Ranch Hand

Joined: Jun 08, 2007
Posts: 31
Thanks for the reply Jeanne.It was really helpful and it cleared the path in in front of me...
Just summarizing from what I have gathered....
JUnit is very much required for testing, and before applying JUnit, Assertions testing and code review should be done.

For the web layer of a J2EE app, it depends on whether you want to test using a program like JWebUnit or through the browser like Selenium or a playback/record tool.

This means for the presentation layer we can use JWebUnit, I have read about Selenium in other posts so that part is clear.

Could you please elaborate this part, how can we add tests to the code:
For an existing J2EE app, start by adding tests to the code you are about to modify.

Also, one more question....
Is there a specific tool to be used for different kinds of frameworks such as Spring, Struts, Hibernate, to check the controller side or is it done by JWebUnit, Selenium kind of testing tools used for presentation layer testing.
Thanks & Regards.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
Is there a specific tool to be used for different kinds of frameworks such as Spring, Struts, Hibernate, to check the controller side or is it done by JWebUnit, Selenium kind of testing tools used for presentation layer testing.


You could use jWebUnit or Selenium to simulate though the GUI all actions that exercise the various parts of the code implemented with those libraries, but it gets tiresome at some point. The other option would be to test those classes independently of the web tier, possibly using some mock objects with JUnit instead of jWebUnit.


Ping & DNS - my free Android networking tools app
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30382
    
150

Originally posted by Dushyant Danveer:
JUnit is very much required for testing, and before applying JUnit, Assertions testing and code review should be done.[/i][/b]

JUnit can be done early. It can be done at the same time or even before the code.


Could you please elaborate this part, how can we add tests to the code:
For an existing J2EE app, start by adding tests to the code you are about to modify.

If you have to modify a method, you try to write tests that verify the existing behavior. This shows you didn't inadvertently break something.


Also, one more question....
Is there a specific tool to be used for different kinds of frameworks such as Spring, Struts, Hibernate, to check the controller side or is it done by JWebUnit, Selenium kind of testing tools used for presentation layer testing.

Some frameworks have extensions. I believe there is a StrutsUnit. I don't use it though. I mock out what I can. And the JWebUnit or Selenium tests verify my configuration.
 
jQuery in Action, 2nd edition
 
subject: Testing techniques and tools