Computer Science ›› 2021, Vol. 48 ›› Issue (12): 94-99.doi: 10.11896/jsjkx.200800193

• Computer Software • Previous Articles     Next Articles

Code Readability Assessment Method Based on Multidimensional Features and Hybrid Neural Networks

MI Qing, GUO Li-min, CHEN Jun-cheng   

  1. Faculty of Information Technology,Beijing University of Technology,Beijing 100124,China
  • Received:2020-08-31 Revised:2021-02-15 Online:2021-12-15 Published:2021-11-26
  • About author:MI Qing,born in 1987,Ph.D,lecturer,is a member of China Computer Federation.Her main research interests include code readability assessment,deep learning and empirical experiments.
    CHEN Jun-cheng,born in 1980,Ph.D,lecturer,is a member of ChinaCompu-ter Federation.His main research intere-sts include software testing,compiler optimization,machine learning and deep learning.
  • Supported by:
    National Natural Science Foundation of China(61702029),Natural Science Foundation of Beijing,China(4192004) and Project of Beijing Municipal Education Commission(KM201810005023).

Abstract: Quantitative and accurate assessment of code readability is an important way to ensure software quality,reduce communication and maintenance costs,and improve the efficiency of software development and evolution.However,existing code readability studies depend mainly on the manual feature engineering method,which is likely to limit the model performance due to factors such as code representation strategies and technical means.Unlike prior studies,we propose a novel code readability assessment method based on multidimensional features and hybrid neural networks by using the technique of deep learning.Specifi-cally,we first propose a representation strategy with different granularity levels to transform source codes into matrices and vectors as the input to deep neural networks.We then build a CNN-BiGRU hybrid neural network that can automatically learn structural and semantic features from the source code.The experimental results show that our method is able to achieve an accuracy of 84.6%,which is 9.2% higher than CNN alone and 6.5% higher than BiGRU alone.Moreover,our method can outperform five state-of-the-art code readability models,which confirms the feasibility and effectiveness of multidimensional features and hybrid neural networks proposed in this study.

Key words: Code analysis, Code readability, Code representation, Deep learning, Software quality assurance

CLC Number: 

  • TP311
[1]HOOIMEIJER P,WEIMER W.Modeling bug report quality [C]//Proc. Twenty-Second IEEE/ACM Int.Conf.Autom.Softw.Eng.(ASE '07).2007:34.
[2]BUSE R P L,WEIMER W R.Learning a Metric for Code Rea- dability[J].IEEE Trans.Softw.Eng.,2010,3(4):546-558.
[3]SIVAPRAKASAM P.Improving Software Quality Through the Development of Code Readability[J].International Journal of Advanced Research in Computer and Communication Enginee-ring,2012,1(6):472-477.
[4]BUSE R P L,WEIMER W R.A metric for software readability [C]//Proceedings of the 2008 International Symposium on Software Testing and Analysis(ISSTA '08).2008:121.
[5]BOSWELL D,FOUCHER T.The Art of Readable Code:Simple and Practical Techniques for Writing Better Code[C]//O'Reilly Media,Inc..2011.
[6]FAKHOURY S,ROY D,HASSAN A,et al.Improving source code readability:theory and practice[C]//2019 IEEE/ACM 27th International Conference on Program Comprehension (ICPC).2019:2-12.
[7]SANTOS R M D,GEROSA M A.Impacts of coding practices on readability[C]//Proc.Int.Conf.Softw.Eng..2018:277-285.
[8]TASHTOUSH Y,ODAT Z,ALSMADI I,et al.Impact of Programming Features on Code Readability[J].Int.J.Softw.Eng.Its Appl.,2013,7(6):441-458.
[9]POSNETT D,HINDLE A,DEVANBU P.A simpler model of software readability[C]//Proceeding of the 8th Working Conference on Mining Software Repositories(MSR '11).2011:73.
[10]SCALABRINO S,LINARES-VASQUEZ M,POSHYVANYK D,et al.Improving code readability models with textual features[C]//2016 IEEE 24th International Conference on Program Comprehension (ICPC).2016:1-10.
[11]DORN J.A General Software Readability Model[D].Virginia:Univ.Virginia,Charlottesville,2012.
[12]CROOKES D.Generating readable software[J].Softw.Eng.J.,1987,2(3):64-70.
[13]BAECKER R.Enhancing program readability and comprehensibility with tools for program visualization[OL].https://dl.acm.org/doi/10.5555/55823.55858.
[14]BINKLEY D,DAVIS M,LAWRIE D,et al.To camelcase or under_score[C]//2009 IEEE 17th International Conference on Program Comprehension.2009:158-167.
[15]SHARIF B,MALETIC J I.An Eye Tracking Study on Camelcase and Under_score Identifier Styles[C]//2010 IEEE 18th International Conference on Program Comprehension.2010:196-205.
[16]BUSE R P L,ZIMMERMANN T.Information needs for software development analytics[C]//2012 34th International Conference on Software Engineering (ICSE).2012:987-996.
[17]AGGARWAL K K,SINGH Y,CHHABRA J K.An integrated measure of software maintainability[C]//Annual Reliability and Maintainability Symposium.2002:235-241.
[18]BÖRSTLER J,CASPERSEN M E,NORDSTRÖM M.Beauty and the beast:on the readability of object-oriented example programs[J].Softw.Qual.J.,2016,24(2):231-246.
[19]MI Q,KEUNG J,XIAO Y,et al.Improving code readability classification using convolutional neural networks[J].Inf.Softw.Technol.,2018,104:60-71.
[20]MAAS A L,HANNUN A Y,NG A Y.Rectifier Nonlinearities Improve Neural Network Acoustic Models[C]//Proc.30th Int.Conf.Mach.Learn..2013.
[21]KINGMA D P,BA J.Adam:A Method for Stochastic Optimization[J].arXiv:1412.6980v5.
[22]LIKERT R.A technique for the measurement of attitudes[OL].https://psycnet.apa.org/record/1933-01885-001.
[23]NEUBERT K,BRUNNER E.A studentized permutation test for the non-parametric Behrens-Fisher problem[J].Comput.Stat.Data Anal.,2007,51(10):5192-5204.
[24]WANG S,LIU T,TAN L.Automatically Learning Semantic Features for Defect Prediction[C]//2016 IEEE/ACM 38th International Confernce on Software Engineering.2016:297-308.
[1] RAO Zhi-shuang, JIA Zhen, ZHANG Fan, LI Tian-rui. Key-Value Relational Memory Networks for Question Answering over Knowledge Graph [J]. Computer Science, 2022, 49(9): 202-207.
[2] TANG Ling-tao, WANG Di, ZHANG Lu-fei, LIU Sheng-yun. Federated Learning Scheme Based on Secure Multi-party Computation and Differential Privacy [J]. Computer Science, 2022, 49(9): 297-305.
[3] XU Yong-xin, ZHAO Jun-feng, WANG Ya-sha, XIE Bing, YANG Kai. Temporal Knowledge Graph Representation Learning [J]. Computer Science, 2022, 49(9): 162-171.
[4] WANG Jian, PENG Yu-qi, ZHAO Yu-fei, YANG Jian. Survey of Social Network Public Opinion Information Extraction Based on Deep Learning [J]. Computer Science, 2022, 49(8): 279-293.
[5] HAO Zhi-rong, CHEN Long, HUANG Jia-cheng. Class Discriminative Universal Adversarial Attack for Text Classification [J]. Computer Science, 2022, 49(8): 323-329.
[6] JIANG Meng-han, LI Shao-mei, ZHENG Hong-hao, ZHANG Jian-peng. Rumor Detection Model Based on Improved Position Embedding [J]. Computer Science, 2022, 49(8): 330-335.
[7] SUN Qi, JI Gen-lin, ZHANG Jie. Non-local Attention Based Generative Adversarial Network for Video Abnormal Event Detection [J]. Computer Science, 2022, 49(8): 172-177.
[8] HOU Yu-tao, ABULIZI Abudukelimu, ABUDUKELIMU Halidanmu. Advances in Chinese Pre-training Models [J]. Computer Science, 2022, 49(7): 148-163.
[9] ZHOU Hui, SHI Hao-chen, TU Yao-feng, HUANG Sheng-jun. Robust Deep Neural Network Learning Based on Active Sampling [J]. Computer Science, 2022, 49(7): 164-169.
[10] SU Dan-ning, CAO Gui-tao, WANG Yan-nan, WANG Hong, REN He. Survey of Deep Learning for Radar Emitter Identification Based on Small Sample [J]. Computer Science, 2022, 49(7): 226-235.
[11] HU Yan-yu, ZHAO Long, DONG Xiang-jun. Two-stage Deep Feature Selection Extraction Algorithm for Cancer Classification [J]. Computer Science, 2022, 49(7): 73-78.
[12] CHENG Cheng, JIANG Ai-lian. Real-time Semantic Segmentation Method Based on Multi-path Feature Extraction [J]. Computer Science, 2022, 49(7): 120-126.
[13] ZHU Wen-tao, LAN Xian-chao, LUO Huan-lin, YUE Bing, WANG Yang. Remote Sensing Aircraft Target Detection Based on Improved Faster R-CNN [J]. Computer Science, 2022, 49(6A): 378-383.
[14] WANG Jian-ming, CHEN Xiang-yu, YANG Zi-zhong, SHI Chen-yang, ZHANG Yu-hang, QIAN Zheng-kun. Influence of Different Data Augmentation Methods on Model Recognition Accuracy [J]. Computer Science, 2022, 49(6A): 418-423.
[15] MAO Dian-hui, HUANG Hui-yu, ZHAO Shuang. Study on Automatic Synthetic News Detection Method Complying with Regulatory Compliance [J]. Computer Science, 2022, 49(6A): 523-530.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!