File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes Effective Unit Testing - Couple of Questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Effective Unit Testing - Couple of Questions" Watch "Effective Unit Testing - Couple of Questions" New topic

Effective Unit Testing - Couple of Questions

Varun Chopra
Ranch Hand

Joined: Jul 10, 2008
Posts: 211
Hi Lasse Koskela and thanks for your book. I have 2 questions:

a) Does the book also discuss different frameworks available for unit testing and their comparison?
b) Does the book go into datastore side and to generate test data? For e.g. suppose there is method that receives certain rules and it goes to database and validates data against the rules. It returns objects containing data that meets the rules. How to generate minimum data in database for testing all rules (any coding techniques to generate data). Is these any example on this or am I talking about something too specific here?


-Varun -
(My Blog) - Online Certifications - Webner Solutions
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Hi Varun,

I'm afraid the answer would be no on both counts.

I've tried to focus on concepts that are applicable across test frameworks (and programming languages for the most part). Most examples use JUnit and there's a couple of appendices to introduce JUnit for those who are new to it. While I think they are a decent introduction to someone who's used another test framework before (perhaps with a different programming language), it certainly wasn't a primary goal to teach JUnit or compare it to alternative frameworks.

Regarding test data and databases, those topics have been largely cut out by the explicit focus on unit tests, isolated tests written for individual objects or small clusters of objects – tests that explicitly try to avoid hitting a database or any other external component that's not in the test's control.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Varun Chopra
Ranch Hand

Joined: Jul 10, 2008
Posts: 211
Thanks for reply Lasse. I understand the focus part. Best wishes.
I agree. Here's the link:
subject: Effective Unit Testing - Couple of Questions
It's not a secret anymore!