Mutation analysis for evaluating code translation

被引:1
作者
Guizzo, Giovani [1 ]
Zhang, Jie M. [2 ]
Sarro, Federica [1 ]
Treude, Christoph [3 ]
Harman, Mark [1 ,4 ]
机构
[1] UCL, London, England
[2] Kings Coll London, London, England
[3] Univ Melbourne, Melbourne, Australia
[4] Meta Platforms Inc, Menlo Pk, CA USA
基金
欧洲研究理事会;
关键词
Mutation testing; Source to source translation; Code translation;
D O I
10.1007/s10664-023-10385-w
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Source-to-source code translation automatically translates a program from one programming language to another. The existing research on code translation evaluates the effectiveness of their approaches by using either syntactic similarities (e.g., BLEU score), or test execution results. The former does not consider semantics, the latter considers semantics but falls short on the problem of insufficient data and tests. In this paper, we propose MBTA (Mutation-based Code Translation Analysis), a novel application of mutation analysis for code translation assessment. We also introduce MTS (Mutation-based Translation Score), a measure to compute the level of trustworthiness of a translator. If a mutant of an input program shows different test execution results from its translated version, the mutant is killed and a translation bug is revealed. Fewer killed mutants indicate better code translation. MBTA is novel in the sense that mutants are compared to their translated counterparts, and not to their original program's translation. We conduct a proof-of-concept case study with 612 Java-Python program pairs and 75,082 mutants on the code translators TransCoder and j2py to evaluate the feasibility of MBTA. The results reveal that TransCoder and j2py fail to translate 70.44% and 70.64% of the mutants, respectively, i.e., more than two-thirds of all mutants are incorrectly translated by these translators. By analysing the MTS results more closely, we were able to reveal translation bugs not captured by the conventional comparison between the original and translated programs.
引用
收藏
页数:23
相关论文
共 50 条
  • [1] Mutation analysis for evaluating code translation
    Giovani Guizzo
    Jie M. Zhang
    Federica Sarro
    Christoph Treude
    Mark Harman
    Empirical Software Engineering, 2024, 29
  • [2] Evaluating and Improving Static Analysis Tools Via Differential Mutation Analysis
    Groce, Alex
    Ahmed, Iftekhar
    Feist, Josselin
    Grieco, Gustavo
    Gesi, Jiri
    Meidani, Mehran
    Chen, Qihong
    2021 IEEE 21ST INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY (QRS 2021), 2021, : 207 - 218
  • [3] Spotting Code Mutation for Predictive Mutation Testing
    Zhao, Yifan
    Chen, Yizhou
    Sun, Zeyu
    Liang, Qingyuan
    Wang, Guoqing
    Hao, Dan
    PROCEEDINGS OF 2024 39TH ACM/IEEE INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE 2024, 2024, : 1133 - 1145
  • [4] Code Search based on Context-aware Code Translation
    Sun, Weisong
    Fang, Chunrong
    Chen, Yuchen
    Tao, Guanhong
    Han, Tingxu
    Zhang, Quanjun
    2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2022), 2022, : 388 - 400
  • [5] Efficient mutation testing of multithreaded code
    Gligoric, Milos
    Jagannath, Vilas
    Luo, Qingzhou
    Marinov, Darko
    SOFTWARE TESTING VERIFICATION & RELIABILITY, 2013, 23 (05) : 375 - 403
  • [6] On the Evaluation of Neural Code Translation: Taxonomy and Benchmark
    Jiao, Mingsheng
    Yu, Tingrui
    Li, Xuan
    Qiu, Guanjie
    Gu, Xiaodong
    Shen, Beijun
    2023 38TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE, 2023, : 1529 - 1541
  • [7] MuMonDE: A framework for evaluating model clone detectors using model mutation analysis
    Stephan, Matthew
    Cordy, James R.
    SOFTWARE TESTING VERIFICATION & RELIABILITY, 2019, 29 (1-2)
  • [8] TransMap: Pinpointing Mistakes in Neural Code Translation
    Wang, Bo
    Li, Ruishi
    Li, Mingkai
    Saxena, Prateek
    PROCEEDINGS OF THE 31ST ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2023, 2023, : 999 - 1011
  • [9] GlueTest: Testing Code Translation via Language Interoperability
    Abid, Muhammad Salman
    Pawagi, Mrigank
    Adhikari, Sugam
    Cheng, Xuyan
    Badr, Ryed
    Wahiduzzaman, Md
    Rathi, Vedant
    Qi, Ronghui
    Li, Choiyin
    Liu, Lu
    Naidu, Rohit Sai
    Lin, Licheng
    Liu, Que
    Palak, Asif Zubayer
    Haque, Mehzabin
    Chen, Xinyu
    Marinov, Darko
    Dutta, Saikat
    2024 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION, ICSME 2024, 2024, : 612 - 617
  • [10] hmCodeTrans: Human-Machine Interactive Code Translation
    Liu, Jiaqi
    Zhang, Fengming
    Zhang, Xin
    Yu, Zhiwen
    Wang, Liang
    Zhang, Yao
    Guo, Bin
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2024, 50 (05) : 1163 - 1181