代码重构 [英] Code refactoring

查看:189
本文介绍了代码重构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将开始处理一个涉及重构和修改现有代码的项目,该代码位于c& c ++。代码是一个。肿的,在巨大的体积。当然,因为代码需要修改,所以必须开发一个对代码的理解,并且在很短的时间内,因为我们有一些非常时间紧迫的项目进度。任何人都可以建议任何开源工具,将有助于实现上述目标。
简而言之,我正在寻找的工具可以:

I am about to starting to work on a project which involves refactoring and modifying existing code which is in c & c++. The code is a bloated one and is in huge volume. Of course since the code needs to be modified, an understanding of the code has to be developed and in a very short span of time since we have some pretty time pressed project schedule. Can anyone please suggest any open source tools which will help in achieving the above. In short what I am looking for is tool which can:


  1. 逆向工程工具将帮助理解设计。 li>
  2. 序列生成器工具,它将帮助在运行时绘制序列(很可能我们将能够运行代码,但不是在初始阶段至少)或通过代码检查。

  3. 良好的代码浏览工具,可用于研究现有的代码库。

  4. 适合使用自动重构代码的工具。



    请告诉我任何经验,喜好或收藏值得一试。

Please do tell me about any experiences,preferences or favorites worth looknig out for.

一个工具列表在上面帮助。以下是列表:

Came up with a list of tools to help in above. Here's the list:


  1. Graphviz & Doxygen

    从现有代码库生成UML类图

  1. Graphviz & Doxygen
    Generate UML class diagrams from existing code base

UMLStudio

为您的OO旧代码创建对象模型是分析,理解和维护它的最佳方法。 UMLStudio可以自动将C ++,Java,CORBA IDL,PHP 5和Ada 95代码转换为OOA& D符号,比任何其他CASE工具更快。

UMLStudio
Creating an object model for your OO legacy code is the best approach to analysing, understanding and maintaining it. UMLStudio can automatically convert C++, Java, CORBA IDL, PHP 5, and Ada 95 code into OOA&D notation faster than any other CASE tool.

CodeDrawer for C ++

CodeDrawer将源代码转换为基于可视化的图表。类,结构和任何元素的源代码都可以显示图。它还显示了函数和方法的逻辑。 CodeDrawer有助于了解您的项目的源代码

CodeDrawer for C++
The CodeDrawer converts source code to visual based diagrams. Class, struct, and any elements of source code can be shown diagrams. It also shows the logics of a function and a method. The CodeDrawer helps understand source code of your project

Imagix

反向工程和源代码的可视化导致改进的程序理解。速度:
学习不熟悉的代码
更改影响分析
集成开源代码
代码重用
软件维护

Imagix
Reverse engineering and visualization of source code lead to improved program comprehension. Speeds: Learning Unfamiliar Code Change Impact Analysis Integrating Open Source Code Code Reuse Software Maintenance

AgileJ
AgileJ StructureViews是Eclipse Java IDE的插件,可生成高度可定制的工业规模的UML类图,非常适合敏捷开发或探索任何现有的Java代码库。

AgileJ AgileJ StructureViews is a plug-in for the Eclipse Java IDE which generates highly customisable UML class diagrams on an industrial scale, ideal for agile development or exploration of any existing Java codebase.

MaintainJ
如果您可以运行代码库,那么当您运行特定的用例时,MaintainJ会在运行时生成UML序列和类图。

MaintainJ If you can run the code base then MaintainJ generates UML sequence and class diagrams at runtime when you run a particular use case.

Java逆向工程工具

Source Insight
优质来源浏览软件

Source Insight Great source browsing software

再次感谢Steve Townsend < br>
Klocwork

One more, Thanks to Steve Townsend
Klocwork

推荐答案


代码是一个笨重的代码,体积很大。因为代码需要修改,所以必须开发代码的理解,并且在很短的时间内开发,因为我们有一些非常时间紧迫的项目进度。

The code is a bloated one and is in huge volume. Ofcourse since the code needs to be modified an understanding of the code has to be developed and in a very short span of time since we have some pretty time pressed project schedule.

然后你有一个管理问题:如果你已经知道你没有时间了解很多代码,你注定了。要理解这段代码,你必须让它运行和通过它,它需要时间。工具只会给你一个大地图,但不会告诉你真正的路径。

Then you have a management problem : if you already know you have little time to UNDERSTAND a lot of code, you're doomed. To understand this code, you'll have to make it run and go through it and it will take time. Tools will just give you a big map of things but will not show you the real path.


适合的工具,可以自动重构代码与最小努力。

Suitable tool which can auto refactor code with minimal efforts.

您住在仙境。

它为你提供了你的应用程序的结构体系结构,但是这不会真正帮助没有经过每个模块一个一个,阅读代码。首先是使用模块的代码,然后是模块中的代码。

There are tools that gives you the structural architecture of you application, but that will not really help without going through each module one by one and read the code. First the code that use the modules, then the code inside the modules.

事实上,C和C ++使得它更难以定义它会花费你的时间因为它也相对于你对这些语言的知识和编写应用程序的人的知识水平。

The fact that it's C and C++ makes it even harder to define the time that it will take you as it's also relative to the knowledge you have of those languages and the level of knowledge of the people who wrote the app.

这篇关于代码重构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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