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 6551813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:23:03+00:00 2026-05-25T12:23:03+00:00

I recently started learning test-driven development but I always see myself changing the design

  • 0

I recently started learning test-driven development but I always see myself changing the design of my class so that higher level class can access some more properties. (After changing design, my test cases will have to be rewritten too)

For example, I am practicing this by writing a MineSweeper program.
The MineFieldImp class has a width and a height property, but I didn’t expose this in the MineField interface I created earlier. But later on I find out I need this features, so adding these properties requires me to add public methods to this class as well as the interface it’s implementing.

I constantly see myself adding methods or fields to a class that I didn’t think of earlier.
What am I doing wrong? What should I do to improve?

Thanks,
Yang

  • 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-25T12:23:03+00:00Added an answer on May 25, 2026 at 12:23 pm

    You aren’t doing anything wrong. Class design is an constantly evolving process, its constantly changing. That’s the beauty of TDD and unit testing. As your design changes you have your unit tests to assure you that your re-factoring hasn’t broken anything.

    I’d highly suggest reading Fowler’s Refactoring book, there’s lots of great information in there, including many useful refactoring patterns and guidance on how to refactor. It will definately help you be more productive and help you produce better object oriented designs.

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

Sidebar

Related Questions

I've recently started learning Scala and was disappointed (but not surprised) that their generics
I have recently started learning C++, but I require a compiler. I have tried
I just recently started learning RoR and found that Prototype.js is a default javascript
I've recently started learning SWT (on class #4, to be precise) due to business
I recently started learning Java and found it very strange that every Java public
I recently started learning ruby, and I understood that you coud use code blocks
I've just recently started learning HTML/CSS and I've been trying to teach myself sound
I've recently started learning HLSL after deciding that I wanted better lighting than what
I just recently started learning Windows Phone 7 development, C# and Silverlight. I'm making
I've just recently started learning/using Ruby at work. I've got a super-simple test script

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.