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.
Questions tagged [legacy-code]
480 questions
5
votes
4 answers
Where to keep dictionaries in app using Dependency Injection
I have a legacy code, and I have a problem with reconstructor it.
At start of my application I load from WCF to property on App (this is SL application) list of users.
Then every control (for sending emails, view calendar and assigning tasks) use…

user278618
- 19,306
- 42
- 126
- 196
5
votes
5 answers
Best Option for Retrospective application of TDD into C# codebase
I have an existing framework consisting of 5 C# libraries, the framework is well used since 2006 and is the main code base to the majority of my projects. My company wishes to roll out TDD for reasons of software quality; having worked through many…

Paul
- 1,483
- 14
- 32
5
votes
1 answer
How to design a set of file readers and writers for different format
Digging into a legacy project (C++) that needs to be extended, I realized that there are about 40 reader/writer/parser classes. They are used to read and write various type of data (different objects) in different files format (binary, hdf5, xml,…

Barth
- 15,135
- 20
- 70
- 105
5
votes
5 answers
Suggest a simple ORM on .NET - design for maintaining legacy apps
I am assigned to maintain a bunch of legacy apps with heavy stored procedure usage built before '05 when there was no ORM. The developers who work with me don't know Entity Framework nor LINQ and are not eager to learn.
Is there any ORM on .NET that…

kakarukeys
- 21,481
- 10
- 35
- 48
5
votes
1 answer
Preventing COM Name Mangling
I am trying to write a replacement for a VB6 dll that is referenced by another VB6 in c#.net.
For now we can only work on the later and I am having some success with this. Except I have run into a problem.
My Enums are being mangling resulting it…

Jon H
- 71
- 2
5
votes
1 answer
How to cover a C++ legacy code controlled by preprocessor #ifdefs with unittests?
I have inherited a not too big C++ legacy code which I am currently reengineering. So far I understand most of the code quite well and am able to use it, though the maintenance is hell. I think the main difficulty lies in the MASSIVE use of…

user92020
- 113
- 1
- 7
5
votes
2 answers
Unusual use of new in historical code. What does it mean?
I am just porting some old code:
#define NewArrayOnHeap(TYPE, COUNT, HEAP, NEWPTR, ERROR) \
((*(NEWPTR) = new ( #TYPE "[" #COUNT "]", __alignof(TYPE), (HEAP), &hr, (ERROR)) TYPE[COUNT] ), hr)
It looks like the original was supposed to define their…

Martin York
- 257,169
- 86
- 333
- 562
5
votes
1 answer
What's the equivalent in Delphi 3 of Supports for Interfaces?
I support an application written in Delphi 3 and I would like to put in some improvements to the source code while waiting for the opportunity to upgrade it to a newer version of Delphi. One of the things I would like to use is Interfaces. I know…

Omen
- 88
- 1
- 4
5
votes
0 answers
Iterator for void pointer ranges quirks and oddities or how not to shoot your self in the foot
In the old days (when C was the predominant language under the hood and STL/templates were Alex Stepanov's dream), in order for programmers to achieve generality for functions and data-containers, the void* was used as the input argument (for…

101010
- 41,839
- 11
- 94
- 168
5
votes
2 answers
UnitTesting a class that returns a complex dataset
After months of frustration and of time spent in inserting needles in voodoo dolls of previous developers I decided that it is better try to refactor the legacy code.
I already ordered Micheal Feather's book, I am into Fowler's refactoring and I…

UnDiUdin
- 14,924
- 39
- 151
- 249
5
votes
1 answer
What is the 'old style' syntax for joins in T-Sql?
I'm rewriting a bunch of old, badly written Oracle queries against a new(-er) Sql Server 2008 environment. They use old-school Oracle join syntax like
select
from Table1, Table2, Table3
where Table1.T1ID = Table2.T2ID -- old Oracle…

Kai
- 2,050
- 8
- 28
- 46
5
votes
4 answers
What's the best way to upgrade from jquery 1.3 to 1.4?
I'm trying to decide if upgrading is viable given all the libraries we are using. The problem is some of these plugins arent being developed anymore so I'm not sure which of them is compatible with 1.4
Any thoughts on how to best approach this…

qodeninja
- 10,946
- 30
- 98
- 152
5
votes
1 answer
__attribute__() macro and its effect on Visual Studio 2010 based projects
I have some legacy code that has got conditional preprocessing e.g. #ifdef and #else where I have found the use of __attribute__ macro. I have done a quick research and found out that it is specific to GNU compilers. I have to use this legacy code…

ha9u63a7
- 6,233
- 16
- 73
- 108
5
votes
4 answers
View the members of a C++ DLL
I have a C++ DLL which was written in 1998, and I want to view the members (properties, fields, methods, constructors etc). I am of the understanding that the company who wrote the DLL is no longer about, but it is still used.
If I have only the…

JMK
- 27,273
- 52
- 163
- 280
5
votes
2 answers
How to go about organizing a unit test harness for legacy Visual C++ code?
I have a Visual Studio 2005 C++ project, it is a console application.
I want to start getting bits of the code under a test harness but I've run into some issues that I don't know how to best handle.
I don't want most of my testing code to end up in…

thelsdj
- 9,034
- 10
- 45
- 58