arrow
返回

Measuring code maintainability with deep neural networks

delete2023-01-21
delete4
PRE
AI
Y
Yamin Hu *
H
Hao Jiang
Z
Zongyao Hu
DOI:10.1007/s11704-022-2313-0delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
The maintainability of source code is a key quality characteristic for software quality. Many approaches have been proposed to quantitatively measure code maintainability. Such approaches rely heavily on code metrics, e.g., the number of Lines of Code and McCabe's Cyclomatic Complexity. The employed code metrics are essentially statistics regarding code elements, e.g., the numbers of tokens, lines, references, and branch statements. However, natural language in source code, especially identifiers, is rarely exploited by such approaches. As a result, replacing meaningful identifiers with nonsense tokens would not significantly influence their outputs, although the replacement should have significantly reduced code maintainability. To this end, in this paper, we propose a novel approach (called DeepM) to measure code maintainability by exploiting the lexical semantics of text in source code. DeepM leverages deep learning techniques (e.g., LSTM and attention mechanism) to exploit these lexical semantics in measuring code maintainability. Another key rationale of DeepM is that measuring code maintainability is complex and often far beyond the capabilities of statistics or simple heuristics. Consequently, DeepM leverages deep learning techniques to automatically select useful features from complex and lengthy inputs and to construct a complex mapping (rather than simple heuristics) from the input to the output (code maintainability index). DeepM is evaluated on a manually-assessed dataset. The evaluation results suggest that DeepM is accurate, and it generates the same rankings of code maintainability as those of experienced programmers on 87.5% of manually ranked pairs of Java classes.
Keyword:
code maintainability
lexical semantics
deep learning
neural networks

期刊

Frontiers of Computer Science 封面图
Frontiers of Computer Science
IF:
4.6
论文数:
1.6K
被引数:
2.8K

机构

B
beijing institute of technology
学者数:
5.5W
论文数: 4.0W
被引数: 63
A
anhui university
学者数:
1.9W
论文数: 1.2W
被引数: 24
引用论文

引用论文

ALFAA: Active Learning Fingerprint based Anti-Aliasing for correcting developer identity errors in version control systems
err2020-01-03
err23
PREAI
errAmreen, Sadika; Mockus, Audris; Zaretzki, Russell; Bogart, Christopher; Zhang, Yuxia
err分享
err收藏
err分享
err收藏
Automatically Assessing Code Understandability自动评估代码可理解性
err2021-03-01
err48
errOAAI
errScalabrino, Simone; Bavota, Gabriele; Vendome, Christopher; Linares-Vasquez, Mario; Poshyvanyk, Denys; Oliveto, Rocco
err分享
err收藏
err分享
err收藏
Raxibacumab augments hemodynamic support and improves outcomes during shock with B. anthracis edema toxin alone or together with lethal toxin in canines
err2015-02-28
err0
errOAAI
errKenneth E Remy; Xizhong Cui; Yan Li; Junfeng Sun; Steven B Solomon; Yvonne Fitz; Amisha V Barochia; Mariam Al-Hamad; Mahtab Moayeri; Stephen H Leppla; Peter Q Eichacker
err分享
err收藏
Enhancement of pyramid solar distiller performance using reflectors, cooling cycle, and dangled cords of wicks
err2021-06-01
err0
PREAI
errF.A. Essa; Wissam H. Alawee; Suha A. Mohammed; A.S. Abdullah; Z.M. Omara
err分享
err收藏
The Puerto Rico Gap Analysis Project Volume 1: land cover, vertebrate species distributions, and land stewardship
err
IF0
err2008-01-01
err0
errOAAI
errW. A. Gould; C. Alarcon; B. Fevold; M.E. Jimenez; S. Martinuzzi; G. Potts; M. Quinones; M. Solórzano; E. Ventosa
err分享
err收藏
学者 查看更多内容