aspose file tools*
The moose likes Testing and the fly likes JUNIT how many hours need to learn it ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "JUNIT how many hours need to learn it ?" Watch "JUNIT how many hours need to learn it ?" New topic
Author

JUNIT how many hours need to learn it ?

Reza Ravasizadeh
Ranch Hand

Joined: Jun 08, 2004
Posts: 177
Is it neccessary for me to study JUNIT deeply, I think It is nothing more than some assert methods. now I study a book(JUnit recipes) but I think there is alot unnecessary explanation and it is possible to learn JUNIT within few hours.
what is your idea ? please let me know.
I also want to learn it because every job advertisment that I saw request for it and I find it an intersting way of testing but I don't know how important is to learn it deeply.


Reza
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

You can learn to use JUnit in a matter of minutes. To learn to use it well can literally take years. It's the same with many other things. Sure, you can study for the SCJP for 3 months and pass it, but that doesn't mean you know how to program well in Java.

"JUnit Recipes" is a great book. It contains years worth of hard-won experience. The problem is, though, that you can't truly appreciate this kind of book until you've had some experience using the tool and seen some of the problems and pitfalls that you can run into.


[Jess in Action][AskingGoodQuestions]
Reza Ravasizadeh
Ranch Hand

Joined: Jun 08, 2004
Posts: 177
OK so for my usage(just know it and don't need to work with it deep) I prefer to read my lovly "Thinking in java".
After I read 115 page of JUnit Recipes, I don't find anything about teardown() so I don't find it interesting book (from my point of view).

And what you said about SCJP you are right, being good programmer is not a 3 month study and certification I agree with you but I wish you don't mean that it is not valuable because it help me alot in my experience .

I also hope you don't mean I'm not good programmer because I ask you question about studying Junit don't need lots of time.

[ October 27, 2005: Message edited by: Reza Rawassizadeh ]
[ October 27, 2005: Message edited by: Reza Rawassizadeh ]
Reza Ravasizadeh
Ranch Hand

Joined: Jun 08, 2004
Posts: 177
I should be fair:
I get some good idea from reading that book till page 188
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Most of the book is a catalog of solutions to problems you *may* run into. It's not that much of a teaching book - you don't need to *learn* them all at once. It is a reference book - if you encounter a problem, look into the book to see whether it helps in finding the solution.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Reza Ravasizadeh
Ranch Hand

Joined: Jun 08, 2004
Posts: 177
YES you have right I'm worng, it is good book for reference and contain very usefull idea but not for tutorial
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

I didn't mean to imply that you're a bad programmmer -- I just wanted to make it clear that while you can learn JUnit in a day, you won't learn to use it well without a lot of experience.
Siva Jag
Greenhorn

Joined: Oct 29, 2005
Posts: 3
Yes Reza, Ernest is right.

Everyone who starts unit testing are more worried about testing frameworks (JUnit , Dbunit , xUnit etc) rather than the philosophy behind testing.


Rgds,<br /> <br />--Siva Jagadeesan<br />http://bizdriven.blogspot.com/
Harald Kirsch
Ranch Hand

Joined: Oct 14, 2005
Posts: 37
Don't forget to combine code coverage analysis with your unit testing. I am always very surprised when I see the first coverage results for my tests. Often I could delete 30% of the code and the tests would still just run fine.


Harald.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Harald Kirsch:
Don't forget to combine code coverage analysis with your unit testing. I am always very surprised when I see the first coverage results for my tests. Often I could delete 30% of the code and the tests would still just run fine.


I assume you don't do test driven development?
Harald Kirsch
Ranch Hand

Joined: Oct 14, 2005
Posts: 37
Originally posted by Ilja Preuss:


I assume you don't do test driven development?


Just checked quickly over at wikipedia to make sure this buzzword is what it sounds like it is, and indeed it is. Consequently my answer to your question is "yes".
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Harald Kirsch:

Just checked quickly over at wikipedia to make sure this buzzword is what it sounds like it is, and indeed it is. Consequently my answer to your question is "yes".


You should try it some time, it's a fun way to work!

In my experience, code coverage still is insteresting to take a look at from time to time with TDD, especially when you are at the beginning of learning it, but it becomes much less surprising.
Adam Richards
Ranch Hand

Joined: Nov 03, 2005
Posts: 133
Don't know know if this will be helpful, but here's an extract from a build file showing how I use Junit:
J. B. Rainsberger
author
Ranch Hand

Joined: Aug 05, 2004
Posts: 87
Originally posted by Reza Rawassizadeh:
OK so for my usage(just know it and don't need to work with it deep) I prefer to read my lovly "Thinking in java".
After I read 115 page of JUnit Recipes, I don't find anything about teardown() so I don't find it interesting book (from my point of view).


This is by far the strangest complaint I've seen so far about the book. Reza, if you are specifically interested in tearDown(), then did you look in the index to see where I use tearDown()?

You might also consider that if I don't talk about tearDown() in the first 115 pages, then perhaps it's because I don't use tearDown() very much at all.


Author of <a href="http://www.amazon.com/exec/obidos/ASIN/1932394230/ref=jranch-20" target="_blank" rel="nofollow">JUnit Recipes: Practical Methods for Programmer Testing</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JUNIT how many hours need to learn it ?
 
Similar Threads
passed SCBCD with 94% today :-)
Passed Part 1 - 91%
Need Encouragement!!
Need Help ?
scjp6