代码的可维护性问题

在软件的整个生命周期当中,软件维护占有大的一部分。基本上可以分成四个类别:

  • 适应性维护:处理变更和适应环境变化
  • 增强性维护:功能增强
  • 矫正性维护:错误处理
  • 预防性维护:提高可维护性,防止后续出现问题

有调查表明,有75%的维护时间花在一两种类别上,而有21%的时间花在错误修正的维护上。那么怎么样来提高软件的可维护性呢,以下是利于增强维护的几个方面:

维护因子(Maintenance Factors)                             所占比重(PlusRange)


维护专家(Maintenance specialists)                          35%            
职员经难丰富(High staff experience)                        34%            
基于表格的变量和数据(Table-driven variables and data)      33%            
基准代码低复杂度(Low complexity of base code)              32%            
专业搜索引擎(Y2K and special search engines )              30%            
代码重构工具(Code restructuring tools )                    29%            
再工程工具(Re-engineering tools )                          27%            
高级语言(High level programming languages )                25%            
逆向工具(Reverse engineering tools)                        23%            
复杂分析工具(Complexity analysis tools)                    20%            
错误跟踪工具(Defect tracking tools)                        20%            
块更新(Y2K “mass update” specialists)                      20%            
自动化变更控制工具(Automated change control tools )        18%            
无偿加班(Unpaid overtime)                                  18%            
质量度量(Quality measurements )                            16%            
正式的基准代码检查(Formal base code inspections )          15%            
回归测试组件(Regression test libraries)                    15%            
优秀的响应时间(Excellent response time)                    12%            
大于10天的年度培训(Annual training of > 10 days )          12%            
较高的管理经验(High management experience )                12%            
自动化的帮助(HELP desk automation )                        12%            
无错误的模块(No error prone modules )                      10%            
在线错误报告(On-line defect reporting )                    10%            
生产力度量(Productivity measurements)                      8%             
易用(Excellent ease of use)                                7%             
用户满意度(User satisfaction measurements )                5%             
高团队士气(High team morale )                              5%             

----------------------------------------------------------------------------------------
合计(Sum)                                                  503%   

而不利于系统维护性的因素如下:

Maintenance FactorsMinus Range
Error prone modules -50%
Embedded variables and data -45%
Staff inexperience -40%
High code complexity -30%
No Y2K of special search engines -28%
Manual change control methods -27%
Low level programming languages -25%
No defect tracking tools -24%
No Y2K “mass update” specialists -22%
Poor ease of use -18%
No quality measurements -18%
No maintenance specialists -18%
Poor response time -16%
No code inspections -15%
No regression test libraries -15%
No help desk automation -15%
No on-line defect reporting -12%
Management inexperience -15%
No code restructuring tools -10%
No annual training -10%
No reengineering tools -10%
No reverse-engineering tools -10%
No complexity analysis tools -10%
No productivity measurements -7%
Poor team morale -6%
No user satisfaction measurements -4%
No unpaid overtime 0%
Sum-500%

原文见:

http://en.wikipedia.org/wiki/Software_maintenance

专注于机器学习、前端相关邻域。关注 全栈深入 公众号查看更多硬核文章。
原文地址:https://www.cnblogs.com/janas/p/2395673.html