arrow
Return

Towards using visual, semantic and structural features to improve code readability classification

delete2022-11-01
delete7
PRE
AI
Q
Qing Mi
Y
Yiqun Hao
L
Liwei Ou
W
Wei Ma *
DOI:10.1016/j.jss.2022.111454delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Context: Code readability, which correlates strongly with software quality, plays a critical role in software maintenance and evolvement. Although existing deep learning-based code readability models have reached a rather high classification accuracy, only structural features are utilized which inevitably limits their model performance. Objective: To address this problem, we propose to extract readability-related features from visual, semantic, and structural aspects from source code in an attempt to further improve code readability classification. Method: First, we convert a code snippet into a RGB matrix (for visual feature extraction), a token sequence (for semantic feature extraction) and a character matrix (for structural feature extraction). Then, we input them into a hybrid neural network that is composed of BERT, CNN, and BiLSTM for feature extraction. Finally, the extracted features are concatenated and input into a classifier to make a code readability classification. Result: A series of experiments are conducted to evaluate our method. The results show that the average accuracy could reach 85.3%, which outperforms all existing models. Conclusion: As an innovative work of extracting readability-related features automatically from visual, semantic, and structural aspects, our method is proved to be effective for the task of code readability classification. (c) 2022 Elsevier Inc. All rights reserved.
Keywords:
Code readability classification
Code representation
Neural networks
Program comprehension
Software analysis

Journal

Journal of Systems and Software cover
Journal of Systems and Software
IF:
4.1
Papers:
5.4K
Citations:
8.4K

Organization

B
Beijing University of Technology
Scholars:
2.8W
Papers: 2.1W
Citations: 2.7W
Cited Papers

Cited Papers

Target-Dependent Sentiment Classification With BERT
err2019-01-01
err250
errOAAI
errGao, Zhengjie; Feng, Ao; Song, Xinyu; Wu, Xi
errShare
errSave
Proactive Secret Sharing Or: How to Cope With Perpetual Leakage
err2001-07-13
err0
errOAAI
errAmir Herzberg; Stanisław Jarecki; Hugo Krawczyk; Moti Yung
errShare
errSave
SBA-15:TiO2 nanocomposites: II. Direct and post-synthesis using acetylacetone
err2017-02-01
err0
PREAI
errAlice A.M.L.F. Jardim; Rebeca Bacani; Norberto S. Gonçalves; Márcia C.A. Fantini; Tereza S. Martins
errShare
errSave
Measuring Program Comprehension: A Large-Scale Field Study with Professionals
err2018-10-01
err195
errOAAI
errXia, Xin; Bao, Lingfeng; Lo, David; Xing, Zhenchang; Hassan, Ahmed E.; Li, Shanping
errShare
errSave
researcher View more