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.

480 questions
3
votes
1 answer

Strategies for dealing with inflexible 3rd party libraries

I need help controlling the behavior of a couple of 3rd party libraries I am required to use in my application: DBLib, which is required for database access PropsLib, which is required by DBLib for configuration DBLib makes a lot of static-method…
3
votes
4 answers

Term for legacy bug replication?

Out of idle curiosity, does anybody know of a term for replicating bugs in a new implementation of an old system so as to maintain backwards compatibility with old clients that rely on the buggy functionality? I'd be particularly interested if it…
Dan Bryant
  • 27,329
  • 4
  • 56
  • 102
3
votes
2 answers

Python: __setattr__ for old-style classes?

How can I perform the equivalent of __setattr__ on an old-style class?
Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
3
votes
1 answer

Allow for variable to be used in local scope

I'm looking at a large legacy project where variables declared in for statements are used outside the scope. VS2013 doesn't like that and give compiler errors. How can I tell VStudio to allow that? for (CBookmarks::iterator it =…
jgauffin
  • 99,844
  • 45
  • 235
  • 372
3
votes
2 answers

How can I have c# and vb.net code behinds in the same ASP.NET Web Forms application?

I have inherited a vast web forms application that was auto generated from a classic asp site. This has left .aspx pages with code embedded into them (No separate codebehind) Some attempts have been made to modernise and so some pages exist with C#…
Loofer
  • 6,841
  • 9
  • 61
  • 102
3
votes
2 answers

Unit testing a 'legacy' WPF Application

The product I have been working on has been in development for the past six years. It started as a generic data entry portal into an insanely complex part WPF/part legacy application. The system has been developed for all these years without a…
sc_ray
  • 7,803
  • 11
  • 63
  • 100
3
votes
5 answers

Is there a way to translate C code to Ruby?

I'm sitting with massive amounts of legacy C code that needs to be converted to Ruby for a project. I've seen Ruby to C translators online, but not the other way around. Would there be a simple way to approach this particular problem?
EarlyPoster
  • 1,068
  • 1
  • 11
  • 27
3
votes
0 answers

How do I record and replay method calls in c#.net for isolation testing of legacy code

I have a repository and a consumer of that repository in some legacy code. The consumer makes multiple method calls to the repository. Each method call returns a huge resultset. I do have an integration test that checks how the consumer and…
perfectionist
  • 4,256
  • 1
  • 23
  • 34
3
votes
2 answers

Unit Testing Legacy Code without DI

We are trying to add unit testing into our Business layer. The technology stack is asp.net web forms, WCF, ADO.Net calling stored procedures). The business layer is calling static methods on data classes, so it makes it difficult to introduce DI…
3
votes
2 answers

How to run a legacy code inside a managed spring transaction?

Hi I have a legacy code which gets its jdbc connections through DataSource.getConnection() The DataSource is bounded to Jndi namespace., Suppose that I have a function which gets its connections like that: foo(){ ... Connection con =…
cgon
  • 1,955
  • 2
  • 23
  • 37
3
votes
2 answers

Is this how non-bulk binding PL/SQL code should be translated to bulk-binding code, and is there ever a reason to forgo buk binding?

(This is all Oracle 10g): CREATE OR REPLACE FUNCTION bar(...) IS v_first_type VARCHAR2(100) ; v_second_type VARCHAR2(100); CURSOR cur IS SELECT a,b FROM source_table ; v_a int; v_b char; BEGIN OPEN cur; <> --10G…
Matthew Moisen
  • 16,701
  • 27
  • 128
  • 231
3
votes
2 answers

How to "auto close" Alert boxes

We have a control that was made by a company that no longer exists. For some odd reason on page load it has now started rendering something like this to the page: Since…
War
  • 8,539
  • 4
  • 46
  • 98
3
votes
1 answer

Team Building Exercises to teach writing unit tests

I recently started working for a company with a very large legacy code base. Product is really good, and we have a large and happy customer base... but! The codebase is a mess. It is a mix of Classic ASP and .NET. There are hardly any unit tests,…
Jay Pete
  • 4,123
  • 4
  • 35
  • 51
3
votes
4 answers

Generics in java - interoperating with legacy code

I am reading this tutorial from Oracle http://docs.oracle.com/javase/tutorial/extra/generics/legacy.html But I can't figure out what this line means As a result, the type safety and integrity of the Java virtual machine are never at risk, even in…
Hải Phong
  • 5,094
  • 6
  • 31
  • 49
3
votes
3 answers

Finding un-referenced methods in a C++ app

We have a large C/C++ legacy source tree that has been around the block a few times. We expect there are a substantial number of methods no longer used. Is there a tool that can help us quickly identify the unused code?
JoeBieg