Computer Science ›› 2024, Vol. 51 ›› Issue (6): 78-84.doi: 10.11896/jsjkx.230300224

• Computer Software • Previous Articles     Next Articles

Sequence-based Program Semantic Rule Mining and Violation Detection

LI Zi1, ZHOU Yu1,2   

  1. 1 College of Computer Science and Technology,Nanjing University of Aeronautics and Astronautics,Nanjing 210016,China
    2 Ministry Key Laboratory for Safety-Critical Software Development and Verification,Nanjing 211100,China
  • Received:2023-03-30 Revised:2023-09-14 Online:2024-06-15 Published:2024-06-05
  • About author:LI Zi,born in 1998,postgraduate.His main research interests include software evolution analysis,artificial intelligence and software artifacts mining.
    ZHOU Yu,born in 1981,postdoctor,professor.His main research interests include software evolution analysis,mining software repositories,software architecture,and reliability analysis.
  • Supported by:
    National Natural Science Foundation of China(61972197),Defense Industrial Technology Development Program(JCKY2022605C006) and Natural Science Foundation of Jiangsu Province,China(BK20201292).

Abstract: In software development,source code that violates semantic rules may compile or run normally but may have defects in performance or functionality.Therefore,accurately detecting such defects has become a challenge.Existing research usually adopts itemset-based rule mining and detection methods,but these methods have significant room for improvement in detection ability and accuracy due to the failure to integrate the order information and control flow information of source code effectively.To address this problem,this paper propose a sequence-based method called SPUME for extracting and detecting program semantic rules.The method converts program source code into an intermediate representation sequence,extracts semantic rules from it using sequence rule mining algorithms,and detects defects in the source code based on these rules.To verify the effectiveness of SPUME,it is compared with three baseline methods,including PR-Miner,Tikanga,and Bugram.Experimental results show that compared with PR-Miner,which is based on unordered itemset mining,and Tikanga,which combines graph models,SPUME has significantly improved detection performance,speed,and accuracy.Compared with Bugram,which is based on Ngram language models,SPUME detects more program defects more efficiently while maintaining a similar level of accuracy.

Key words: Semantic rule mining, Overlapping clustering, Defect detection

CLC Number: 

  • TP391
[1]LI Z,ZHOU Y.PR-Miner:automatically extracting implicit programming rules and detecting violations in large software code[J].ACM SIGSOFT Software Engineering Notes,2005,30(5):306-315.
[2]LIVSHITS B,ZIMMERMANN T.Dynamine:finding commonerror patterns by mining software revision histories[J].ACM SIGSOFT Software Engineering Notes,2005,30(5):296-305.
[3]CHANG R Y,PODGURSKI A,YANG J.Finding what’s not there:a new approach to revealing neglected conditions in software[C]//Proceedings of the 2007 International Symposium on Software Testing and Analysis.2007:163-173.
[4]ANDRZEJ W,ANDREAS Z,CHRISTIAN L.Detecting object usage anomalies[C]//Proceedings of the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Enginee-ring(ESEC-FSE’07).Association for Computing Machinery,New York,NY,USA,2007:35-44.
[5]WASYLKOWSKI A,ZELLER A.Mining temporal specifica-tions from object usage[J].Automated Software Engineering,2011,18:263-292.
[6]WANG S,CHOLLAK D,MOVSHOVITZ-ATTIAS D,et al.Bugram:bug detection with n-gram language models[C]//Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering.2016:708-719.
[7]ZHOU Y,ZHAN W,LI Z,et al.DRIVE:Dockerfile Rule Mi-ning and Violation Detection[J].arXiv:2212.05648,2022.
[8]LUNA J M,FOURNIER-VIGER P,VENTURA S.Frequent itemset mining:A 25 years review[J].Wiley Interdisciplinary Reviews:Data Mining and Knowledge Discovery,2019,9(6):e1329.
[9]CHEN S F,GOODMAN J.An empirical study of smoothingtechniques for language modeling[J].Computer Speech & Language,1999:13(4):359-394.
[10]KAUR J,MADAN N.Association rule mining:A survey[J].International Journal of Hybrid Information Technology,2015,8(7):239-242.
[11]FOURNIER-VIGER P,NKAMBOU R,TSENG V S M.RuleGrowth:mining sequential rules common to several sequences by pattern-growth[C]//Proceedings of the 2011 ACM Sympo-sium on Applied Computing.2011:956-961.
[12]MCNICHOLAS P D,MURPHY T B,O’REGAN M.Standardi-sing the lift of an association rule[J].Computational Statistics &Data Analysis,2008,52(10):4712-4721.
[13]FOURNIER-VIGER P,GUENICHE T,TSENG V S.Usingpartially-ordered sequential rules to generate more accurate sequence prediction[C]//Advanced Data Mining and Applications:8th International Conference(ADMA 2012).Nanjing,China,Springer Berlin Heidelberg,2012:431-442.
[14]PEI J,HAN J,MORTAZAVI-ASL B,et al.Mining sequential patterns by pattern-growth:The prefixspan approach[J].IEEE Transactions on knowledge and data engineering,2004,16(11):1424-1440.
[15]NAYROLLES M,MOHA N,VALTCHEV P.Improving SOA antipatterns detection in Service Based Systems by mining execution traces[C]//2013 20th Working Conference on Reverse Engineering(WCRE).IEEE,2013:321-330.
[16]KAMSU-FOGUEM B,RIGAL F,MAUGET F.Mining association rules for the quality improvement of the production process[J].Expert Systems with Applications,2013,40(4):1034-1045.
[17]ELIBEN.PyCParser[EB/OL].https://github.com-/eliben/pycparser.
[18]BAADEL S,THABTAH F,LU J.Overlapping clustering:A review[C]//2016 SAI Computing Conference(SAI).IEEE,2016:233-237.
[19]IENCO D,BORDOGNA G.Fuzzy extensions of the DBScanclustering algorithm[J].Soft Computing,2018,22(5):1719-1730.
[20]BAHDANAU D,CHO K,BENGIO Y.Neural machine translation by jointly learning to align and translate[J].arXiv:1409.0473,2014.
[21]FENG Z,GUO D,TANG D,et al.Codebert:A pre-trained mo-del for programming and natural languages[J].arXiv:2002.08155,2020.
[22]LAI W,ZHOU M,HU F,et al.A new DBSCAN parameters determination method based on improved MVO[J].IEEE Access,2019,7:104085-104095.
[23]KIM I Y,DE WECK O L.Adaptive weighted-sum method for bi-objective optimization:Pareto front generation[J].Structural and Multidisciplinary Optimization,2005,29:149-158.
[1] XU Hao, LI Fengrun, LU Lu. Metal Surface Defect Detection Method Based on Dual-stream YOLOv4 [J]. Computer Science, 2024, 51(4): 209-216.
[2] BAI Mingli, WANG Mingwen. Fabric Defect Detection Algorithm Based on Improved Cascade R-CNN [J]. Computer Science, 2023, 50(6A): 220300224-6.
[3] JIANG Bo, WAN Yi, XIE Xianzhong. Improved YOLOv5s Lightweight Steel Surface Defect Detection Model [J]. Computer Science, 2023, 50(11A): 230900113-7.
[4] LUO Yuetong, LI Chao, DUAN Chang, ZHOU Bo. Hue Augmentation Method for Industrial Product Surface Defect Images [J]. Computer Science, 2023, 50(11A): 230200089-6.
[5] ZOU Chenwei, YAO Rao. Study on Ultrasonic Phased Array Defect Detection Based on Machine Vision [J]. Computer Science, 2023, 50(11A): 230200150-6.
[6] ZHANG Xiaoxiao, DENG Chengzhi, WU Zhaoming, CAO Chunyang, HU Cheng. Magnetic Tile Defect Detection Algorithm Based on Improved YOLOv4 [J]. Computer Science, 2023, 50(11A): 230100100-7.
[7] LI Fa-guang, YILIHAMU·Yaermaimaiti. Real-time Detection Model of Insulator Defect Based on Improved CenterNet [J]. Computer Science, 2022, 49(5): 84-91.
[8] ZHAO Chen-yang, ZHANG Hui, LIAO De, LI Chen. Rail Surface Defect Detection Model Based on Attention Module and Hybrid-supervised Learning [J]. Computer Science, 2022, 49(11A): 210800241-6.
[9] PENG Lei, ZHANG Hui. U-net for Pavement Crack Detection [J]. Computer Science, 2021, 48(11A): 616-619.
[10] XIE Yuan, MIAO Yu-bin, XU Feng-lin, ZHANG Ming. Injection-molded Bottle Defect Detection Using Semi-supervised Deep Convolutional Generative Adversarial Network [J]. Computer Science, 2020, 47(7): 92-96.
[11] LUO Yue-tong,BIAN Jing-shuai,ZHANG Meng,RAO Yong-ming,YAN Feng. Detection Method of Chip Surface Weak Defect Based on Convolution Denoising Auto-encoders [J]. Computer Science, 2020, 47(2): 118-125.
[12] HU Hai-bing, XU Ting, ZHANG Bo, XU Dong-jian, JIN Shi-qun, LU Rong-sheng. Application of Open MP and Ring Buffer Technology in Defects Detection of Glass Substrate [J]. Computer Science, 2019, 46(11A): 562-566.
[13] SU Ruo, WU Ji, LIU Chao, YANG Hai-yan. Requirement Defect Detection Based on Multi-view Card Model [J]. Computer Science, 2018, 45(10): 183-188.
[14] ZHU Chao-yang, CHEN Xiang-zhou, YAN Long and ZHANG Xin-ming. Research on Software Defect Prediction Based on AIRS Using PCA [J]. Computer Science, 2017, 44(Z6): 483-485.
[15] QIAO Li, ZHAO Er-dun, LIU Jun-jie and CHENG Bin. Research of Workpiece Defect Detection Method Based on CNN [J]. Computer Science, 2017, 44(Z11): 238-243.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!