Journal of Computer Applications ›› 2022, Vol. 42 ›› Issue (6): 1702-1707.DOI: 10.11772/j.issn.1001-9081.2021061403
Special Issue: 2021年全国开放式分布与并行计算学术年会(DPCS 2021)论文
• National Open Distributed and Parallel Computing Conference 2021 (DPCS 2021) • Previous Articles Next Articles
Shan SU, Yang ZHANG(), Dongwen ZHANG
Received:
2021-08-05
Revised:
2021-09-08
Accepted:
2021-10-20
Online:
2022-01-10
Published:
2022-06-10
Contact:
Yang ZHANG
About author:
SU Shan,born in 1995,M. S. candidate. Her research interestsinclude software refactoring.Supported by:
通讯作者:
张杨
作者简介:
苏珊(1995—),女,河北石家庄人,硕士研究生,主要研究方向:软件重构基金资助:
CLC Number:
Shan SU, Yang ZHANG, Dongwen ZHANG. Coupling related code smell detection method based on deep learning[J]. Journal of Computer Applications, 2022, 42(6): 1702-1707.
苏珊, 张杨, 张冬雯. 基于深度学习的耦合度相关代码坏味检测方法[J]. 《计算机应用》唯一官方网站, 2022, 42(6): 1702-1707.
Add to citation manager EndNote|Ris|BibTeX
URL: https://www.joca.cn/EN/10.11772/j.issn.1001-9081.2021061403
度量 | 定义 |
---|---|
CINT | 被检测方法调用其他类中方法的数量 |
CDISP | 判定一个方法耦合分散度的指标 |
CC | 其他类中调用被检测方法的方法数量 |
CM | 与被检测方法有联系的类的数量 |
MAXNESTING | 被检测方法嵌套层次结构中最多层的层数 |
Tab. 1 Metrics of code smell
度量 | 定义 |
---|---|
CINT | 被检测方法调用其他类中方法的数量 |
CDISP | 判定一个方法耦合分散度的指标 |
CC | 其他类中调用被检测方法的方法数量 |
CM | 与被检测方法有联系的类的数量 |
MAXNESTING | 被检测方法嵌套层次结构中最多层的层数 |
项目名称 | 项目领域 | NOC | NOM | LOC |
---|---|---|---|---|
argouml | UML图绘制 | 1 953 | 17 466 | 160 354 |
axion | gradle管理插件 | 35 | 313 | 1 096 |
Emmagee | 性能测试工具 | 9 | 58 | 907 |
fullsync | 文件同步工具 | 139 | 806 | 3 900 |
heritrix3 | 爬虫工具包 | 555 | 4 722 | 41 972 |
hsqldb | 数据库 | 659 | 12 915 | 227 069 |
ipscan | ip端口扫描 | 184 | 933 | 6 584 |
javacc | 词法分析器 | 180 | 1 487 | 20 861 |
jGroups | 群组通信工具 | 251 | 1 935 | 13 199 |
jparsec | 解析jQuery | 237 | 1 274 | 7 387 |
jspwiki | Wiki系统 | 30 | 2 243 | 21 296 |
keystore | 数据证书工具 | 272 | 1 593 | 21 215 |
marauroa | 服务器端框架 | 231 | 1 866 | 19 044 |
picocontainer | 微核心容器 | 1 005 | 6 862 | 48 468 |
quartz | 分布式框架 | 465 | 4 585 | 41 749 |
QuickServer | 服务器端组件 | 165 | 1 699 | 16 633 |
roller | 博客服务器 | 549 | 5 040 | 47 848 |
squirrel | 数据库工具 | 192 | 1 428 | 8 922 |
xalan | xslt处理器 | 964 | 10 359 | 188 637 |
xerces | xml解析器 | 838 | 10 717 | 142 249 |
you-jextractor | 下载工具 | 76 | 646 | 2 711 |
Tab. 2 Projects for training set
项目名称 | 项目领域 | NOC | NOM | LOC |
---|---|---|---|---|
argouml | UML图绘制 | 1 953 | 17 466 | 160 354 |
axion | gradle管理插件 | 35 | 313 | 1 096 |
Emmagee | 性能测试工具 | 9 | 58 | 907 |
fullsync | 文件同步工具 | 139 | 806 | 3 900 |
heritrix3 | 爬虫工具包 | 555 | 4 722 | 41 972 |
hsqldb | 数据库 | 659 | 12 915 | 227 069 |
ipscan | ip端口扫描 | 184 | 933 | 6 584 |
javacc | 词法分析器 | 180 | 1 487 | 20 861 |
jGroups | 群组通信工具 | 251 | 1 935 | 13 199 |
jparsec | 解析jQuery | 237 | 1 274 | 7 387 |
jspwiki | Wiki系统 | 30 | 2 243 | 21 296 |
keystore | 数据证书工具 | 272 | 1 593 | 21 215 |
marauroa | 服务器端框架 | 231 | 1 866 | 19 044 |
picocontainer | 微核心容器 | 1 005 | 6 862 | 48 468 |
quartz | 分布式框架 | 465 | 4 585 | 41 749 |
QuickServer | 服务器端组件 | 165 | 1 699 | 16 633 |
roller | 博客服务器 | 549 | 5 040 | 47 848 |
squirrel | 数据库工具 | 192 | 1 428 | 8 922 |
xalan | xslt处理器 | 964 | 10 359 | 188 637 |
xerces | xml解析器 | 838 | 10 717 | 142 249 |
you-jextractor | 下载工具 | 76 | 646 | 2 711 |
方法 | CINT | CDISP | MAXNESTING | INTENSIVE |
---|---|---|---|---|
exit | 0.38 | 16 | 3 | 1 |
setTool | 1 | 1 | 2 | 0 |
setTime | 1 | 1 | 2 | 0 |
unlock | 0.18 | 11 | 3 | 1 |
Tab. 3 Training set of Intensive Coupling
方法 | CINT | CDISP | MAXNESTING | INTENSIVE |
---|---|---|---|---|
exit | 0.38 | 16 | 3 | 1 |
setTool | 1 | 1 | 2 | 0 |
setTime | 1 | 1 | 2 | 0 |
unlock | 0.18 | 11 | 3 | 1 |
项目名称 | 项目领域 | NOC | NOM | LOC |
---|---|---|---|---|
ArtOfIllusion | 3D动画 | 492 | 6 766 | 103 586 |
FreePlane | 思维导图 | 787 | 6 938 | 124 937 |
jasperreports | 报表工具 | 2 890 | 23 055 | 202 308 |
Jdeodorant | 代码结构分析 | 391 | 4 265 | 84 726 |
jEdit | 文本编辑器 | 584 | 7 418 | 104 771 |
jfreechart | 图表绘制类库 | 713 | 6 953 | 70 227 |
pmd | 代码检查工具 | 2 194 | 10 105 | 51 296 |
elasticsearch | 搜索服务器 | 3 356 | 31 160 | 198 869 |
netty | Java开源框架 | 2 458 | 27 183 | 212 343 |
omega | 辅助翻译工具 | 631 | 4 543 | 39 153 |
Tab. 4 Projects for test set
项目名称 | 项目领域 | NOC | NOM | LOC |
---|---|---|---|---|
ArtOfIllusion | 3D动画 | 492 | 6 766 | 103 586 |
FreePlane | 思维导图 | 787 | 6 938 | 124 937 |
jasperreports | 报表工具 | 2 890 | 23 055 | 202 308 |
Jdeodorant | 代码结构分析 | 391 | 4 265 | 84 726 |
jEdit | 文本编辑器 | 584 | 7 418 | 104 771 |
jfreechart | 图表绘制类库 | 713 | 6 953 | 70 227 |
pmd | 代码检查工具 | 2 194 | 10 105 | 51 296 |
elasticsearch | 搜索服务器 | 3 356 | 31 160 | 198 869 |
netty | Java开源框架 | 2 458 | 27 183 | 212 343 |
omega | 辅助翻译工具 | 631 | 4 543 | 39 153 |
模型 | 标签 | 查准率 | 查全率 | |
---|---|---|---|---|
CNN | 0 | 100.00 | 99.90 | 99.95 |
1 | 89.44 | 99.73 | 94.30 | |
Attention-CNN | 0 | 100.00 | 99.94 | 99.97 |
1 | 93.61 | 100.00 | 96.70 |
Tab. 5 Results of detection of Intensive Coupling
模型 | 标签 | 查准率 | 查全率 | |
---|---|---|---|---|
CNN | 0 | 100.00 | 99.90 | 99.95 |
1 | 89.44 | 99.73 | 94.30 | |
Attention-CNN | 0 | 100.00 | 99.94 | 99.97 |
1 | 93.61 | 100.00 | 96.70 |
模型 | 标签 | 查准率 | 查全率 | |
---|---|---|---|---|
CNN | 0 | 100.00 | 99.99 | 99.99 |
1 | 99.04 | 100.00 | 99.52 | |
Attention-CNN | 0 | 100.00 | 100.00 | 100.00 |
1 | 99.76 | 99.76 | 99.76 |
Tab. 6 Results of detection of Dispersed Coupling
模型 | 标签 | 查准率 | 查全率 | |
---|---|---|---|---|
CNN | 0 | 100.00 | 99.99 | 99.99 |
1 | 99.04 | 100.00 | 99.52 | |
Attention-CNN | 0 | 100.00 | 100.00 | 100.00 |
1 | 99.76 | 99.76 | 99.76 |
模型 | 标签 | 查准率 | 查全率 | F1 |
---|---|---|---|---|
CNN | 0 | 100.00 | 99.99 | 99.99 |
1 | 98.59 | 100.00 | 99.45 | |
Attention-CNN | 0 | 100.00 | 99.92 | 99.96 |
1 | 95.66 | 100.00 | 97.78 |
Tab. 7 Results of detection of Shotgun Surgery
模型 | 标签 | 查准率 | 查全率 | F1 |
---|---|---|---|---|
CNN | 0 | 100.00 | 99.99 | 99.99 |
1 | 98.59 | 100.00 | 99.45 | |
Attention-CNN | 0 | 100.00 | 99.92 | 99.96 |
1 | 95.66 | 100.00 | 97.78 |
模型 | 过紧的耦合 | 分散的耦合 | 散弹式修改 |
---|---|---|---|
CNN | 130.49 | 150.85 | 61.21 |
Attention-CNN | 131.68 | 157.60 | 69.58 |
Tab. 8 Time consumption of three code smells
模型 | 过紧的耦合 | 分散的耦合 | 散弹式修改 |
---|---|---|---|
CNN | 130.49 | 150.85 | 61.21 |
Attention-CNN | 131.68 | 157.60 | 69.58 |
1 | MENS T, TOURWE T. A survey of software refactoring[J]. IEEE Transactions on Software Engineering, 2004, 30(2): 126-139. 10.1109/tse.2004.1265817 |
2 | FOWLER M, BECK K, BRANT J, et al. Refactoring: Improving the Design of Existing Code[M]. Boston: Addison-Wesley Professional, 1999: 71-76. |
3 | APRIL A, ABRAN A. Software Maintenance Management: Evaluation and Continuous Improvement [M]. Hoboken: John Wiley & Sons, 2012: 1-5. |
4 | YOSHIDA N, KINOSHITA M, IIDA H. A cohesion metric approach to dividing source code into functional segments to improve maintainability[C]// Proceedings of the 16th European Conference on Software Maintenance and Reengineering. Piscataway: IEEE, 2012: 365-370. 10.1109/csmr.2012.45 |
5 | PALOMBA F, BAVOTA G, DI PENTA M, et al. Mining version histories for detecting code smells[J]. IEEE Transactions on Software Engineering, 2015, 41(5): 462-489. 10.1109/tse.2014.2372760 |
6 | SALES V, TERRA R, MIRANDA L F, et al. Recommending move method refactorings using dependency sets[C]// Proceedings of the 20th Working Conference on Reverse Engineering. Piscataway: IEEE, 2013: 232-241. 10.1109/wcre.2013.6671298 |
7 | MÄNTYLÄ M V, LASSENIUS C. Subjective evaluation of software evolvability using code smells: an empirical study[J]. Empirical Software Engineering, 2006, 11(3): 395-431. 10.1007/s10664-006-9002-8 |
8 | MAIGA A, ALI N, BHATTACHARYA N, et al. Support vector machines for anti-pattern detection[C]// Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering. Piscataway: IEEE, 2012: 278-281. 10.1145/2351676.2351723 |
9 | KREIMER J. Adaptive detection of design flaws[J]. Electronic Notes in Theoretical Computer Science, 2005, 141(4): 117-136. 10.1016/j.entcs.2005.02.059 |
10 | FONTANA F A, MÄNTYLÄ M V, ZANONI M, et al. Comparing and experimenting machine learning techniques for code smell detection[J]. Empirical Software Engineering, 2016, 21(3): 1143-1191. 10.1007/s10664-015-9378-4 |
11 | DI NUCCI D, PALOMBA F, TAMBURRI D A, et al. Detecting code smells using machine learning techniques: are we there yet? [C]// Proceedings of the 2018 IEEE 25th International Conference on Software Analysis, Evolution and Reengineering. Piscataway: IEEE, 2018: 612-621. 10.1109/saner.2018.8330266 |
12 | BENGIO Y, COURVILLE A, VINCENT P. Representation learning: a review and new perspectives[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2013, 35(8): 1798-1828. 10.1109/tpami.2013.50 |
13 | GUO X L, SHI C Y, JIANG H. Deep semantic-based feature envy identification[C]// Proceedings of the 11th Asia-Pacific Symposium on Internetware. New York: ACM, 2019: No.19. 10.1145/3361242.3361257 |
14 | 卜依凡,刘辉,李光杰. 一种基于深度学习的上帝类检测方法[J]. 软件学报, 2019, 30(5): 1360-1374. |
BU Y F, LIU H, LI G J. God class detection approach based on deep learning[J]. Journal of Software, 2019, 30(5): 1360-1374. | |
15 | KESSENTINI W, KESSENTINI M, SAHRAOUI H, et al. A cooperative parallel search-based software engineering approach for code-smells detection[J]. IEEE Transactions on Software Engineering, 2014, 40(9): 841-861. 10.1109/tse.2014.2331057 |
16 | FU S Z, SHEN B J. Code bad smell detection through evolutionary data mining[C]// Proceedings of the 2015 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement. Piscataway: IEEE, 2015: 1-9. 10.1109/esem.2015.7321194 |
17 | VIDAL S, VAZQUEZ H, DIAZ-PACE J A, et al. JSpIRIT: a flexible tool for the analysis of code smells[C]// Proceedings of the 34th International Conference of the Chilean Computer Science Society. Piscataway: IEEE, 2015: 1-6. 10.1109/sccc.2015.7416572 |
18 | HADJ-KACEM M, BOUASSIDA N. A hybrid approach to detect code smells using deep learning[C]// Proceedings of the 13th International Conference on Evaluation of Novel Approaches to Software Engineering. Setúbal: SciTePress, 2018:137-146. 10.5220/0006709801370146 |
19 | KIM D K. Finding bad code smells with neural network models[J]. International Journal of Electrical and Computer Engineering, 2017, 7(6): 3613-3621. 10.11591/ijece.v7i6.pp3613-3621 |
20 | DAS A K, YADAV S, DHAL S. Detecting code smells using deep learning[C]// Proceedings of the 2019 IEEE Region 10 Conference. Piscataway: IEEE, 2019: 2081-2086. 10.1109/tencon.2019.8929628 |
21 | LANZA M, MARINESCU R. Object-Oriented Metrics in Practice: Using Software Metrics to Characterize, Evaluate, and Improve the Design of Object-Oriented Systems[M]. Berlin: Springer, 2006: 115-167. |
22 | CHAWLA N V, BOWYER K W, HALL L O, et al. SMOTE: synthetic minority over-sampling technique[J]. Journal of Artificial Intelligence Research, 2002, 16: 321-357. 10.1613/jair.953 |
23 | BAHDANAU D, CHO K, BENGIO Y. Neural machine translation by jointly learning to align and translate [EB/OL]. [2020-12-08]. . 10.3115/v1/w14-4009 |
[1] | Shunyong LI, Shiyi LI, Rui XU, Xingwang ZHAO. Incomplete multi-view clustering algorithm based on self-attention fusion [J]. Journal of Computer Applications, 2024, 44(9): 2696-2703. |
[2] | Jing QIN, Zhiguang QIN, Fali LI, Yueheng PENG. Diagnosis of major depressive disorder based on probabilistic sparse self-attention neural network [J]. Journal of Computer Applications, 2024, 44(9): 2970-2974. |
[3] | Xiyuan WANG, Zhancheng ZHANG, Shaokang XU, Baocheng ZHANG, Xiaoqing LUO, Fuyuan HU. Unsupervised cross-domain transfer network for 3D/2D registration in surgical navigation [J]. Journal of Computer Applications, 2024, 44(9): 2911-2918. |
[4] | Liting LI, Bei HUA, Ruozhou HE, Kuang XU. Multivariate time series prediction model based on decoupled attention mechanism [J]. Journal of Computer Applications, 2024, 44(9): 2732-2738. |
[5] | Yunchuan HUANG, Yongquan JIANG, Juntao HUANG, Yan YANG. Molecular toxicity prediction based on meta graph isomorphism network [J]. Journal of Computer Applications, 2024, 44(9): 2964-2969. |
[6] | Yexin PAN, Zhe YANG. Optimization model for small object detection based on multi-level feature bidirectional fusion [J]. Journal of Computer Applications, 2024, 44(9): 2871-2877. |
[7] | Yun LI, Fuyou WANG, Peiguang JING, Su WANG, Ao XIAO. Uncertainty-based frame associated short video event detection method [J]. Journal of Computer Applications, 2024, 44(9): 2903-2910. |
[8] | Zhiqiang ZHAO, Peihong MA, Xinhong HEI. Crowd counting method based on dual attention mechanism [J]. Journal of Computer Applications, 2024, 44(9): 2886-2892. |
[9] | Hong CHEN, Bing QI, Haibo JIN, Cong WU, Li’ang ZHANG. Class-imbalanced traffic abnormal detection based on 1D-CNN and BiGRU [J]. Journal of Computer Applications, 2024, 44(8): 2493-2499. |
[10] | Kaipeng XUE, Tao XU, Chunjie LIAO. Multimodal sentiment analysis network with self-supervision and multi-layer cross attention [J]. Journal of Computer Applications, 2024, 44(8): 2387-2392. |
[11] | Pengqi GAO, Heming HUANG, Yonghong FAN. Fusion of coordinate and multi-head attention mechanisms for interactive speech emotion recognition [J]. Journal of Computer Applications, 2024, 44(8): 2400-2406. |
[12] | Yuhan LIU, Genlin JI, Hongping ZHANG. Video pedestrian anomaly detection method based on skeleton graph and mixed attention [J]. Journal of Computer Applications, 2024, 44(8): 2551-2557. |
[13] | Yuwei DING, Hongbo SHI, Jie LI, Min LIANG. Image denoising network based on local and global feature decoupling [J]. Journal of Computer Applications, 2024, 44(8): 2571-2579. |
[14] | Zhonghua LI, Yunqi BAI, Xuejin WANG, Leilei HUANG, Chujun LIN, Shiyu LIAO. Low illumination face detection based on image enhancement [J]. Journal of Computer Applications, 2024, 44(8): 2588-2594. |
[15] | Shangbin MO, Wenjun WANG, Ling DONG, Shengxiang GAO, Zhengtao YU. Single-channel speech enhancement based on multi-channel information aggregation and collaborative decoding [J]. Journal of Computer Applications, 2024, 44(8): 2611-2617. |
Viewed | ||||||
Full text |
|
|||||
Abstract |
|
|||||