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 条
  • [21] Towards Better Code Reviews: Using Mutation Testing to Improve Reviewer Attention
    Mukhtarov, Ziya
    Abdul, Mannan
    Raupova, Mokhlaroyim
    Baghirov, Javid
    Tanveer, Osama
    Altunel, Haluk
    Tuzun, Eray
    2023 IEEE/ACM INTERNATIONAL CONFERENCE ON SOFTWARE AND SYSTEM PROCESSES, ICSSP, 2023, : 92 - 96
  • [22] SRCIROR: A Toolset for Mutation Testing of C Source Code and LLVM Intermediate Representation
    Hariri, Farah
    Shi, August
    PROCEEDINGS OF THE 2018 33RD IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMTED SOFTWARE ENGINEERING (ASE' 18), 2018, : 860 - 863
  • [23] Assessing and improving syntactic adversarial robustness of pre-trained models for code translation
    Yang, Guang
    Zhou, Yu
    Zhang, Xiangyu
    Chen, Xiang
    Han, Tingting
    Chen, Taolue
    INFORMATION AND SOFTWARE TECHNOLOGY, 2025, 181
  • [24] Evaluating the Effects of Compiler Optimizations on Mutation Testing at the Compiler IR Level
    Harir, Farah
    Shi, August
    Converse, Hayes
    Khurshid, Sarfraz
    Marinov, Darko
    2016 IEEE 27TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING (ISSRE), 2016, : 105 - 115
  • [25] Few-shot code translation via task-adapted prompt learning
    Li, Xuan
    Yuan, Shuai
    Gu, Xiaodong
    Chen, Yuting
    Shen, Beijun
    JOURNAL OF SYSTEMS AND SOFTWARE, 2024, 212
  • [26] Mutation Analysis of NGAC Policies
    Chen, Erzhuo
    Dubrovenski, Vladislav
    Xu, Dianxiang
    PROCEEDINGS OF THE 26TH ACM SYMPOSIUM ON ACCESS CONTROL MODELS AND TECHNOLOGIES, SACMAT 2021, 2021, : 71 - 82
  • [27] How to kill them all: An exploratory study on the impact of code observability on mutation testing
    Zhu, Qianqian
    Zaidman, Andy
    Panichella, Annibale
    JOURNAL OF SYSTEMS AND SOFTWARE, 2021, 173
  • [28] A Variability Perspective of Mutation Analysis
    Devroey, Xavier
    Perrouin, Gilles
    Cordy, Maxime
    Papadakis, Mike
    Legay, Axel
    Schobbens, Pierre-Yves
    22ND ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (FSE 2014), 2014, : 841 - 844
  • [29] Locating and Correcting Software Faults in Executable Code Slices via Evolutionary Mutation Testing
    Yiasemis, Pantelis Stylianos
    Andreou, Andreas S.
    ENTERPRISE INFORMATION SYSTEMS, ICEIS 2012, 2013, 141 : 207 - 227
  • [30] A Tool for Mutation Analysis in Racket
    Zhuang, Bambi
    Perretta, James
    Guha, Arjun
    Bell, Jonathan
    2023 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION WORKSHOPS, ICSTW, 2023, : 308 - 313