Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [legacy-code]

Originally legacy code meant code 'inherited' from authors or from a previous program/system version. Since Michael Feathers published his "Working Effectively with Legacy Code" book, new definition came to be, where code without tests is legacy code.

1
vote
0answers
28 views

How do I migrate part of a business process to DDD?

I am quite new to DDD, but I am currently working on a system which has a payroll element to it. I have a requirement to send payslips to an external system when they are created. Currently the ...
1
vote
0answers
43 views

How to annotate a codebase as you're learning it? [duplicate]

When I first a codebase, I frequently take notes about it, as this SO answer suggests. If some code chunk is small enough, I copy-paste to Word, print it out, and make hand-written annotation. If the ...
3
votes
2answers
173 views

Variable renaming throughout solution will produce lots of noise in git blame. What to do?

I inherited 1 million lines of C++ legacy code. Throughout the code variables like bCPCHAR bPCHAR, bCPDOUBLE and bPINT are used. They are defined like this: bCPCHAR: const char * bPCHAR: char * ...
8
votes
7answers
1k views

How to deal with a large codebase with no requirements and the responsible person leaving the company soon [duplicate]

i am faced with the following scenario and i wonder if you guys have some tips for me on how to approach this. One of my colleagues is going to leave the company in a few month and i am ordered to ...
0
votes
1answer
107 views

How to prepare test case for System Migration of legacy system while existing functionality is unclear?

I am migrating a legacy system from Oracle Form to Web Application. The migration is conducted with code study and interview. As the requirement is to migrate the existing system to Web application ...
4
votes
2answers
246 views

How to approach this legacy Java project? [duplicate]

Edit: Assume that I will stay on this project until "the end". The Problem I'm currently working on a legacy interesting Java project(s).  A full rewrite is currently out of the question, as I am ...
1
vote
3answers
168 views

Follow Up: Legacy code maintenance and moving forward (implementing previous answers)

Overview This is a follow up to my previous question that was flagged as a duplicate, and I do not know what would work better as the title. Here is a link to the previous question: Legacy code: ...
1
vote
3answers
435 views

Legacy code: what to do in regards to maintenance and moving forward? [duplicate]

I am currently working on an application with legacy code that was built using proof of concepts (POCs). These POCs became the finished production-ready code, there were no tests, and the classes have ...
2
votes
2answers
92 views

Make sense out of automatic information gathered from legacy system

I have a legacy system I need to plan a migration for. It's mainly developed in Ingres+4GL (an old Ingres based form system). I have the following information: Data Structures (data base relations ...
2
votes
8answers
754 views

Refactoring for loop (clean code aspect)

I have to refactor a "for" loop which iterates over an array and does two independent things with the array element. For example: doThisOrOtherStuff(array) { for(int i=0; i<array.length; i++) { ...
1
vote
2answers
526 views

How to approach the understanding, documentation and validation of legacy code [duplicate]

I've been tasked with studying a Python code, which runs on an orchestrator, which schedule the launch of the code in correspondence of some events. The code imports some modules, and it's basically ...
2
votes
1answer
147 views

Gap between Code base and Production application

Background I joined a company as a solutions architect less than a year ago, with a main task of consolidating, and modernizing legacy code resulting from 90+ company acquisitions over the past 20+ ...
3
votes
4answers
480 views

Unit testing Systems with Logic Tightly Coupled with Data

I understand there are many questions in this site revolving around the same concept, but I could not get a precise answer for my case. Problem I am handling an ERP System, with code base in both: ...
5
votes
4answers
406 views

What is the antonym to “legacy code”? [closed]

I am writing a software documentation and I need a antonym to "legacy code". Is there any established word for the antonym to "legacy code"? I'll need this antonym to describe that code which was ...
-2
votes
2answers
147 views

What changes are needed to run a 32 bit software on a 64 bit system? [closed]

If I have software written in C for 32 bit system, what changes do I need to make in it to run it on a 64 bit system?
0
votes
1answer
384 views

Apply latest methods and practices in highly sophisticated legacy application

Currently I am working on a health related application which was being developed for 5 years and lot of developers have contributed in it. The application is quite complex and highly used by lot of ...
1
vote
3answers
2k views

Factory method for objects with multiple complex constructors

I'm refactoring a legacy codebase. I have 4 very similar objects that I decided would be a good target for becoming polymorphic, so I moved all the common code to a base class and added an interface. ...
4
votes
2answers
163 views

Is there a methodology for switching large code base to be interfaced-based instead of direct class access?

Our organization codebase is used by various teams. Over the years, the code has evolved and grown without much usage of interfaces. We would like to change that, to reduce chance of breaking changes. ...
0
votes
3answers
260 views

Bug Fixing Code With No Tests

I am regularly given code with bugs in it and told to fix the bugs without introducing any more. My approach is usually as follows: Identify the bug's issue, e.g. method is returning an empty list ...
86
votes
9answers
10k views

Estimating time costs in legacy codebase

Recently I started working on a project where a very old monolithic application is being migrated into microservice-based architecture. The legacy codebase is very messy ('spaghetti code') and often ...
28
votes
8answers
5k views

How to argue against lowering quality standards for legacy codebase? [closed]

We have here a large legacy code base with bad code you can't imagine. We defined now some quality standards and want to get those fulfilled in either completely new codebase, but also if you touch ...
5
votes
2answers
182 views

How do I know when to refactor global database query calls, and when to leave them alone?

I have the following global statement calls sprinkled throughout my PHP legacy codebase: $jobnumber = db_quick($sql); db_query($sql); That is, those function calls have been initialized in the ...
0
votes
1answer
426 views

How to go about upgrading spaghetti code? Is it worth it? [duplicate]

I'm working on medium sized ASP.NET MVC 4 web app, that is about 2.5 years old. Around 25-30k lines of code. The project has never followed any of the good .NET design practices. It is a very tightly ...
3
votes
1answer
161 views

Doesn't Jmockit make a lot of techniques mentioned in “Working Effectively with Legacy Code” redundant?

I'm currently reading "Working Effectively with Legacy Code" by Michael Feathers. So far, a lot of techniques the book mentions, start with a problem similar to: "it's really difficult / it would ...
5
votes
3answers
417 views

How do you deal with legacy data integrity issues when rewriting software?

I am working on a project which is a rewrite of an existing legacy software. The legacy software primarily consists of CRUD operations (create, read, update, delete) on an SQL database. Despite the ...
22
votes
8answers
3k views

How to deal with tremendous number of failing tests? [closed]

I'm working in the development of an old project written in Java. We have more than 10 million LOC and, even worse, more than 4000 functional tests. The tests, scheduled by Hudson, are failing like ...
5
votes
2answers
131 views

When designing a replacement application, how can I compare its performance to the original, if there are no existing statistics?

I don't believe there are any performance statistics kept for the application I'm being asked to replace, and don't want to ask the individuals doing the work to manually record things like how long ...
8
votes
4answers
2k views

Best way to analyse a large class before refactoring it into smaller classes?

Foreword I'm not looking for a way to refactor a large spaghetti code class, that topic has been covered in other questions. Question I'm looking for techniques to begin to understand a class file ...
5
votes
3answers
859 views

How to solve the Lava flow anti-pattern?

In this blog post, the author describes an anti-pattern called the "lava flow" In a nutshell, the lava flow anti-pattern happens when many programmers lead the development of an application, each of ...
0
votes
2answers
311 views

How to add cases to large legacy code base project? [duplicate]

There is a legacy project full of C++ code. As a MFC GUI project, it contains lots of businesses logic out of control and beyond average level programmer to understand. To work on such GUI project, is ...
1
vote
0answers
70 views

Is this pattern of optional dependency injection sound? [duplicate]

A lot of the time when working on legacy code bases, I find it hard to move manually created dependencies to the constructor parameters, because of a variety of reasons. Sometimes it's because the ...
2
votes
1answer
591 views

Help Improve DB model/strategy, for use in refactoring SQL-ridden legacy code

Question: Which design pattern do I use to help me refactor legacy SQL code into separate classes? Goal Bring in concepts of data separation and database separation and also latest modern ...
2
votes
3answers
1k views

Refactoring web pages with user controls

Is it good design to use many user controls to help refactor a web application? In my case, it's a VB.NET Webforms ASP.NET website. All our pages are organized into sections that, while related and ...
2
votes
4answers
424 views

How to refactor a myriad of similar classes

I'm faced with similar classes A1, A2, ..., A100. Believe it or not but yeah, there are roughly hundred classes that almost look the same. None of these classes are unit tested (of course ;-) ). Each ...
1
vote
3answers
207 views

Can I refactor “safely” without specs? [duplicate]

I have inherited a legacy web application many years which: Does not make use of Object Oriented principles, even though the language would permit it Has no unit tests, nor any sort of test suite, ...
28
votes
4answers
3k views

What is the origin of the negative term “legacy code”

Everyone talks about legacy code in software development and I have heard the term over the last ten years used to paint any codebase as being bad. Where did this term, which has such powerful ...
10
votes
4answers
5k views

How to avoid excessive method overloading?

We have quite a lot of places in the source code of our application , where one class has many methods with same names and different parameters. Those methods always have all the parameters of a '...
15
votes
5answers
5k views

Why write tests for code that I will refactor?

I am refactoring a huge legacy code class. Refactoring (I presume) advocates this: write tests for the legacy class refactor the heck out of the class Problem: once I refactor the class, my tests ...
27
votes
2answers
2k views

Is there a named anti pattern for historically grown software? [closed]

Is there an anti pattern that describes a historically grown software system where multiple developers just added new features to the system but no one really kept an eye on the overall architecture ...
3
votes
2answers
529 views

Testing a very specific function in a large, complex application

I'm new to testing but wholeheartedly realize how important it is. The main issue is that my company has no top-down support for testing at all. That is we don't have any unit testing and just a bit ...
72
votes
10answers
7k views

Does it make sense to write tests for legacy code when there is no time for a complete refactoring?

I usually try to follow the advice of the book Working Effectively with Legacy Code. I break dependencies, move parts of the code to @VisibleForTesting public static methods and to new classes to make ...
3
votes
3answers
2k views

Effective way to estimate dead code removal?

I've been working in an application with about 100k LOCs and basically We have been reworking features to comply with a new architecture based on a new technology stack. This work is almost finished ...
2
votes
1answer
255 views

How to find classes that use certain DB tables

Problem: I'm asked to prepare a document where all our DB tables are listed and I'm supposed to list all Controllers that uses these DB tables for read and another list for Controllers that do write ...
18
votes
6answers
2k views

Does dealing with legacy code help one evolve as a programmer? [closed]

I'm a Java developer with a bit more than a year of experience which places me somewhere above a junior, but not among mid-level developers yet. Recently I was offered a long-term project which is ...
9
votes
4answers
1k views

I have 200k lines of poorly designed code, will units tests or integration tests be more valuable? [duplicate]

I've inherited a lot of poorly designed code; the code has no tests. I am putting tests in place before I attempt a major refactor, but I have run into a problem with my unit tests. The problem is, I ...
7
votes
6answers
1k views

Painfully Stupid Method Names in Legacy Code: Fix or Leave as Warning? [duplicate]

For this case let's assume something like... "removedNonPriceChangingConfermations" that is in no way relating to things that happened in the past tense, nor does it return a list of removed items (...
3
votes
0answers
47 views

How to document legacy code (shell scripts)? [duplicate]

I got involved into a project where we are taking over a bunch of legacy code. Code is basically shell scripts and PL/SQL packages/procedures/functions. There is no documentation how the code works ...
1
vote
4answers
286 views

How Much Of A (Broken) Legacy Framework To Keep [duplicate]

I've inherited a hosted system (system "A") which can be used to manage products, inventory, and orders, and can send those products to various third-parties. Quite simply, system "A" doesn't work. ...
14
votes
5answers
1k views

What to do as a Dev when for years their team has lacked product innovation, not used project mgmt methodologies, and kept bad Software Dev practices? [closed]

I am interested in knowing how to deal with a current software development process that has not been changed for years and will eventually lead to product and team failure. Yes, probably the easier ...
325
votes
20answers
71k views

How should I behave as a developer in a project that's headed for failure?

I am a developer in a 5-member team and I believe our project is headed for disaster. I'll describe why in a moment, but my question is: how should I behave? The deadline is in 1.5 months, and I ...