| 本文已被:浏览 5667次 下载 7939次 |
 码上扫一扫! |
|
|
| 一种基于类型传播分析的泛型实例重构方法 |
|
陈 林1,2,3, 徐宝文1,2,3, 钱 巨1,4, 周天琳1,3, 周毓明1,2
|
|
1.南京大学计算机软件新技术国家重点实验室,江苏南京 210093;2.南京大学计算机科学与技术系,江苏南京 210093;3.东南大学计算机科学与工程学院,江苏南京 210096;4.南京航空航天大学信息科学与技术学院,江苏南京 210016
|
|
| 摘要: |
| 重构泛型实例有利于提高软件的复用性和类型安全,但现有重构方法的时间复杂度较高,不适用于即时持续的重构.分析了变量类型传播分析方法在重构中的不足,提出了一种改进的泛型变量类型传播分析方法.该方法通过引入一种可以描述复杂参数化类型关系的泛型类型传播图,以复制节点的方式实现泛型变量属性敏感的类型分析,并通过解决别名问题来提高分析的精度.实例研究表明,可以在与程序规模呈近似线性增长的时间复杂度内实施重构,取得了较满意的效果. |
| 关键词: 泛型 软件重构 类型传播分析 别名分析 软件重用 |
| DOI: |
| 分类号: |
| 基金项目:Supported by the National Natural Science Foundation of China under Grant Nos.90818027, 60633010 ( 国家自然科学基金); the
National High-Tech Research and Development Plan of China under Grant No.2009AA01Z147 ( 国家高技术研究发展计划(863)) |
|
| Refactoring Generic Instantiations Based on Type Propagation Analysis |
|
CHEN Lin,XU Bao-Wen,QIAN Ju,ZHOU Tian-Lin,ZHOU Yu-Ming
|
| Abstract: |
| Refactoring generic instantiation is valuable for improving reusability and type safety of software. Most of the existing approaches of refactoring legacy code are not suitable for on-line and persistent refactoring because of their complexity. This paper proposes an instantiation refactoring approach for Java programs based on an extended variable type analysis algorithm. A generic type propagation graph is constructed, and new constructs used to express generic type analysis are added to the graph, so it is suitable to do a generic variable field sensitive type analysis. The paper also discusses how to use alias information to improve the refactoring. The case study shows that the results are satisfactory. |
| Key words: generic software refactoring type propagation analysis alias analysis software reuse |