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 条
  • [31] μ2: Using Mutation Analysis to Guide Mutation-Based Fuzzing
    Laybourn, Isabella
    2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS (ICSE-COMPANION 2022), 2022, : 331 - 333
  • [32] Definition and Evaluation of Mutation Operators for GUI-level Mutation Analysis
    Oliveira, Rafael A. P.
    Alegroth, Emil
    Gao, Zebao
    Memon, Atif
    2015 IEEE EIGHTH INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION WORKSHOPS (ICSTW), 2015,
  • [33] A (Reverse) Mutation Testing Approach to Automatically generate parallel C/C plus plus Code
    Calanna, Salvatore
    Calvagna, Andrea
    Campisi, Salvatore
    Fornaia, Andrea
    Pappalardo, Giuseppe
    Torrisi, Riccardo
    Tramontana, Emiliano
    2021 IEEE 30TH INTERNATIONAL CONFERENCE ON ENABLING TECHNOLOGIES: INFRASTRUCTURE FOR COLLABORATIVE ENTERPRISES (WETICE 2021), 2021, : 159 - 164
  • [34] Reconfigurable all-optical code translation in spectrally phase-coded O-CDMA
    Jiang, Z
    Seo, DS
    Leaird, DE
    Roussev, RV
    Langrock, C
    Fejer, MM
    Weiner, AM
    JOURNAL OF LIGHTWAVE TECHNOLOGY, 2005, 23 (06) : 1979 - 1990
  • [35] swCUDA: Auto parallel code translation framework from CUDA to ATHREAD for new generation sunway supercomputer
    Yu, Maoxue
    Ma, Guanghao
    Wang, Zhuoya
    Tang, Shuai
    Chen, Yuhu
    Wang, Yucheng
    Liu, Yuanyuan
    Jia, Dongning
    Wei, Zhiqiang
    CCF TRANSACTIONS ON HIGH PERFORMANCE COMPUTING, 2024, 6 (04) : 439 - 458
  • [36] Analysis of mutation operators for FSM testing
    Azmoudeh, Dania Nikbin
    Labiche, Yvan
    2023 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION WORKSHOPS, ICSTW, 2023, : 300 - 307
  • [37] An Analysis and Survey of the Development of Mutation Testing
    Jia, Yue
    Harman, Mark
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2011, 37 (05) : 649 - 678
  • [38] New Theory for Code-translation; Punctuator and Qualifier as Two Token Categories and Supplementary Concepts of Programming
    Hutabarat, Bernaridho I.
    PROCEEDINGS OF THE 2015 INTERNATIONAL CONFERENCE ON SOFT COMPUTING AND SOFTWARE ENGINEERING (SCSE'15), 2015, 62 : 282 - 286
  • [39] On the Reuse of TLM Mutation Analysis at RTL
    Guarnieri, Valerio
    Di Guglielmo, Giuseppe
    Bombieri, Nicola
    Pravadelli, Graziano
    Fummi, Franco
    Hantson, Hanno
    Raik, Jaan
    Jenihhin, Maksim
    Ubar, Raimund
    JOURNAL OF ELECTRONIC TESTING-THEORY AND APPLICATIONS, 2012, 28 (04): : 435 - 448
  • [40] Mutation Analysis for SQL Database Applications
    Cabeca, Andrea Goncalves
    Jino, Mario
    Leitao-Junior, Plinio S.
    2009 FOURTH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING ADVANCES (ICSEA 2009), 2009, : 146 - +