File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Application Testing tools and tests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Application Testing tools and tests" Watch "Application Testing tools and tests" New topic

Application Testing tools and tests

David Winters Junior
Ranch Hand

Joined: Oct 30, 2007
Posts: 47
Hi All,

I was just wondering what others have used to test the actual final applications, what types of tests one has completed? obviously locking of course and the basic functionality here etc ....

Has anyone any recommendation in terms of resources to use for testing and what have other used here. Has anyone used junit or has any a good link to resources/test scripts one has used for testing?

Thanks in advance,
Jo�o Batista
Ranch Hand

Joined: May 25, 2008
Posts: 40
Hello there. You can create JUnit tests easily to test your database functionality (including regarding concurrency).
I don't have the links with me, but there are a few threads in this forum that show examples of tests. They are indeed helpful.
Jeffry Kristianto Yanuar
Ranch Hand

Joined: Oct 01, 2007
Posts: 759
there are a few threads in this forum that show examples of tests

Where is it? can you give the links?

Jeffry Kristianto Yanuar
SCJP 5.0
SCJD (Working on UrlyBird 1.3.2)
Jo�o Batista
Ranch Hand

Joined: May 25, 2008
Posts: 40
JUnit This one and this other one are starting points.

Please use the search engine for more information.
[ July 09, 2008: Message edited by: Jo�o Batista ]
sandeep Kumar
Ranch Hand

Joined: Sep 19, 2007
Posts: 41
Hello David,

You can use Junit for testing core functionality of the application.

I hope giving some focus on JUNIT testcases will be helpful.

Some of the good Practices of Junit:

1) A Junit should never test the APIs that are already existing.
Eg: If there is an EntityBean which persists some data into Database table, then there is no need to write JUNIT test case to test that EntityBean. Because JUNIT SHOULD TEST APPLICATION functionality. SUN may have already tested the methods of EntityBean for persistance. We do not have to again test those API

2) Avoid JUNIT test changing the Database. Even if for your functionality, some data needs to be changed in the Database, and you want to test it; a Junit test case may change the DB but later the changes are to be rolled back.

3) Try to avoid a Junit test case interacting with resources which deals with expensive operations.
Eg: while testing functionality related to FTP, while testing DB etc.
You can use mock objects(which does the dependency injection) to deal with these kind of situations.

4) "TEST FIRST CODE NEXT" . This is one of the most important points in Test Driven Development. If one follows this rule, one's code will be well organised and garnished.

1) If one uses JUNIT test cases, One would be confident of his/her functionality. It is a good practice to run all the JUNIT test cases before a developer does the checkin of the code so that his/her recent code would not break the already existing functionality.

Many more......

Finally every good thing will have a drawback.

Excessive use of Junits
1)Consumes a good amount of development time.Some times you feel, amount of time spent on writing test cases is more than your actual development.
2) Causes tight coupling with the code.

Hope this may help you

David Winters Junior
Ranch Hand

Joined: Oct 30, 2007
Posts: 47
Thanks for all the replies guys.

Much appreciated.

I agree. Here's the link:
subject: Application Testing tools and tests
jQuery in Action, 3rd edition