Bestpractice方法与域的知识进行逆向工程VB6代码 [英] Bestpractice approaches for reverse engineering VB6 code with out knowledge of the domain

查看:148
本文介绍了Bestpractice方法与域的知识进行逆向工程VB6代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目标状态:移植VB6代码到C#,进行同参与所有可以想象的过程,整个项目

target state: Porting VB6 Code into C#, undertake the whole project with all conceivable processes that are involved.

将是你的方法是什么,如果你没有知识关于域

What would be your approach if you do not have knowledge about the domain?

有几乎任何文件,只是遗留代码?(高达100.000 - 300.000行代码和注释包含多达14.000行代码VB6文件) 。写在VB6

There is nearly any documentation, just legacy code (up to 100.000 - 300.000 lines of code and comments vb6 files that contain up to 14.000 lines of code) written in VB6.

推荐答案

免责声明:我的大迁徙工作

Disclaimer: I work for Great Migrations

我们改写为生活大VB6 / ASP / COM应用程序到.NET(主要是C#),我们已经开发了一个软件分析和再造工具来帮助我们做到这一点。这个工具基本上像一个VB6 / ASP / COM编译器和反编译器,作者的.NET代码。当然,因为VB6的平台是.NET很大的不同,直接编译/反编译是不可取的或可行的,所以我们的工具,具有实现各种代码再造算法来处理VB6,C#不兼容的分析。还有一个可编程的作者,允许迁移团队规定的规则设置.NET代码文件,重组的代码,做这样的事情取代COM的API和ActiveX与.NET类控制 - 这取决于球队需要或想要的。

We rewrite large VB6/ASP/COM applications to .NET (primarily C#) for a living and we have developed a software analysis and reengineering tool to help us do it. This tool is essentially like a VB6/ASP/COM compiler and a decompiler that authors .NET codes. Of course since the VB6 platform is very different from .NET, a direct compile/decompile is not desirable or viable, so our tool has an "analyzer" that implements various code reengineering algorithms to deal with VB6-C# incompatibilities. There is also a programmable "author" that allows the migration team to prescribe rules for setting up .NET code files, restructuring the code, and doing things like replacing COM APIs and ActiveX controls with .NET classes -- depending on what the team needs or wants.

作为通过编写和分析代码的产品我们的工具生产全VB6的模型/ ASP / COM系统正在升级。该模型可用于产生关于系统的内部结构极为详细的报告。这些模型可以用来帮助反向工程的代码 - 如果你知道正确的问题要问,你需要了解的问题域做好

As a by product of compiling and analyzing the code our tool produces a model of the entire VB6/ASP/COM system being upgraded. This model can be used to produce extremely detailed reports about the internal structure of the system. These models can be used to help reverse-engineer the code -- if you know the right questions to ask and you would need to understand the problem domain to do a good job.

当然,一旦你拥有了构建完成.NET,您可以使用工作过组件的各种分析和代码审查的工具。 Visual Studio中的某些版本有这些工具,有开源工具如FxCop的,NDepends)。还有,我已经使用了一些梦幻般的动态分析工具(EQUATEC示踪)。

Of course once you have build-complete .NET, you can use the various analytics and code review tools that work off assemblies. Some versions of Visual Studio have these tools and there are open source tools such as FxCop, NDepends). There are also some fantastic dynamic analysis tools (EQUATEC Tracer) that I have used.

在比赛的最后阶段迁移团队要非常很难验证任何未知的系统。即使你是住在同一个平台上,你就无法证明一个应用程序是正确的,如果你不知道如何运行它,以及如何设置/进入预期的输入和查找/验证预期的产出。我们通常离开这个给客户!

In the end though migration teams are going to very hard pressed to verify any unknown system. Even if you are staying on the same platform, you would unable to prove an application it is "correct" if you do not know how to run it and how to setup/enter expected inputs and find/verify expected outputs. We normally leave this to the customer!

如果我们为客户做验证,我们在很大程度上依赖于并排侧测试,以验证系统的新版本 - 假设我们知道该怎么办好遗留应用我们假定给予相同集的输入和用例应该表现出相同的行为,并产生相同的结果。我听说在单元测试圈这个认可试验。

If we are doing verification for the customer, we rely heavily on side-by-side testing to validate the new version of your system -- assuming we know how to run the legacy application we assume that given the same sets of inputs and usecases it should exhibit the same behaviors and produce the same results. I have heard this Approval Tests in unit testing circles.

我承认,我们还严重依赖于知识的VB6 / COM代码是数据结构的完整,详细,正式和生产测试的描述和逻辑系统而且我们是把通过测试并重新测试系统改造这一信息。我们一直在开发自1977年以来的编译器,我们已经很努力在这个VB6 / ASP编译器,使我们产生保留原始VB6的语义确保.NET代码。这不是100%,每一次 - 但它是越来越近了所有的时间。然后再手工做的事情并不能保证在第一次尝试要么...

I admit we also rely heavily on the knowledge that the VB6/COM code is a complete, detailed, formal and production tested description of the data structures and logic of the system and that we are putting this information through a tested and retested systematic transformation. We have been developing compilers since 1977 and we have worked very hard on this VB6/ASP compiler to make sure the .NET codes that we generate preserves the semantics of the original VB6. It is not 100% every time - but it is getting closer all the time. Then again doing things by hand does not guarantee 100% correct code on the first try either...

这篇关于Bestpractice方法与域的知识进行逆向工程VB6代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆