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.
79 questions
8
votes
4
answers
3k
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
3
answers
1k
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
2
answers
490
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
0
answers
74
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 ...
3
votes
1
answer
864
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
3
answers
2k
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
4
answers
778
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
3
answers
238
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
4
answers
4k
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 ...
19
votes
5
answers
15k
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
5
answers
6k
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 ...
28
votes
2
answers
3k
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 ...
2
votes
2
answers
659
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 ...
74
votes
10
answers
8k
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
3
answers
3k
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
1
answer
270
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
6
answers
4k
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
4
answers
2k
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
6
answers
2k
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
0
answers
50
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
4
answers
316
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. ...
13
votes
5
answers
2k
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 ...
351
votes
20
answers
80k
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 ...
4
votes
4
answers
2k
views
What can I do to maintain respect for a poorly written codebase? [duplicate]
In my job I have to maintain a poorly written codebase which is both hard to understand, has tons of comments that are just plain wrong, has a bunch of weird decisionmaking going on in it and a whole ...
4
votes
5
answers
492
views
Keep coding the wrong way to remain consistent? [duplicate]
Possible Duplicate:
Code maintenance: keeping a bad pattern when extending new code for being consistent, or not?
To keep things simple let's say I am responsible for maintaining two applications,...
5
votes
4
answers
288
views
Version control implementation advice on legacy websites?
Assuming no experience with version control systems, just local to live web development. I've been dropped in on a few legacy website projects, and want an easier and more robust way to be able to ...
14
votes
11
answers
13k
views
How to make Classic ASP interesting if you are stuck with it? [closed]
I used to work on a really small outsourcing company (4 programmers and the boss), then when the stress and the frequent long shifts made the situation unbearable I made the switch to a better paid ...
5
votes
9
answers
647
views
Have you worked with poorly designed application? [closed]
I have been asked to work in a Java web application that is very very poorly designed. In the name of "making this easy", they have come up with their own "framework" to make things extremely ...
7
votes
1
answer
730
views
Can Test-Driven development work in legacy projects?
So here is a question for you, having read some great answers to questions such as Test-Driven Development - Convince Me.
So my question is: "Can Test-Driven Development be used effectively on non-...