File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Some kind of test driven development for beginners ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Some kind of test driven development for beginners ?" Watch "Some kind of test driven development for beginners ?" New topic
Author

Some kind of test driven development for beginners ?

Andy Jack
Ranch Hand

Joined: Nov 22, 2012
Posts: 257
It seems that it is good to test one's code before coding (unit testing?) and after (?) finishing coding - unless you make elementary programs. I want to get into the habit of testing my code, not just with silly print statements but with all those frameworks and test cases those developers use.
Is it okay for beginners to think about testing using formal techniques or do it after gaining more experience in coding ? If yes, then where do I begin learning how to test my code formally ?


Java Newbie with 72% in OCJP/SCJP - Super Confused Jobless Programmer.
I am a "newbie" too. Please verify my answers before you accept them.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3097
    
  33

You can think of writing unit tests, may be start using some unit tests frameworks like JUnit, Mockito. I would recommend to read Test Driven Development book by Kent Beck as it shows you how to get started with TDD in simple ways.


Mohamed Sanaulla | My Blog
Andy Jack
Ranch Hand

Joined: Nov 22, 2012
Posts: 257
Mohamed Sanaulla wrote:You can think of writing unit tests, may be start using some unit tests frameworks like JUnit, Mockito. I would recommend to read Test Driven Development book by Kent Beck as it shows you how to get started with TDD in simple ways.


Thanks Mohammed. Is the TDD book based on Java ? I could not get sample pages for the book.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3097
    
  33

Andy Jack wrote:
Mohamed Sanaulla wrote:You can think of writing unit tests, may be start using some unit tests frameworks like JUnit, Mockito. I would recommend to read Test Driven Development book by Kent Beck as it shows you how to get started with TDD in simple ways.


Thanks Mohammed. Is the TDD book based on Java ? I could not get sample pages for the book.

You can preview the book from Google Books. yes the examples are in Java.
Andy Jack
Ranch Hand

Joined: Nov 22, 2012
Posts: 257
Mohamed Sanaulla wrote:
You can preview the book from Google Books. yes the examples are in Java.


Thanks for the link. This book was published in 2003, which is quite old. Would that be a problem if I try to use today's tools to learn testing ? If yes, then are there any other books like this
which were written more recently ?
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8427
    
  23

Andy Jack wrote:I want to get into the habit of testing my code, not just with silly print statements but with all those frameworks and test cases those developers use.

Whatever you decide (and there's been a lot of excellent advice), don't abandon those "silly print statements" altogether. While you're actually working on a complicated piece of code, they can be invaluable for making sure you've ironed out all the "silly errors", leaving your test suite to concentrate on business logic. Indeed, some of them may even end up in your test suite...

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

If you're looking for a book, I would recommend "Beginning Algorithms" by Simon Harris and James Ross. It gives a good grasp on Test Driven Development, and as a collateral damage you'll have a chance to learn more about Data Structures and Algorithms.


The quieter you are, the more you are able to hear.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Some kind of test driven development for beginners ?