Identification of refactoring opportunities for source code based on class association relationships

来源期刊:中南大学学报(英文版)2020年第12期

论文作者:刘伟 杨娜 黄辛迪 胡为 胡志刚

文章页码:3768 - 3778

Key words:identification of refactoring opportunities; abstract syntax tree; class association relationships; common association classes; source code

Abstract: In order to deal with the complex association relationships between classes in an object-oriented software system, a novel approach for identifying refactoring opportunities is proposed. The approach can be used to detect complex and duplicated many-to-many association relationships in source code, and to provide guidance for further refactoring. In the approach, source code is first transformed to an abstract syntax tree from which all data members of each class are extracted, then each class is characterized in connection with a set of association classes saving its data members. Next, classes in common associations are obtained by comparing different association classes sets in integrated analysis. Finally, on condition of pre-defined thresholds, all class sets in candidate for refactoring and their common association classes are saved and exported. This approach is tested on 4 projects. The results show that the precision is over 96% when the threshold is 3, and 100% when the threshold is 4. Meanwhile, this approach has good execution efficiency as the execution time taken for a project with more than 500 classes is less than 4 s, which also indicates that it can be applied to projects of different scales to identify their refactoring opportunities effectively.

Cite this article as: LIU Wei, YANG Na, HUANG Xin-di, HU Wei, HU Zhi-gang. Identification of refactoring opportunities for source code based on class association relationships [J]. Journal of Central South University, 2020, 27(12): 3768-3778. DOI: https://doi.org/10.1007/s11771-020-4576-7.

相关论文

  • 暂无!

相关知识点

  • 暂无!

有色金属在线官网  |   会议  |   在线投稿  |   购买纸书  |   科技图书馆

中南大学出版社 技术支持 版权声明   电话:0731-88830515 88830516   传真:0731-88710482   Email:administrator@cnnmol.com

互联网出版许可证:(署)网出证(京)字第342号   京ICP备17050991号-6      京公网安备11010802042557号