Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1694634
  • 博文数量: 177
  • 博客积分: 9416
  • 博客等级: 中将
  • 技术积分: 2513
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-06 16:08
文章分类

全部博文(177)

文章存档

2013年(4)

2012年(13)

2011年(9)

2010年(71)

2009年(12)

2008年(11)

2007年(32)

2006年(25)

分类: 项目管理

2010-03-25 11:35:21

These days I'm stuck to fixing some defects about a parser. The parser parses an internal scripting language, and the language itself is evolving. The original code works, rarely correct, however. The parser module needs refactoring with no doubts. The problem is: how to refactor so that the impacts to the release of whole product will be minimized.

Before making a decision, I analyzed the problems and the risks.
The problems are:
  • the language itself is not well defined,
  • hard-coded parsing rules,
  • high coupling of modules,
  • duplicated functionalities in separate modules, and
  • parser engine is the worst part because it even doesn't generates a syntax tree!
To avoid the problems, the parser needs to be refactored, or even worse, redesigned. This will bring many risks. So at this moment, refactoring of whole module is not acceptable(parse engine was already refactored by me when fixing defects but only brings a functional parser).

The risks are:
  • in recent sprints a functional parser with fewer defects must be delivered,
  • work load of the team is fairly high,
  • the parser itself is written in java while half of team are java newbies,
  • the new parser must be embedded into the existing eclipse plug-in but this will cause impacts to other modules.
Frankly speaking, all modules in this product are examples of poor software engineering. Java is used to write procedural code in this project. I have to say that the team is unlucky to take over such a mass of garbage. We have to face this.

Considering the problems and risks described above, at least 2 phases of refactoring are needed:
  • 1st is to deliver a functional parser and this has been done by refactoring the parse engine,
  • 2nd is to redesign the whole module.
The 2nd phase should be put to "Feature Improvement" or "New Feature" backlog. So the refactoring needs at least 3 iterations. The evolving of the language should be considered and the best moment is when the defects of the language itself have been fixed, and the vagueness of syntax has been eliminated.
阅读(1586) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~