Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Anybody using developing their project and adding UNIT Tests?

 
Mark Waldrop
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jay Bromley
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i didnt use any UNIT test, i did all the testing by myself as a user.
 
Terry Martinson
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Terry Martinson
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay,
I did not submit my test code.
 
Terry Martinson
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jay Bromley
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic