legacy-code

Will Windows 7 support the VB6 runtime?

吃可爱长大的小学妹 提交于 2019-11-27 13:03:30
问题 I can't seem to find a straight answer on this. It appears that Visual Studio 6 won't be supported, but I'm only concerned with the runtime. We have some legacy apps that we'd rather not rewrite, but our customers will expect them to run on Windows 7. If anyone can provide a link to something official from MS on the topic, that would be very helpful. 回答1: YES! Official support statement: The core Visual Basic 6.0 runtime will be supported for the full lifetime of Windows Vista, Windows Server

Dead code detection in PHP [closed]

可紊 提交于 2019-11-27 10:57:11
I have a project with very messy code - lots of duplication and dead code here and there. Some time ago there was zero code coverage by unit-tests but now we're trying to write all new code in T.D.D. manner and lowering technical debt by covering "old" code by unit-tests as well(test-last technique). Business logic's complexity is quite high and sometimes no one can answer whether some methods are used or not. How this dead code methods can be found? Extensive logging? Higher test coverage?(It is not very easy because customers want new features to come out) Ben James xdebug 's code coverage

Adding unit tests to legacy code [closed]

旧巷老猫 提交于 2019-11-27 10:31:14
Have you ever added unit tests, after the fact, to legacy code? How complicated was code and how difficult to stub and mock everything? Was the end result worthwhile? James Black The best way, I have found, is to incrementally add the unit tests, not to just jump in and say we will now unit test the application. So, if you are going to touch the code, for bug fixes or refactoring, then first write the unit tests. For bugs unit tests will help prove where the problem is, as you can duplicate it. If refactoring, you will want to write unit tests, but you may find that the test is impossible to

How to change method behaviour through reflection?

被刻印的时光 ゝ 提交于 2019-11-27 08:51:04
I have a a static method in some legacy code, which is called by multiple clients. I obviously have no options to override it, or change behaviour through dependency injection. I am not allowed to modify the existing class. What I want to do now is change the behaviour (that method - with the same signature and return type) using reflection. Is it possible ? If not, can any design pattern rescue me ? Thanks ! EDIT : There is some confusion on what can I change/modify. I cannot change any existing class/method - but I can add more classes to the project. The best I can do with the existing

Installation of VB6 on Windows 7 / 8 / 10 [duplicate]

对着背影说爱祢 提交于 2019-11-27 02:43:29
Possible Duplicate: Has anyone had success with Visual Studio 6 on Windows 7? Does the VB6 IDE run on Windows 7 64-bit? I have been having problems installing VB6 on Windows 7. I realize it is a legacy IDE and my research on the net hasn't been that much of help. Every time I attempt to install VB6 on Windows 7, besides the alert notifying me of compatibility issues, the setup runs and fails near the end, to which the installation process fails ultimately. And when another attempt is made, certain dll files are supposedly unreachable. These are but some of the few links I have visited in the

Redirect both cout and stdout to a string in C++ for Unit Testing

旧城冷巷雨未停 提交于 2019-11-26 22:22:42
问题 I'm working on getting some legacy code under unit tests and sometimes the only way to sense an existing program behavior is from the console output. I see lots of examples online for how to redirect stdout to another file in C++, but is there a way I can redirect it to an in-memory stream so my tests don't have to rely on the disk? I'd like to get anything that the legacy code sends to stdout into a std::string so I can easily .find on the output. Edit The legacy code is so bad that it users

Dead code detection in legacy C/C++ project [closed]

回眸只為那壹抹淺笑 提交于 2019-11-26 19:33:32
How would you go about dead code detection in C/C++ code? I have a pretty large code base to work with and at least 10-15% is dead code. Is there any Unix based tool to identify this areas? Some pieces of code still use a lot of preprocessor, can automated process handle that? You could use a code coverage analysis tool for this and look for unused spots in your code. A popular tool for the gcc toolchain is gcov, together with the graphical frontend lcov ( http://ltp.sourceforge.net/coverage/lcov.php ). If you use gcc, you can compile with gcov support, which is enabled by the '--coverage'

How to change method behaviour through reflection?

末鹿安然 提交于 2019-11-26 17:46:50
问题 I have a a static method in some legacy code, which is called by multiple clients. I obviously have no options to override it, or change behaviour through dependency injection. I am not allowed to modify the existing class. What I want to do now is change the behaviour (that method - with the same signature and return type) using reflection. Is it possible ? If not, can any design pattern rescue me ? Thanks ! EDIT : There is some confusion on what can I change/modify. I cannot change any

Adding unit tests to legacy code [closed]

泪湿孤枕 提交于 2019-11-26 15:13:07
问题 Have you ever added unit tests, after the fact, to legacy code? How complicated was code and how difficult to stub and mock everything? Was the end result worthwhile? 回答1: The best way, I have found, is to incrementally add the unit tests, not to just jump in and say we will now unit test the application. So, if you are going to touch the code, for bug fixes or refactoring, then first write the unit tests. For bugs unit tests will help prove where the problem is, as you can duplicate it. If

Implicit int return value of C function

◇◆丶佛笑我妖孽 提交于 2019-11-26 11:53:30
I've googled and just can't seem to find the answer to this simple question. Working on a legacy code base (ported to Linux recently, and slowly updating to a new compiler) and I see a lot of int myfunction(...) { // no return... } I know the implicit return TYPE of a function is int, but what is the implicit return VALUE when no return is specified. I've tested and gotten 0, but that's only with gcc. Is this compiler specific or is it standard defined to 0? EDIT: 12/2017 Adjusted accepted answer based upon it referencing a more recent version of the standard. Such a thing is possible, but