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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:05:24+00:00 2026-05-12T17:05:24+00:00

I appreciate TDD and think it indispensable but always write my tests ONLY after

  • 0

I appreciate TDD and think it indispensable but always write my tests ONLY after I write my source code then refactor accordingly. I can never bring myself to write the test first then the source to pass the test. So I always reverse the process. Is this a bad practice on my part? What are the disadvantages of doing it in reverse like me?

  • 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-12T17:05:24+00:00Added an answer on May 12, 2026 at 5:05 pm

    If you don’t write your tests first then it’s arguably not TDD. With TDD you normally write the test, watch it fail, then implement to make it pass.

    The advantages over your workflow are:

    • Your tests can fail! It’s all too easy to create a test that simply cannot fail. And as Eric points out, if you don’t write the test first, and watch it fail, how do you know the test is actually testing the functionality you just implemented?
    • Your code is definately testable. Although I’m sure you follow testable techniques, test first development ensures that the code is definately testable as otherwise you wouldn’t have written the code 🙂
    • Turns your solutions “upside-down”. Debatable one this but TDD makes you think about “what you need” rather than “implementation details”. By producing tests first you piece together your general architecture/class structure in your tests, then you get onto the implementation details.

    You can mitigate the risks of all of those points, so it’s down to you whether you want to keep going the way you are or switch to test first.

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

Sidebar

Related Questions

I appreciate I'm probably missing something basic here, but... My iPad app will only
I appreciate this is an incredibly noob question, but having Googled multiple combinations of
I appreciate that similar questions have been asked before, but I am struggling to
I know how to do TDD in other languages, but I'm new to both
I appreciate this is an amateurish question but I am not used to VB
would appreciate some brainstorming help for one of my assignments. I am to write
EDIT Appreciate all the inputs guys. Opinions were very welcome, I think we'll go
Appreciate some insight given the following code: <script type=text/javascript> $(document).ready(function() { var soapEnv =
I appreciate this question may get closed due to its open-ended nature, but I'm
I appreciate that this may appear to many as a dum question but I

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.