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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:04:42+00:00 2026-05-26T21:04:42+00:00

I am beginning to adopt Test Driven Design (TDD) behaviors and workflow for my

  • 0

I am beginning to adopt Test Driven Design (TDD) behaviors and workflow for my iOS development projects. There is at least one impediment though in the context of legacy software. I will often have to add features to a pre-existing code base that I am new to. I will typically want to refactor at the beginning of working with the code base which will often have no tests available to ensure that my refactor-ings are not altering code functionality or worse, adding bugs.

My question is how do TDD folks bootstrap the whole process when the code is not written from scratch but rather legacy code that they are brought in to work on?

Thanks,
Doug

UPDATE

For a concrete example, I am using the example from Martin Fowler’s Refactoring re-coded in Objective-C as a training device for TDD (and AppCode) >>

I built the code from tests. I found I needed to add instance variables to the Customer class to ensure I didn’t screw up the cost calculations in the statement method as I grew the code. This is the fundamental issue I need insight into.

  • 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-26T21:04:43+00:00Added an answer on May 26, 2026 at 9:04 pm

    To begin with, if you don’t understand the legacy code you’re working with, you need to fix that before you do things which you’re concerned may change behavior.

    In your situation, after understanding the legacy code, I would write tests that will run against that legacy code. Once you’re satisfied that these tests function as you expect, you’re in a much better position to test your refactored code to ensure it functions as the old code did.

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

Sidebar

Related Questions

Just beginning iOS development and I am getting a crash on creating an UITabBarController
I am beginning to play around with ARC, and one of the first experiements
Just beginning with iPhone development i seem to miss something fundamental. In a View
We're beginning to design a whole bunch of new services to create (WCF, ADO.NET
Since the beginning I always hat this one problem with rails, short urls without
Many beginning programmers write code like this: sub copy_file ($$) { my $from =
When beginning a new web project, i'm always a bit worried about removing pieces
Since beginning to use VB.NET some years ago I have become slowly familiar with
I'm just beginning to have a look at Objective-C and Cocoa with a view
At the beginning of all my executable Python scripts I put the shebang line:

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.