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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:06:47+00:00 2026-05-26T07:06:47+00:00

I find that some forms of writing code lend themselves better to TDD than

  • 0

I find that some forms of writing code lend themselves better to TDD than others. Especially, red-green refactor testing.

In Red/Green refactor, I start with all my unit tests in place and failing (red). Then I implement my code until all test pass (green).

For example, if I have an interface that needs to be implemented 10-20x then I simply implement the interface in a class, which sets all methods to throw NotImplementedException. Then, create a test for each public method. From there, I just write the code to fix the tests.

Processes aren’t always so straight forward. For example, I’m writing a basic Excel parser. I’m not familiar with the Excel Interop API. I find it easier to simply write code. Then, through trial and error I discover my class design.

In this case I am writing some junk software. Prototyping it out just so I can figure out what my design needs to be. (Maybe I need to pass in a fileName here, maybe to this constructor…).

Ultimately, I would like to keep TDD. I do believe it keeps my code minimal and lean.

Does TDD work for prototyping? In other words, is there an approach I can follow so as to allow TDD to work for me even when I am not entirely sure where my design is going?

  • 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-26T07:06:47+00:00Added an answer on May 26, 2026 at 7:06 am

    Yes, but do it like an API. Instead of guessing how to do something with excel, decide what you want to do as an end result. (Example: Read Cells A0 to A100)

    Then as you go along with how it will work behind that interface, you will end up seeing what it is you can break off and test by itself, and possibly what might work better for the design. (Example: write code to read 0,0 to 0,100 and remove the letter code as it is more complex without any gain)

    Don’t be afraid of invalidating tests due to design/behavior changes, they are there to help, not be concrete. (Example: That original test to read cells A0 to A100 should be deleted)

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

Sidebar

Related Questions

I'm writing some code that highlights all <input type=radio /> within a radio group
On a regular basis I find myself writing little utility programs that use some
I'm writing some code that calculates certain statistics about word usages. Does anyone know
I'm writing some code to determine the name that an object is assigned to.
I just wanted to do some tutorials in WPF but I find that the
I didn't find any option for that, so I suspect that some views follow
I need to find some strings that the current version of Windows is using.
ok, i found some similar posts on stackoverflow, but I couldn't find any that
I want to find the centroid of each contour.for that i take some sample
Were can I find some good Podcasts that talk about program with Delphi &

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.