Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Effective Unit Testing - Couple of Questions

 
Varun Chopra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Regards

 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Varun Chopra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply Lasse. I understand the focus part. Best wishes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic