Mosh-Production's Blog

June 18, 2009

Test Driven Development

Filed under: Coding Horror — Mosh Productions @ 12:00 pm
Tags: , ,

Take this as a small summer “Treat” 🙂

Before we embark on a wonderful summer vacation, filled with fun exams (don’t forget to fill our survey in the previous post), let’s solve a small programming problem. Let’s say you have a method which you don’t know how it is implemented:


public daysInMonth(int year, int month); 

All you need to do write test cases for the method, like this:

i = daysInMonth(6, 2009); 

How many test cases will you write, consider the fact that the programmer might code this method according to your test (using TDD – Test Driven Development)? What scenarios will test you test? Will you check the method with several scenarios? Illegal input?

How will you decide? Write your opinion in the comments, and have fun with it!

I’ll publish our answer in this post later this week.



  1. […] Read the rest here: Test Driven Development […]

    Pingback by Test Driven Development | Python Developer India — July 10, 2009 @ 11:59 pm | Reply

  2. Dear Friend
    You are articles are nice and excellent concept. I would like to invite to newly launched .NET Programming website the on 1st of this June 2009. Currently CodeGain has more than 400 articles within the a month under the followings categories C#, VB.NET,ASP.NET,WPF,WCF,WFF,LINQ, AJAX, JQuery, JavaScript, Sql Servers , Oracle and more. To more list of categories visit the I have seen you are writing greatest article to web portal, I’m kindly asking you publish your article in also and support to grow the CodeGain share this with your friends also. I am expecting good response from you. You can contact me using

    Thank you

    Comment by RRaveen — July 3, 2009 @ 2:54 am | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at

%d bloggers like this: