Computer Science ›› 2026, Vol. 53 ›› Issue (10): 320-335.doi: 10.11896/jsjkx.250900140

• Computer Software • Previous Articles     Next Articles

Semantic-driven Execution-based Framework for Code Quality Evaluation

ZHANG Sai1, XU Fangzhou1, ZHANG Xiaowang1, HAN Yahong1, XING Zhenchang2, FENG Zhiyong1   

  1. 1 College of Intelligence and Computing,Tianjin University,Tianjin 300354, China
    2 Data61,Commonwealth Scientific and Industrial Research Organisation,Canberra 2603,Australian
  • Received:2025-09-24 Revised:2026-01-24 Published:2026-10-13
  • About author:ZHANG Sai,born in 1994,postgra-duate.Her main research interests include intelligent software engineering,large language models,and software testing.
    ZHANG Xiaowang,born in 1980,Ph.D,professor,Ph.D supervisor,is a senior member of CCF(No.48571S).His main research interests include knowledge graphs,natural language processing,graph database systems,and software security.
  • Supported by:
    Guizhou Provincial Major Scientific and Technological Program([2024]002).

Abstract: Code quality evaluation is the process of autonomously measuring and scoring code quality for specific tasks.Existing evaluation techniques can be broadly divided into match-based and execution-based approaches.The former emphasizes static textual comparison with reference code,making it difficult to assess semantic differences in program behavior comprehensively.The latter depends on large numbers of manually or semi-automatically constructed test cases,which are costly to build and have limi-ted coverage.With the rapid development of large language models(LLMs),an increasing number of studies are using LLMs as automatic evaluators.However,in realistic scenarios where complete test suites and high-quality reference code are often unavailable,how to mitigate hallucinations in LLM reasoning and obtain automated evaluation results that are highly consistent with expert judgments and actual execution behavior remains a key open problem.To this end,this paper proposes SDEval,a semantic-driven execution framework for code quality evaluation,together with its fine-grained scoring variant SDEval-FG.Firstly,the framework performs recursive semantic understanding,decomposing complex programs into fine-grained semantic units and conducting layered reasoning to strengthen comprehension of control-flow and data-flow relationships,capture logical dependencies among code fragments,and suppress hallucinations.It then constructs a dynamic,semantic-driven execution perspective through automatic test-case generation and completion,enabling the LLM to consider both semantic correctness and functional completeness,thereby bridging the gap between code text and actual execution behavior.Compared with existing methods that mainly aim to improve test-case generation and coverage,SDEval shifts the evaluation focus from generating high-quality test cases to interpretable,defect-category-oriented scoring,thus enhancing its correlation with human expert judgments.Experimental results show that on the HumanEval dataset,SDEval improves the Pearson correlation coefficient by 11.86% over the execution-based ChatTester,and on the CodePair dataset,the SDEval-FG variant achieves a 31.4% improvement in Pearson correlation over the CoT-prompting baseline.

Key words: Code quality evaluation, Code semantic representation, Test case generation, Defect identification, Large language models

CLC Number: 

  • TP311
[1] ZHUO T Y.ICE-Score:Instructing Large Language Models to Evaluate Code [C]//EACL 2024.ACL,2024:2232-2242.
[2] REN S,GUO D,LU S,et al.CodeBLEU:A Method for Automatic Evaluation of Code Synthesis [PP/OL].arXiv(2020-09-22)[2026-08-19].https://arxiv.org/abs/2009.10297.
[3] LIU K,HAN Y,ZHANG J M,et al.Who Judges the Judge:AnEmpirical Study on Online Judge Tests [C]//Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis(ISSTA 2023).ACM,2023:334-346.
[4] LU S,GUO D,REN S,et al.CodeXGLUE:A Machine Learning Benchmark Dataset for Code Understanding and Generation [C]//NeurIPS 2021 Datasets and Benchmarks.Curran Asso-ciates,2021.
[5] LE H,WANG Y,GOTMARE A D,et al.CodeRL:Mastering Code Generation Through Pretrained Models and Deep Reinforcement Learning [J].Advances in Neural Information Processing Systems,2022,35:21314-21328.
[6] ZAN D,CHEN B,ZHANG F,et al.Large Language ModelsMeet NL2Code:A Survey [C]//ACL 2023.ACL,2023:7443-7464.
[7] WANG D Y,MO R,ZHAN W J,et al.Analysis of the Code Quality of the Code Automatic Generation Tool GitHub Copilot [J].Computer Science,2025,52(7):37-49.
[8] KULAL S,PASUPAT P,CHANDRA K,et al.SPoC:Search-Based Pseudocode to Code [C]//Advances in Neural Information Processing Systems 32(NeurIPS 2019).Curran Associates,2019.
[9] HENDRYCKS D,BASART S,KADAVATH S,et al.Measu-ring Coding Challenge Competence with APPS [PP/OL]. arXiv(2021-05-20)[2026-08-19].https://doi.org/10.48550/arXiv.2105.09938.
[10] ZHOU S,ALON U,AGARWAL S,et al.CodeBERTScore:Evaluating Code Generation with Pretrained Models of Code [C]//Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing(EMNLP 2023).ACL,2023.
[11] LI K,YUAN Y.Large Language Models as Test Case Generators:Performance Evaluation and Enhancement [PP/OL].arXiv(2024-04-20)[2026-08-19].https://arxiv.org/abs/2404.13340.
[12] YUAN Z,LOU Y,LIU M,et al.No More Manual Tests? Evaluating and Improving ChatGPT for Unit Test Generation [PP/OL].arXiv(2023-05-07)[2026-08-19].https://arxiv.org/abs/2305.04207.
[13] PAPINENI K,ROUKOS S,WARD T,et al.BLEU:a Method for Automatic Evaluation of Machine Translation [C]//Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics.ACL,2002:311-318.
[14] LIN C Y.ROUGE:A Package for Automatic Evaluation ofSummaries [C]//Text Summarization Branches Out.ACL,2004:74-81.
[15] EVTIKHIEV M,BOGOMOLOV E,SOKOLOV Y,et al.Out of the BLEU:How Should We Assess Quality of the Code Generation Models? [J].Journal of Systems and Software,2023,203:111741.
[16] DEVLIN J,CHANG M W,LEE K,et al.BERT:Pre-training of Deep Bidirectional Transformers for Language Understanding [C]//Proceedings of NAACL-HLT 2019.ACL,2019:4171-4186.
[17] ACHIAM J,ADLER S,AGARWAL S,et al.GPT-4 Technical Report [PP/OL].arXiv(2023-12-19)[2026-08-19].https://arxiv.org/html/2303.08774v4.
[18] CHEN X T,YE J J,ZU C,et al.Robustness of GPT Family of Large Language Models in Natural Language Processing Tasks [J].Journal of Computer Research and Development,2024,61(5):1128-1142.
[19] JI Z,LEE N,FRIESKE R,et al.Survey of Hallucination in Na-tural Language Generation [J].ACM Computing Surveys,2023,55(12):1-38.
[20] CRESWELL A,SHANAHAN M.Faithful Reasoning UsingLarge Language Models [PP/OL].arXiv(2022-08-30)[2026-08-19].https://arxiv.org/abs/2208.14271.
[21] ZHONG M,LIU Y,YIN D,et al.Towards a Unified Multi-Dimensional Evaluator for Text Generation [C]//Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing.ACL,2022:2023-2038.
[22] WANG Z P,HE T K,ZHAO R Y,et al.Exploration and Im-provement of Capabilities of LLMs in Code Refinement Task [J].Journal of Software,2025,36(6):2477-2500.
[23] KUKICH K.Techniques for Automatically Correcting Words inText [J].ACM Computing Surveys,1992,24(4):377-439.
[24] JACCARD P.Étude comparative de la distribution florale dans une portion des Alpes et du Jura [J].Bulletin de la Société Vaudoise des Sciences Naturelles,1901,37:547-579.
[25] DICE L R.Measures of the Amount of Ecologic Association Between Species [J].Ecology,1945,26(3):297-302.
[26] BANERJEE S,LAVIE A.METEOR:An Automatic Metric for MT Evaluation with Improved Correlation with Human Judgments [C]//ACL Workshop on Intrinsic and Extrinsic Evaluation Measures for Machine Translation and/or Summarization.ACL,2005:65-72.
[27] POPOVIČ M.chrF:Character N-gram F-score for AutomaticMT Evaluation [C]//Proceedings of the Tenth Workshop on Statistical Machine Translation.ACL,2015:392-395.
[28] CHEN M,TWOREK J,JUN H,et al.Evaluating large language models trained on code [PP/OL].arXiv[2026-09-11].https://arxiv.org/abs/2107.03374.
[29] LING W,BLUNSOM P,GREFENSTETTE E,et al.LatentPredictor Networks for Code Generation [C]//Proceedings of the 54th Annual Meeting of the ACL(ACL 2016).ACL,2016:599-609.
[30] CHEN M,TWOREK J,JUN H,et al.Evaluating Large Lan-guage Models Trained on Code [PP/OL].arXiv(2021-07-07)[2026-08-19].https://arxiv.org/abs/2107.03374.
[31] CADAR C,DUNBAR D,ENGLER D R,et al.KLEE:Unassis-ted and Automatic Generation of High-Coverage Tests for Complex Systems Programs [C]//Proceedings of the 8th USENIX Symposium on Operating Systems Design and Implementation(OSDI 2008).USENIX Association,2008:209-224.
[32] FRASER G,ARCURI A.EvoSuite:Automatic Test Suite Generation for Object-Oriented Software [C]//Proceedings of the 2011 European Software Engineering Conference and Symposium on the Foundations of Software Engineering(ESEC/FSE 2011).ACM,2011:416-419.
[33] XIA C S,PALTENGHI M,TIAN J L,et al.Fuzz4All:UniversalFuzzing with Large Language Models [C]//Proceedings of the 46th IEEE/ACM International Conference on Software Engineering(ICSE 2024).IEEE/ACM,2024.
[34] MENG R,XIA Z,MIAO H,et al.Large Language ModelGuided Protocol Fuzzing [C]//Network and Distributed System Security Symposium(NDSS 2024).Internet Society,2024.
[35] ZHAO X L,PAN X L,ZOU Y Z,et al.Research on Comment Quality Evaluation for Code Comment Generation Tasks [J].Journal of Software,2025,36(8):3744-3768.
[36] TRAN N,TRAN H,NGUYEN S,et al.Does BLEU ScoreWork for Code Migration? [C]//Proceedings of the 2019 IEEE/ACM 27th International Conference on Program Comprehension(ICPC).IEEE,2019:165-176.
[37] HU T,XU Z,FANG Y,et al.Fine-Grained Code Clone Detection with Block-Based Splitting of Abstract Syntax Tree [C]//Proceedings of the 32nd ACM SIGSOFT International Sympo-sium on Software Testing and Analysis(ISSTA 2023).ACM,2023:89-100.
[38] SHI E,WANG Y,DU L,et al.CoCoAST:Representing Source Code via Hierarchical Splitting and Reconstruction of Abstract Syntax Trees [J].Empirical Software Engineering,2023,28(6):1-41.
[39] CHOI Y,KIM H,LEE J H.BLOCSUM:Block Scope-BasedSource Code Summarization via Shared Block Representation [C]//Findings of the Association for Computational Linguistics:ACL 2023.ACL,2023:11427-11441.
[40] YU D Q,PENG X,ZHAO W Y.Automatic Refactoring Method of Clone Code Using Abstract Syntax Tree and Static Analysis [J].Small & Microcomputer Systems,2009,30(9):1752-1760.
[41] CASSANO F,GOUWAR J,NGUYEN D,et al.MultiPL-E:A Scalable and Polyglot Approach to Benchmarking Neural Code Generation [J].IEEE Transactions on Software Engineering,2023,49(7):3675-3691.
[42] PURI R,KUNG D S,JANSSEN G,et al.CodeNet:A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Tasks [PP/OL].arXiv(2021-05-25)[2026-08-19].https://arxiv.org/abs/2105.12655.
[43] NAIR P R.Increasing Employability of Indian EngineeringGraduates Through Experiential Learning Programs and Competitive Programming:A Case Study [J].Procedia Computer Science,2020,172:831-837.
[44] DAS D,MATHEWS N S,CHIMALAKONDA S.Exploring Security Vulnerabilities in Competitive Programming:An Empirical Study [C]//Proceedings of the 26th International Confe-rence on Evaluation and Assessment in Software Engineering(EASE 2022).ACM,2022:110-119.
[45] WAN T,JUN H,PAN W,et al.Kappa Coefficient:A Popular Measure of Rater Agreement [J].Shanghai Archives of Psy-chiatry,2015,27(1):62-67.
[46] GILL G K,KEMERER C F.Cyclomatic Complexity Density and Software Maintenance Productivity [J].IEEE Transactions on Software Engineering,1991,17(12):1284-1288.
[1] LI Zhennan, QIAN Jiayan, WANG Xinzhi, ZHANG Hui. Technology Risk Structure Recognition Based on Multi-granularity Semantic Dual Reflection [J]. Computer Science, 2026, 53(9): 395-404.
[2] HE Jiaojun, LI Xin. Review of Graph Learning Based on Large Language Models:Methods,Benchmarks and Advances [J]. Computer Science, 2026, 53(9): 1-15.
[3] LI Luozheng, LI Lingbo, YUAN Quan. Survey of Chinese Datasets for LLM Safety Alignment:Landscape and Prospects [J]. Computer Science, 2026, 53(9): 16-23.
[4] ZHANG Rongjie, PANG Xiongwen, WANG Fengling. Review of Large Language Model-based Time Series Modeling via Fine-tuning and AgentArchitecture [J]. Computer Science, 2026, 53(9): 55-70.
[5] GUO Yuyang, SHI Lei, LIU Huan, DONG Yixiang, LI Rui. Domain-adapted and Dynamically Retrieval-augmented Approach for Large-scale History Discipline Model Construction [J]. Computer Science, 2026, 53(9): 92-100.
[6] LIU Jing. Review of Music Artificial Intelligence Driven by Large Language Models [J]. Computer Science, 2026, 53(8): 229-244.
[7] ZHANG Haoran, HAO Wenning, JIN Dawei, CHENG Kai, LIU Junyang. Agentic Retrieval Augmented Generation Framework Based on Retrieval Task Planning and Reflection Mechanism [J]. Computer Science, 2026, 53(8): 285-297.
[8] FAN Ruxin, SUN Baicai, GONG Lina, YAO Xiangjuan, GONG Dunwei. Test Case Generation and Prioritization for Program Fault Diagnosis Based on Large LanguageModel [J]. Computer Science, 2026, 53(8): 365-374.
[9] CHEN Zhixiang, XIE Zhipeng. Event Causal Data Augmentation Method Based on Large Language Model [J]. Computer Science, 2026, 53(7): 125-131.
[10] XU Rui, LIU Jin, LIU Xudong, GUAN Jian, DONG Wei. Exploring the Generalization Ability of Prompt-based Large Language Models for TextClassification [J]. Computer Science, 2026, 53(6A): 250400092-7.
[11] WEI Qing, ZHANG Yupeng, LIU Shaoxun, ZHANG Jinfeng, ZHANG Yuezhong, CHEN Haoyang. Fuzzing Driver Generation Based on Large Language Models [J]. Computer Science, 2026, 53(6A): 250400113-8.
[12] ZHANG Yongyu, GUO Chenjuan, FEI Xueqin, LI Feng. Study on Financial Text Sentiment Analysis Method Based on Large Language Models with Market Feedback Supervision [J]. Computer Science, 2026, 53(6A): 250500073-14.
[13] SHI Hongxu, LIU Yi, LIU Kun. Survey of Recommendation Systems Based on Large Language Models [J]. Computer Science, 2026, 53(6): 281-303.
[14] WANG Shenghui, LI Teng. Innovative Automated Scoring Based on Large Language Models [J]. Computer Science, 2026, 53(5): 90-98.
[15] LIU Suyi, LIU Qi, GAO Weibo. Agent4Stu:Efficient LLM-based Student Answer Behavior Simulation Agent [J]. Computer Science, 2026, 53(4): 347-355.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!