Loading…

MR-Adopt: Automatic Deduction of Input Transformation Function for Metamorphic Testing

While a recent study reveals that many developer-written test cases can encode a reusable Metamorphic Relation (MR), over 70% of them directly hard-code the source input and follow-up input in the encoded relation. Such encoded MRs, which do not contain an explicit input transformation to transform...

Full description

Saved in:
Bibliographic Details
Main Authors: Xu, Congying, Chen, Songqiang, Wu, Jiarong, Cheung, Shing-Chi, Terragni, Valerio, Zhu, Hengcheng, Cao, Jialun
Format: Conference Proceeding
Language:English
Subjects:
Online Access:Request full text
Tags: Add Tag
No Tags, Be the first to tag this record!
cited_by
cites
container_end_page 569
container_issue
container_start_page 557
container_title
container_volume
creator Xu, Congying
Chen, Songqiang
Wu, Jiarong
Cheung, Shing-Chi
Terragni, Valerio
Zhu, Hengcheng
Cao, Jialun
description While a recent study reveals that many developer-written test cases can encode a reusable Metamorphic Relation (MR), over 70% of them directly hard-code the source input and follow-up input in the encoded relation. Such encoded MRs, which do not contain an explicit input transformation to transform the source inputs to corresponding follow-up inputs, cannot be reused with new source inputs to enhance test adequacy. In this paper, we propose MR-Adopt (Automatic Deduction Of inPut Transformation) to automatically deduce the input transformation from the hard-coded source and follow-up inputs, aiming to enable the encoded MRs to be reused with new source inputs. With typically only one pair of source and follow-up inputs available in an MR-encoded test case as the example, we leveraged LLMs to understand the intention of the test case and generate additional examples of source-followup input pairs. This helps to guide the generation of input transformations generalizable to multiple source inputs. Besides, to mitigate the issue that LLMs generate erroneous code, we refine LLM-generated transformations by removing MR-irrelevant code elements with data-flow analysis. Finally, we assess candidate transformations based on encoded output relations and select the best transformation as the result. Evaluation results show that MR-Adopt can generate input transformations applicable to all experimental source inputs for 72.00% of encoded MRs, which is 33.33% more than using vanilla GPT-3.5. By incorporating MR-Adopt-generated input transformations, encoded MR-based test cases can effectively enhance the test adequacy, increasing the line coverage and mutation score by 10.62% and 18.91%, respectively.
doi_str_mv 10.1145/3691620.3696020
format conference_proceeding
fullrecord <record><control><sourceid>acm_CHZPO</sourceid><recordid>TN_cdi_ieee_primary_10764814</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><ieee_id>10764814</ieee_id><sourcerecordid>acm_books_10_1145_3691620_3696020</sourcerecordid><originalsourceid>FETCH-LOGICAL-a934-2938ffe57509dca72ab4b3a23fabb6d97c4edff1a4e2f821cbcc1e142781b8f43</originalsourceid><addsrcrecordid>eNqNkDtPwzAUhQ0Iiap0ZmHIyJLiazt-sFWFQqVWSChitWzHBgsSR3kM_HtStRMT05HO9907HIRuAC8BWHFPuQJO8HJKjgk-QwsllGQYCyBMinM0I5zRHApBLv6wK7To-2jxhAoOwGfoff-Wr6rUDg_ZahxSbYboskdfjW6IqclSyLZNOw5Z2ZmmD6k7CFO_GZujMFXZ3g-mTl37OZ2Wvh9i83GNLoP57v3ilHNUbp7K9Uu-e33erle73CjKcqKoDMEXosCqckYQY5mlhtBgrOWVEo75KgQwzJMgCTjrHHhgREiwMjA6R7fHt9F7r9su1qb70YAFZxIO-O6Ijau1Temrn5g-jKhPI-rTiJO6_KeqbRd9oL8S4G30</addsrcrecordid><sourcetype>Publisher</sourcetype><iscdi>true</iscdi><recordtype>conference_proceeding</recordtype></control><display><type>conference_proceeding</type><title>MR-Adopt: Automatic Deduction of Input Transformation Function for Metamorphic Testing</title><source>IEEE Xplore All Conference Series</source><creator>Xu, Congying ; Chen, Songqiang ; Wu, Jiarong ; Cheung, Shing-Chi ; Terragni, Valerio ; Zhu, Hengcheng ; Cao, Jialun</creator><creatorcontrib>Xu, Congying ; Chen, Songqiang ; Wu, Jiarong ; Cheung, Shing-Chi ; Terragni, Valerio ; Zhu, Hengcheng ; Cao, Jialun</creatorcontrib><description>While a recent study reveals that many developer-written test cases can encode a reusable Metamorphic Relation (MR), over 70% of them directly hard-code the source input and follow-up input in the encoded relation. Such encoded MRs, which do not contain an explicit input transformation to transform the source inputs to corresponding follow-up inputs, cannot be reused with new source inputs to enhance test adequacy. In this paper, we propose MR-Adopt (Automatic Deduction Of inPut Transformation) to automatically deduce the input transformation from the hard-coded source and follow-up inputs, aiming to enable the encoded MRs to be reused with new source inputs. With typically only one pair of source and follow-up inputs available in an MR-encoded test case as the example, we leveraged LLMs to understand the intention of the test case and generate additional examples of source-followup input pairs. This helps to guide the generation of input transformations generalizable to multiple source inputs. Besides, to mitigate the issue that LLMs generate erroneous code, we refine LLM-generated transformations by removing MR-irrelevant code elements with data-flow analysis. Finally, we assess candidate transformations based on encoded output relations and select the best transformation as the result. Evaluation results show that MR-Adopt can generate input transformations applicable to all experimental source inputs for 72.00% of encoded MRs, which is 33.33% more than using vanilla GPT-3.5. By incorporating MR-Adopt-generated input transformations, encoded MR-based test cases can effectively enhance the test adequacy, increasing the line coverage and mutation score by 10.62% and 18.91%, respectively.</description><identifier>ISBN: 9798400712487</identifier><identifier>EISSN: 2643-1572</identifier><identifier>EISBN: 9798400712487</identifier><identifier>DOI: 10.1145/3691620.3696020</identifier><identifier>CODEN: IEEPAD</identifier><language>eng</language><publisher>New York, NY, USA: ACM</publisher><subject>Code Generation ; Codes ; Debugging ; Input Transformation ; Large Language Models ; Metamorphic Relation ; Metamorphic Testing ; Software ; Software and its engineering -- Software creation and management -- Software verification and validation -- Software defect analysis -- Software testing and debugging ; Software engineering ; Software testing ; Transforms</subject><ispartof>IEEE/ACM International Conference on Automated Software Engineering : [proceedings], 2024, p.557-569</ispartof><rights>2024 Copyright is held by the owner/author(s). Publication rights licensed to ACM.</rights><woscitedreferencessubscribed>false</woscitedreferencessubscribed><orcidid>0000-0002-3082-5957 ; 0000-0001-6126-303X ; 0000-0002-1220-8728 ; 0000-0003-4892-6294 ; 0000-0001-5885-9297 ; 0009-0000-2887-1690 ; 0000-0002-3508-7172</orcidid></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><linktohtml>$$Uhttps://ieeexplore.ieee.org/document/10764814$$EHTML$$P50$$Gieee$$H</linktohtml><link.rule.ids>309,310,776,780,785,786,27904,54534,54911</link.rule.ids><linktorsrc>$$Uhttps://ieeexplore.ieee.org/document/10764814$$EView_record_in_IEEE$$FView_record_in_$$GIEEE</linktorsrc></links><search><creatorcontrib>Xu, Congying</creatorcontrib><creatorcontrib>Chen, Songqiang</creatorcontrib><creatorcontrib>Wu, Jiarong</creatorcontrib><creatorcontrib>Cheung, Shing-Chi</creatorcontrib><creatorcontrib>Terragni, Valerio</creatorcontrib><creatorcontrib>Zhu, Hengcheng</creatorcontrib><creatorcontrib>Cao, Jialun</creatorcontrib><title>MR-Adopt: Automatic Deduction of Input Transformation Function for Metamorphic Testing</title><title>IEEE/ACM International Conference on Automated Software Engineering : [proceedings]</title><addtitle>ASE</addtitle><description>While a recent study reveals that many developer-written test cases can encode a reusable Metamorphic Relation (MR), over 70% of them directly hard-code the source input and follow-up input in the encoded relation. Such encoded MRs, which do not contain an explicit input transformation to transform the source inputs to corresponding follow-up inputs, cannot be reused with new source inputs to enhance test adequacy. In this paper, we propose MR-Adopt (Automatic Deduction Of inPut Transformation) to automatically deduce the input transformation from the hard-coded source and follow-up inputs, aiming to enable the encoded MRs to be reused with new source inputs. With typically only one pair of source and follow-up inputs available in an MR-encoded test case as the example, we leveraged LLMs to understand the intention of the test case and generate additional examples of source-followup input pairs. This helps to guide the generation of input transformations generalizable to multiple source inputs. Besides, to mitigate the issue that LLMs generate erroneous code, we refine LLM-generated transformations by removing MR-irrelevant code elements with data-flow analysis. Finally, we assess candidate transformations based on encoded output relations and select the best transformation as the result. Evaluation results show that MR-Adopt can generate input transformations applicable to all experimental source inputs for 72.00% of encoded MRs, which is 33.33% more than using vanilla GPT-3.5. By incorporating MR-Adopt-generated input transformations, encoded MR-based test cases can effectively enhance the test adequacy, increasing the line coverage and mutation score by 10.62% and 18.91%, respectively.</description><subject>Code Generation</subject><subject>Codes</subject><subject>Debugging</subject><subject>Input Transformation</subject><subject>Large Language Models</subject><subject>Metamorphic Relation</subject><subject>Metamorphic Testing</subject><subject>Software</subject><subject>Software and its engineering -- Software creation and management -- Software verification and validation -- Software defect analysis -- Software testing and debugging</subject><subject>Software engineering</subject><subject>Software testing</subject><subject>Transforms</subject><issn>2643-1572</issn><isbn>9798400712487</isbn><isbn>9798400712487</isbn><fulltext>true</fulltext><rsrctype>conference_proceeding</rsrctype><creationdate>2024</creationdate><recordtype>conference_proceeding</recordtype><sourceid>6IE</sourceid><recordid>eNqNkDtPwzAUhQ0Iiap0ZmHIyJLiazt-sFWFQqVWSChitWzHBgsSR3kM_HtStRMT05HO9907HIRuAC8BWHFPuQJO8HJKjgk-QwsllGQYCyBMinM0I5zRHApBLv6wK7To-2jxhAoOwGfoff-Wr6rUDg_ZahxSbYboskdfjW6IqclSyLZNOw5Z2ZmmD6k7CFO_GZujMFXZ3g-mTl37OZ2Wvh9i83GNLoP57v3ilHNUbp7K9Uu-e33erle73CjKcqKoDMEXosCqckYQY5mlhtBgrOWVEo75KgQwzJMgCTjrHHhgREiwMjA6R7fHt9F7r9su1qb70YAFZxIO-O6Ijau1Temrn5g-jKhPI-rTiJO6_KeqbRd9oL8S4G30</recordid><startdate>20241027</startdate><enddate>20241027</enddate><creator>Xu, Congying</creator><creator>Chen, Songqiang</creator><creator>Wu, Jiarong</creator><creator>Cheung, Shing-Chi</creator><creator>Terragni, Valerio</creator><creator>Zhu, Hengcheng</creator><creator>Cao, Jialun</creator><general>ACM</general><scope>6IE</scope><scope>6IL</scope><scope>CBEJK</scope><scope>RIE</scope><scope>RIL</scope><orcidid>https://orcid.org/0000-0002-3082-5957</orcidid><orcidid>https://orcid.org/0000-0001-6126-303X</orcidid><orcidid>https://orcid.org/0000-0002-1220-8728</orcidid><orcidid>https://orcid.org/0000-0003-4892-6294</orcidid><orcidid>https://orcid.org/0000-0001-5885-9297</orcidid><orcidid>https://orcid.org/0009-0000-2887-1690</orcidid><orcidid>https://orcid.org/0000-0002-3508-7172</orcidid></search><sort><creationdate>20241027</creationdate><title>MR-Adopt: Automatic Deduction of Input Transformation Function for Metamorphic Testing</title><author>Xu, Congying ; Chen, Songqiang ; Wu, Jiarong ; Cheung, Shing-Chi ; Terragni, Valerio ; Zhu, Hengcheng ; Cao, Jialun</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-LOGICAL-a934-2938ffe57509dca72ab4b3a23fabb6d97c4edff1a4e2f821cbcc1e142781b8f43</frbrgroupid><rsrctype>conference_proceedings</rsrctype><prefilter>conference_proceedings</prefilter><language>eng</language><creationdate>2024</creationdate><topic>Code Generation</topic><topic>Codes</topic><topic>Debugging</topic><topic>Input Transformation</topic><topic>Large Language Models</topic><topic>Metamorphic Relation</topic><topic>Metamorphic Testing</topic><topic>Software</topic><topic>Software and its engineering -- Software creation and management -- Software verification and validation -- Software defect analysis -- Software testing and debugging</topic><topic>Software engineering</topic><topic>Software testing</topic><topic>Transforms</topic><toplevel>online_resources</toplevel><creatorcontrib>Xu, Congying</creatorcontrib><creatorcontrib>Chen, Songqiang</creatorcontrib><creatorcontrib>Wu, Jiarong</creatorcontrib><creatorcontrib>Cheung, Shing-Chi</creatorcontrib><creatorcontrib>Terragni, Valerio</creatorcontrib><creatorcontrib>Zhu, Hengcheng</creatorcontrib><creatorcontrib>Cao, Jialun</creatorcontrib><collection>IEEE Electronic Library (IEL) Conference Proceedings</collection><collection>IEEE Proceedings Order Plan All Online (POP All Online) 1998-present by volume</collection><collection>IEEE Xplore All Conference Proceedings</collection><collection>IEEE Electronic Library (IEL)</collection><collection>IEEE Proceedings Order Plans (POP All) 1998-Present</collection></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext_linktorsrc</fulltext></delivery><addata><au>Xu, Congying</au><au>Chen, Songqiang</au><au>Wu, Jiarong</au><au>Cheung, Shing-Chi</au><au>Terragni, Valerio</au><au>Zhu, Hengcheng</au><au>Cao, Jialun</au><format>book</format><genre>proceeding</genre><ristype>CONF</ristype><atitle>MR-Adopt: Automatic Deduction of Input Transformation Function for Metamorphic Testing</atitle><btitle>IEEE/ACM International Conference on Automated Software Engineering : [proceedings]</btitle><stitle>ASE</stitle><date>2024-10-27</date><risdate>2024</risdate><spage>557</spage><epage>569</epage><pages>557-569</pages><eissn>2643-1572</eissn><isbn>9798400712487</isbn><eisbn>9798400712487</eisbn><coden>IEEPAD</coden><abstract>While a recent study reveals that many developer-written test cases can encode a reusable Metamorphic Relation (MR), over 70% of them directly hard-code the source input and follow-up input in the encoded relation. Such encoded MRs, which do not contain an explicit input transformation to transform the source inputs to corresponding follow-up inputs, cannot be reused with new source inputs to enhance test adequacy. In this paper, we propose MR-Adopt (Automatic Deduction Of inPut Transformation) to automatically deduce the input transformation from the hard-coded source and follow-up inputs, aiming to enable the encoded MRs to be reused with new source inputs. With typically only one pair of source and follow-up inputs available in an MR-encoded test case as the example, we leveraged LLMs to understand the intention of the test case and generate additional examples of source-followup input pairs. This helps to guide the generation of input transformations generalizable to multiple source inputs. Besides, to mitigate the issue that LLMs generate erroneous code, we refine LLM-generated transformations by removing MR-irrelevant code elements with data-flow analysis. Finally, we assess candidate transformations based on encoded output relations and select the best transformation as the result. Evaluation results show that MR-Adopt can generate input transformations applicable to all experimental source inputs for 72.00% of encoded MRs, which is 33.33% more than using vanilla GPT-3.5. By incorporating MR-Adopt-generated input transformations, encoded MR-based test cases can effectively enhance the test adequacy, increasing the line coverage and mutation score by 10.62% and 18.91%, respectively.</abstract><cop>New York, NY, USA</cop><pub>ACM</pub><doi>10.1145/3691620.3696020</doi><tpages>13</tpages><orcidid>https://orcid.org/0000-0002-3082-5957</orcidid><orcidid>https://orcid.org/0000-0001-6126-303X</orcidid><orcidid>https://orcid.org/0000-0002-1220-8728</orcidid><orcidid>https://orcid.org/0000-0003-4892-6294</orcidid><orcidid>https://orcid.org/0000-0001-5885-9297</orcidid><orcidid>https://orcid.org/0009-0000-2887-1690</orcidid><orcidid>https://orcid.org/0000-0002-3508-7172</orcidid></addata></record>
fulltext fulltext_linktorsrc
identifier ISBN: 9798400712487
ispartof IEEE/ACM International Conference on Automated Software Engineering : [proceedings], 2024, p.557-569
issn 2643-1572
language eng
recordid cdi_ieee_primary_10764814
source IEEE Xplore All Conference Series
subjects Code Generation
Codes
Debugging
Input Transformation
Large Language Models
Metamorphic Relation
Metamorphic Testing
Software
Software and its engineering -- Software creation and management -- Software verification and validation -- Software defect analysis -- Software testing and debugging
Software engineering
Software testing
Transforms
title MR-Adopt: Automatic Deduction of Input Transformation Function for Metamorphic Testing
url http://sfxeu10.hosted.exlibrisgroup.com/loughborough?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-01-22T14%3A25%3A25IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-acm_CHZPO&rft_val_fmt=info:ofi/fmt:kev:mtx:book&rft.genre=proceeding&rft.atitle=MR-Adopt:%20Automatic%20Deduction%20of%20Input%20Transformation%20Function%20for%20Metamorphic%20Testing&rft.btitle=IEEE/ACM%20International%20Conference%20on%20Automated%20Software%20Engineering%20:%20%5Bproceedings%5D&rft.au=Xu,%20Congying&rft.date=2024-10-27&rft.spage=557&rft.epage=569&rft.pages=557-569&rft.eissn=2643-1572&rft.isbn=9798400712487&rft.coden=IEEPAD&rft_id=info:doi/10.1145/3691620.3696020&rft.eisbn=9798400712487&rft_dat=%3Cacm_CHZPO%3Eacm_books_10_1145_3691620_3696020%3C/acm_CHZPO%3E%3Cgrp_id%3Ecdi_FETCH-LOGICAL-a934-2938ffe57509dca72ab4b3a23fabb6d97c4edff1a4e2f821cbcc1e142781b8f43%3C/grp_id%3E%3Coa%3E%3C/oa%3E%3Curl%3E%3C/url%3E&rft_id=info:oai/&rft_id=info:pmid/&rft_ieee_id=10764814&rfr_iscdi=true