我应该牢记,以重构巨额code基? [英] What should I keep in mind in order to refactor huge code base?

查看:75
本文介绍了我应该牢记,以重构巨额code基?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在一个巨大的code基(18000+ Java类)重构某些部分。目标是能够提取较低层作为独立的库,以在目前使用此code基的重复其他项目被重用。尤其是一部分感兴趣的是被重构到独立的业务逻辑的框架。最后我想code有一个干净的建筑的层次感。

I'm going to refactor certain parts in a huge code base (18000+ Java classes). Goal is to be able to extract lower layers as independent libraries to be reused in other projects that currently use duplicate of this code base. Especially one part is of interest to be refactored into a framework independent of business logic. Ultimately I would like the code to have a clean architectural layering.

我在哪里下层所引用高层建筑分层问题看了看code。与一个叫用于Java 101结构的工具,找到了许多(!)。

I've looked at the code with a tool called Structure 101 for java and found lots (!) of architectural layering issues where lower layers are referencing upper layers.

我不想简单地开始与code搞乱但尽量拿出一个合理的策略去了解这个问题。我应该保持什么事情想什么呢?

I don't want to simply start messing with the code but try to come up with a reasonable strategy to go about this problem. What things should I keep in mind?

我想至少采取小步骤。我还想着有到位的单元测试,但这需要创造他们,因为有没有。

I'm thinking about at least taking small steps. I'm also thinking about have unit tests in place, but that requires creating them, since there are none.

在这个有什么想法?

推荐答案

您也应该看看迈克尔羽毛与传统$ C $工作c:

You should also take a look at Working with legacy code by Michael Feathers:

<一个href=\"http://rads.stackoverflow.com/amzn/click/0131177052\">http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=sr_1_1?ie=UTF8&s=books&qid=1242430219&sr=8-1

我觉得你可以落实到位,以促进最重要的事情是这个测试,以确保一切人们仍然运作后重构/拉出到独立的模块。再加上通过引进当您检查的东西,运行你的测试持续集成系统。

I think one of the most important things you can put in place to facilitate this are tests to ensure that everything still works post refactoring/pulling out into separate modules. Add to this by introducing a continuous integration system that runs your tests when you check something in.

这篇关于我应该牢记,以重构巨额code基?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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