Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6965735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:05:59+00:00 2026-05-27T16:05:59+00:00

I am trying a little TDD for the first time. I started with absolutely

  • 0

I am trying a little TDD for the first time. I started with absolutely nothing and wrote some tests for a self written Date library.

I want to be able to do for example:

MyDate m = new MyDate(1,1,2012);

and assert that

m.equals(new MyDate(2,1,2012)) is false.

Now with only these two items, I could write a constructor that simply doesn’t do anything but still fulfills “being able to call the constructor with three ints to construct a date”. And I could write an equals method that always returns false.

So far, I haven’t written any attributes, although I’m preeeetty sure I want to have at least three of them, corresponding with the arguments of the constructor. Should I go on writing a test and then ‘discover’ these attributes as I go on? Or am I pushing it too hard and should I just write a basic class with the attributes I already know are needed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:06:00+00:00Added an answer on May 27, 2026 at 4:06 pm

    if you want to learn TDD well, I suggest you to do it by the book. Write a little test, see it fail, make it pass, remove duplication, repeat. Even before this, you should write a little list of all the tests that you think you will need to write. This is the kind of “thinking ahead” that works well with TDD. You will come back to this list to cross off the tests that you made pass, and to add new tests that occur to you while you work.

    I suggest you not to try variations on this process before you have learned it 🙂

    Your little test is good enough; you must make it fail first by writing an equals method that returns true. Then you make it pass, then you write anther test that proves that two dates can be equal if they have the same attributes. It will take you only a few minutes.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

well,I wrote a little snappet trying to know how to use python threading .
trying to get my first little PHP script to connect to a local mySql
I was looking at some Cappuccino code (trying learn a little bit of it)
I started trying to learn tdd and wanted to use it on a real
I'm trying a little concept test to change one of the features of the
I am trying out a little reflection and have a question on how the
I'm going a little nuts trying to understand the doc on impersonation and delegation
I'm going a little nuts trying to figure out how to use template inheritance
After trying my hand at Perl and a little bit of C, I am
I'm trying to enter a little bit of HTML into an ASP.NET Dynamic Data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.