Mutation analysis for evaluating code translation
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 do...
Saved in:
Main Authors: | , , , , |
---|---|
Format: | text |
Language: | English |
Published: |
Institutional Knowledge at Singapore Management University
2024
|
Subjects: | |
Online Access: | https://ink.library.smu.edu.sg/sis_research/8780 https://ink.library.smu.edu.sg/context/sis_research/article/9783/viewcontent/s10664_023_10385_w.pdf |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Institution: | Singapore Management University |
Language: | English |
id |
sg-smu-ink.sis_research-9783 |
---|---|
record_format |
dspace |
spelling |
sg-smu-ink.sis_research-97832024-05-30T08:59:06Z Mutation analysis for evaluating code translation GUIZZO, Giovani ZHANG, Jie M. SARRO, Federica TREUDE, Christoph HARMAN, Mark 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. 2024-02-01T08:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/8780 info:doi/10.1007/s10664-023-10385-w https://ink.library.smu.edu.sg/context/sis_research/article/9783/viewcontent/s10664_023_10385_w.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Mutation testing Source to source translation Code translation Software Engineering |
institution |
Singapore Management University |
building |
SMU Libraries |
continent |
Asia |
country |
Singapore Singapore |
content_provider |
SMU Libraries |
collection |
InK@SMU |
language |
English |
topic |
Mutation testing Source to source translation Code translation Software Engineering |
spellingShingle |
Mutation testing Source to source translation Code translation Software Engineering GUIZZO, Giovani ZHANG, Jie M. SARRO, Federica TREUDE, Christoph HARMAN, Mark Mutation analysis for evaluating code translation |
description |
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. |
format |
text |
author |
GUIZZO, Giovani ZHANG, Jie M. SARRO, Federica TREUDE, Christoph HARMAN, Mark |
author_facet |
GUIZZO, Giovani ZHANG, Jie M. SARRO, Federica TREUDE, Christoph HARMAN, Mark |
author_sort |
GUIZZO, Giovani |
title |
Mutation analysis for evaluating code translation |
title_short |
Mutation analysis for evaluating code translation |
title_full |
Mutation analysis for evaluating code translation |
title_fullStr |
Mutation analysis for evaluating code translation |
title_full_unstemmed |
Mutation analysis for evaluating code translation |
title_sort |
mutation analysis for evaluating code translation |
publisher |
Institutional Knowledge at Singapore Management University |
publishDate |
2024 |
url |
https://ink.library.smu.edu.sg/sis_research/8780 https://ink.library.smu.edu.sg/context/sis_research/article/9783/viewcontent/s10664_023_10385_w.pdf |
_version_ |
1814047528182611968 |