wood burning stoves*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Anybody using developing their project  and adding UNIT 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 "Anybody using developing their project  and adding UNIT Tests?" Watch "Anybody using developing their project  and adding UNIT Tests?" New topic
Author

Anybody using developing their project and adding UNIT Tests?

Mark Waldrop
Greenhorn

Joined: Jan 04, 2004
Posts: 9
I was curious, if anybody was creating UNIT tests for their application as they were developing it (i.e. JUnit TestCases)?
If so, did you find it beneficial for your SCJD project?
Ken Krebs
Ranch Hand

Joined: Nov 27, 2002
Posts: 451
I did create unit tests for my key classes and was very glad I did as it allowed me to improve my design and coding by refactoring it over and over again with confidence that I hadn't broken anything in the process.
Speaking about JUnit:
"Never in the field of software development was so much owed by so many to so few lines of code" - Martin Fowler
This is so true.


kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
Jay Bromley
Ranch Hand

Joined: Aug 09, 2003
Posts: 48
Mark,
I too am using JUnit and a couple of custom classes to do unit tests. It's really good for peace of mind. Like Ken said, you can change something, even radically, then retest it. If it still works you're all good.
One question for Ken: Did you include your test classes in your uploaded project? I'm not intending to do this, does that sound ok?
Regards,
jb
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1297
i didnt use any UNIT test, i did all the testing by myself as a user.


BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Terry Martinson
Ranch Hand

Joined: Oct 18, 2003
Posts: 293
I have a custom class to do the testing of my Data class methods. JUnit would probably have been better, but the custom class works fine for me. I also do manual user testing of the application in both network and standalone modes.
The custom class test is a lifesaver though.
TJ


SCJP, SCJD, SCWCD, SCBCD
Terry Martinson
Ranch Hand

Joined: Oct 18, 2003
Posts: 293
Billy -
Did you do any type of multithreaded test as a unit test?
Or just the manual testing you mention above?
I know you passed recently, so I was just wondering.
TJ
Ken Krebs
Ranch Hand

Joined: Nov 27, 2002
Posts: 451
Jay,
I did not submit my test code.
Terry Martinson
Ranch Hand

Joined: Oct 18, 2003
Posts: 293
Ken -
Did you do a multithreaded unit test to pound the data manipulation methods?
Just curious - I have a question posted out here at this url and it's not getting any response.
I would love to hear your 2 cents worth.
TJ
Ken Krebs
Ranch Hand

Joined: Nov 27, 2002
Posts: 451
TJ,
I did write a multithreading test but it wasn't a JUnit test.
[ January 22, 2004: Message edited by: Ken Krebs ]
Roel De Meester
Greenhorn

Joined: Dec 22, 2003
Posts: 10
I'm using junit and junitperf. I've copied the junitperf loadTest from some other thread in this forum.
My unit testcase which can run on it's own (AND is succesfull in both tests)

The performance tests which starts 50 clients at the same time and does a 1 time only setup/teardown. WithLock->succes | WithoutLock->fails (as expected)

[ January 22, 2004: Message edited by: Roel De Meester ]
Dixon Alexander
Ranch Hand

Joined: Jan 16, 2004
Posts: 48
Originally posted by Jay Bromley:
Mark,
I too am using JUnit and a couple of custom classes to do unit tests. It's really good for peace of mind. Like Ken said, you can change something, even radically, then retest it. If it still works you're all good.
One question for Ken: Did you include your test classes in your uploaded project? I'm not intending to do this, does that sound ok?
Regards,
jb

Jay do no include Testing in your code I've been reading about JUnit and "JUnit In Action" says that you should just use JUnit testing for your internal testing needs, kind of like to simulate the actual customer of your product.
Hope this helps.


SJCP 1.4<br /> <br />"Go in there and do the best you can. That's all you can do."<br />Tiger Woods<br /> <br />"Practice is the best of all instructors."<br />Publilius Syrus (b. 42 AD)
Jay Bromley
Ranch Hand

Joined: Aug 09, 2003
Posts: 48
Ken and Dev,
THanks for confirming my suspicions about not submitting test code. I didn't want to do so, because my test code is not as "pretty" as the Sun Coding Conventions might want them to be, but I wasn't sure if the grader might be interested in them.
Thanks and regards,
jb
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Anybody using developing their project and adding UNIT Tests?
 
Similar Threads
What kind of methods and classes can i test with JUnit
TDD: Feasible to handle?
Project Structure
Static members and testability
passed....! the big "thank you Andrew Monkhouse" thread