Predicting Consistency-Maintenance Requirement of Code Clonesat Copy-and-Paste Time

Code clones have always been a double edged sword in software development. On one hand, it is a very convenient way to reuse existing code, and to save coding effort. On the other hand, since developers may need to ensure consistency among cloned code segments, code clones can lead to extra maintena...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:IEEE transactions on software engineering 2014-08, Vol.40 (8), p.773-794
Hauptverfasser: Xiaoyin Wang, Yingnong Dang, Lu Zhang, Dongmei Zhang, Lan, Erica, Hong Mei
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
container_end_page 794
container_issue 8
container_start_page 773
container_title IEEE transactions on software engineering
container_volume 40
creator Xiaoyin Wang
Yingnong Dang
Lu Zhang
Dongmei Zhang
Lan, Erica
Hong Mei
description Code clones have always been a double edged sword in software development. On one hand, it is a very convenient way to reuse existing code, and to save coding effort. On the other hand, since developers may need to ensure consistency among cloned code segments, code clones can lead to extra maintenance effort and even bugs. Recently studies on the evolution of code clones show that only some of the code clones experience consistent changes during their evolution history. Therefore, if we can accurately predict whether a code clone will experience consistent changes, we will be able to provide useful recommendations to developers onleveraging the convenience of some code cloning operations, while avoiding other code cloning operations to reduce future consistency maintenance effort. In this paper, we define a code cloning operation as consistency-maintenance-required if its generated code clones experience consistent changes in the software evolution history, and we propose a novel approach that automatically predicts whether a code cloning operation requires consistency maintenance at the time point of performing copy-and-paste operations. Our insight is that whether a code cloning operation requires consistency maintenance may relate to the characteristics of the code to be cloned and the characteristics of its context. Based on a number of attributes extracted from the cloned code and the context of the code cloning operation, we use Bayesian Networks, a machine-learning technique, to predict whether an intended code cloning operation requires consistency maintenance. We evaluated our approach on four subjects-two large-scale Microsoft software projects, and two popular open-source software projects-under two usage scenarios: 1) recommend developers to perform only the cloning operations predicted to be very likely to be consistency-maintenance-free, and 2) recommend developers to perform all cloning operations unless they are predicted very likely to be consistency-maintenance-required. In the first scenario, our approach is able to recommend developers to perform more than 50 percent cloning operations with a precision of at least 94 percent in the four subjects. In the second scenario, our approach is able to avoid 37 to 72 percent consistency-maintenance-required code clones by warning developers on only 13 to 40 percent code clones, in the four subjects.
doi_str_mv 10.1109/TSE.2014.2323972
format Article
fullrecord <record><control><sourceid>proquest_RIE</sourceid><recordid>TN_cdi_proquest_journals_1554282579</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><ieee_id>6815760</ieee_id><sourcerecordid>3406657361</sourcerecordid><originalsourceid>FETCH-LOGICAL-c239t-d0efc0d09af277552e21b2cd55c488bd92d41bc6d457301e8a99de3fe907ff73</originalsourceid><addsrcrecordid>eNpdkD1rwzAQhkVpoWnavdDF0KWL05NsWdZYQvoBKQ2Nd6FI56Jgy4llD_n3VUjo0Onu4HmPl4eQewozSkE-V-vFjAHNZyxjmRTsgkyozGSacQaXZAIgy5TzUl6TmxC2AMCF4BOyXvVonRmc_0nmnQ8uDOjNIf3UzsdNe4PJN-5H12OLfki6OmIWk3nTeQx6iNfukGpv05WO0aRyLd6Sq1o3Ae_Oc0qq10U1f0-XX28f85dlamLDIbWAtQELUtcsduEMGd0wYzk3eVlurGQ2pxtT2JyLDCiWWkqLWY0SRF2LbEqeTm93fbcfMQyqdcFg02iP3RgULYSQAqikEX38h267sfexnKKc56xkXMhIwYkyfRdCj7Xa9a7V_UFRUEfJKkpWR8nqLDlGHk4Rh4h_eFFSLgrIfgE9vXfs</addsrcrecordid><sourcetype>Aggregation Database</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype><pqid>1554282579</pqid></control><display><type>article</type><title>Predicting Consistency-Maintenance Requirement of Code Clonesat Copy-and-Paste Time</title><source>IEEE Electronic Library (IEL)</source><creator>Xiaoyin Wang ; Yingnong Dang ; Lu Zhang ; Dongmei Zhang ; Lan, Erica ; Hong Mei</creator><creatorcontrib>Xiaoyin Wang ; Yingnong Dang ; Lu Zhang ; Dongmei Zhang ; Lan, Erica ; Hong Mei</creatorcontrib><description>Code clones have always been a double edged sword in software development. On one hand, it is a very convenient way to reuse existing code, and to save coding effort. On the other hand, since developers may need to ensure consistency among cloned code segments, code clones can lead to extra maintenance effort and even bugs. Recently studies on the evolution of code clones show that only some of the code clones experience consistent changes during their evolution history. Therefore, if we can accurately predict whether a code clone will experience consistent changes, we will be able to provide useful recommendations to developers onleveraging the convenience of some code cloning operations, while avoiding other code cloning operations to reduce future consistency maintenance effort. In this paper, we define a code cloning operation as consistency-maintenance-required if its generated code clones experience consistent changes in the software evolution history, and we propose a novel approach that automatically predicts whether a code cloning operation requires consistency maintenance at the time point of performing copy-and-paste operations. Our insight is that whether a code cloning operation requires consistency maintenance may relate to the characteristics of the code to be cloned and the characteristics of its context. Based on a number of attributes extracted from the cloned code and the context of the code cloning operation, we use Bayesian Networks, a machine-learning technique, to predict whether an intended code cloning operation requires consistency maintenance. We evaluated our approach on four subjects-two large-scale Microsoft software projects, and two popular open-source software projects-under two usage scenarios: 1) recommend developers to perform only the cloning operations predicted to be very likely to be consistency-maintenance-free, and 2) recommend developers to perform all cloning operations unless they are predicted very likely to be consistency-maintenance-required. In the first scenario, our approach is able to recommend developers to perform more than 50 percent cloning operations with a precision of at least 94 percent in the four subjects. In the second scenario, our approach is able to avoid 37 to 72 percent consistency-maintenance-required code clones by warning developers on only 13 to 40 percent code clones, in the four subjects.</description><identifier>ISSN: 0098-5589</identifier><identifier>EISSN: 1939-3520</identifier><identifier>DOI: 10.1109/TSE.2014.2323972</identifier><identifier>CODEN: IESEDJ</identifier><language>eng</language><publisher>New York: IEEE</publisher><subject>Artificial intelligence ; Bayes methods ; Bayesian analysis ; Cloning ; Codes ; Computer programs ; Consistency ; Developers ; Educational institutions ; Evolution ; History ; Maintenance ; Maintenance engineering ; Reproduction ; Software ; Software engineering ; Studies ; Systems development ; Training</subject><ispartof>IEEE transactions on software engineering, 2014-08, Vol.40 (8), p.773-794</ispartof><rights>Copyright IEEE Computer Society Aug 1, 2014</rights><lds50>peer_reviewed</lds50><woscitedreferencessubscribed>false</woscitedreferencessubscribed><citedby>FETCH-LOGICAL-c239t-d0efc0d09af277552e21b2cd55c488bd92d41bc6d457301e8a99de3fe907ff73</citedby><cites>FETCH-LOGICAL-c239t-d0efc0d09af277552e21b2cd55c488bd92d41bc6d457301e8a99de3fe907ff73</cites></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><linktohtml>$$Uhttps://ieeexplore.ieee.org/document/6815760$$EHTML$$P50$$Gieee$$H</linktohtml><link.rule.ids>314,776,780,792,27901,27902,54733</link.rule.ids><linktorsrc>$$Uhttps://ieeexplore.ieee.org/document/6815760$$EView_record_in_IEEE$$FView_record_in_$$GIEEE</linktorsrc></links><search><creatorcontrib>Xiaoyin Wang</creatorcontrib><creatorcontrib>Yingnong Dang</creatorcontrib><creatorcontrib>Lu Zhang</creatorcontrib><creatorcontrib>Dongmei Zhang</creatorcontrib><creatorcontrib>Lan, Erica</creatorcontrib><creatorcontrib>Hong Mei</creatorcontrib><title>Predicting Consistency-Maintenance Requirement of Code Clonesat Copy-and-Paste Time</title><title>IEEE transactions on software engineering</title><addtitle>TSE</addtitle><description>Code clones have always been a double edged sword in software development. On one hand, it is a very convenient way to reuse existing code, and to save coding effort. On the other hand, since developers may need to ensure consistency among cloned code segments, code clones can lead to extra maintenance effort and even bugs. Recently studies on the evolution of code clones show that only some of the code clones experience consistent changes during their evolution history. Therefore, if we can accurately predict whether a code clone will experience consistent changes, we will be able to provide useful recommendations to developers onleveraging the convenience of some code cloning operations, while avoiding other code cloning operations to reduce future consistency maintenance effort. In this paper, we define a code cloning operation as consistency-maintenance-required if its generated code clones experience consistent changes in the software evolution history, and we propose a novel approach that automatically predicts whether a code cloning operation requires consistency maintenance at the time point of performing copy-and-paste operations. Our insight is that whether a code cloning operation requires consistency maintenance may relate to the characteristics of the code to be cloned and the characteristics of its context. Based on a number of attributes extracted from the cloned code and the context of the code cloning operation, we use Bayesian Networks, a machine-learning technique, to predict whether an intended code cloning operation requires consistency maintenance. We evaluated our approach on four subjects-two large-scale Microsoft software projects, and two popular open-source software projects-under two usage scenarios: 1) recommend developers to perform only the cloning operations predicted to be very likely to be consistency-maintenance-free, and 2) recommend developers to perform all cloning operations unless they are predicted very likely to be consistency-maintenance-required. In the first scenario, our approach is able to recommend developers to perform more than 50 percent cloning operations with a precision of at least 94 percent in the four subjects. In the second scenario, our approach is able to avoid 37 to 72 percent consistency-maintenance-required code clones by warning developers on only 13 to 40 percent code clones, in the four subjects.</description><subject>Artificial intelligence</subject><subject>Bayes methods</subject><subject>Bayesian analysis</subject><subject>Cloning</subject><subject>Codes</subject><subject>Computer programs</subject><subject>Consistency</subject><subject>Developers</subject><subject>Educational institutions</subject><subject>Evolution</subject><subject>History</subject><subject>Maintenance</subject><subject>Maintenance engineering</subject><subject>Reproduction</subject><subject>Software</subject><subject>Software engineering</subject><subject>Studies</subject><subject>Systems development</subject><subject>Training</subject><issn>0098-5589</issn><issn>1939-3520</issn><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2014</creationdate><recordtype>article</recordtype><sourceid>RIE</sourceid><recordid>eNpdkD1rwzAQhkVpoWnavdDF0KWL05NsWdZYQvoBKQ2Nd6FI56Jgy4llD_n3VUjo0Onu4HmPl4eQewozSkE-V-vFjAHNZyxjmRTsgkyozGSacQaXZAIgy5TzUl6TmxC2AMCF4BOyXvVonRmc_0nmnQ8uDOjNIf3UzsdNe4PJN-5H12OLfki6OmIWk3nTeQx6iNfukGpv05WO0aRyLd6Sq1o3Ae_Oc0qq10U1f0-XX28f85dlamLDIbWAtQELUtcsduEMGd0wYzk3eVlurGQ2pxtT2JyLDCiWWkqLWY0SRF2LbEqeTm93fbcfMQyqdcFg02iP3RgULYSQAqikEX38h267sfexnKKc56xkXMhIwYkyfRdCj7Xa9a7V_UFRUEfJKkpWR8nqLDlGHk4Rh4h_eFFSLgrIfgE9vXfs</recordid><startdate>20140801</startdate><enddate>20140801</enddate><creator>Xiaoyin Wang</creator><creator>Yingnong Dang</creator><creator>Lu Zhang</creator><creator>Dongmei Zhang</creator><creator>Lan, Erica</creator><creator>Hong Mei</creator><general>IEEE</general><general>IEEE Computer Society</general><scope>97E</scope><scope>RIA</scope><scope>RIE</scope><scope>AAYXX</scope><scope>CITATION</scope><scope>JQ2</scope><scope>K9.</scope><scope>7SC</scope><scope>7SP</scope><scope>8FD</scope><scope>F28</scope><scope>FR3</scope><scope>L7M</scope><scope>L~C</scope><scope>L~D</scope></search><sort><creationdate>20140801</creationdate><title>Predicting Consistency-Maintenance Requirement of Code Clonesat Copy-and-Paste Time</title><author>Xiaoyin Wang ; Yingnong Dang ; Lu Zhang ; Dongmei Zhang ; Lan, Erica ; Hong Mei</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-LOGICAL-c239t-d0efc0d09af277552e21b2cd55c488bd92d41bc6d457301e8a99de3fe907ff73</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2014</creationdate><topic>Artificial intelligence</topic><topic>Bayes methods</topic><topic>Bayesian analysis</topic><topic>Cloning</topic><topic>Codes</topic><topic>Computer programs</topic><topic>Consistency</topic><topic>Developers</topic><topic>Educational institutions</topic><topic>Evolution</topic><topic>History</topic><topic>Maintenance</topic><topic>Maintenance engineering</topic><topic>Reproduction</topic><topic>Software</topic><topic>Software engineering</topic><topic>Studies</topic><topic>Systems development</topic><topic>Training</topic><toplevel>peer_reviewed</toplevel><toplevel>online_resources</toplevel><creatorcontrib>Xiaoyin Wang</creatorcontrib><creatorcontrib>Yingnong Dang</creatorcontrib><creatorcontrib>Lu Zhang</creatorcontrib><creatorcontrib>Dongmei Zhang</creatorcontrib><creatorcontrib>Lan, Erica</creatorcontrib><creatorcontrib>Hong Mei</creatorcontrib><collection>IEEE All-Society Periodicals Package (ASPP) 2005-present</collection><collection>IEEE All-Society Periodicals Package (ASPP) 1998-Present</collection><collection>IEEE Electronic Library (IEL)</collection><collection>CrossRef</collection><collection>ProQuest Computer Science Collection</collection><collection>ProQuest Health &amp; Medical Complete (Alumni)</collection><collection>Computer and Information Systems Abstracts</collection><collection>Electronics &amp; Communications Abstracts</collection><collection>Technology Research Database</collection><collection>ANTE: Abstracts in New Technology &amp; Engineering</collection><collection>Engineering Research Database</collection><collection>Advanced Technologies Database with Aerospace</collection><collection>Computer and Information Systems Abstracts – Academic</collection><collection>Computer and Information Systems Abstracts Professional</collection><jtitle>IEEE transactions on software engineering</jtitle></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext_linktorsrc</fulltext></delivery><addata><au>Xiaoyin Wang</au><au>Yingnong Dang</au><au>Lu Zhang</au><au>Dongmei Zhang</au><au>Lan, Erica</au><au>Hong Mei</au><format>journal</format><genre>article</genre><ristype>JOUR</ristype><atitle>Predicting Consistency-Maintenance Requirement of Code Clonesat Copy-and-Paste Time</atitle><jtitle>IEEE transactions on software engineering</jtitle><stitle>TSE</stitle><date>2014-08-01</date><risdate>2014</risdate><volume>40</volume><issue>8</issue><spage>773</spage><epage>794</epage><pages>773-794</pages><issn>0098-5589</issn><eissn>1939-3520</eissn><coden>IESEDJ</coden><abstract>Code clones have always been a double edged sword in software development. On one hand, it is a very convenient way to reuse existing code, and to save coding effort. On the other hand, since developers may need to ensure consistency among cloned code segments, code clones can lead to extra maintenance effort and even bugs. Recently studies on the evolution of code clones show that only some of the code clones experience consistent changes during their evolution history. Therefore, if we can accurately predict whether a code clone will experience consistent changes, we will be able to provide useful recommendations to developers onleveraging the convenience of some code cloning operations, while avoiding other code cloning operations to reduce future consistency maintenance effort. In this paper, we define a code cloning operation as consistency-maintenance-required if its generated code clones experience consistent changes in the software evolution history, and we propose a novel approach that automatically predicts whether a code cloning operation requires consistency maintenance at the time point of performing copy-and-paste operations. Our insight is that whether a code cloning operation requires consistency maintenance may relate to the characteristics of the code to be cloned and the characteristics of its context. Based on a number of attributes extracted from the cloned code and the context of the code cloning operation, we use Bayesian Networks, a machine-learning technique, to predict whether an intended code cloning operation requires consistency maintenance. We evaluated our approach on four subjects-two large-scale Microsoft software projects, and two popular open-source software projects-under two usage scenarios: 1) recommend developers to perform only the cloning operations predicted to be very likely to be consistency-maintenance-free, and 2) recommend developers to perform all cloning operations unless they are predicted very likely to be consistency-maintenance-required. In the first scenario, our approach is able to recommend developers to perform more than 50 percent cloning operations with a precision of at least 94 percent in the four subjects. In the second scenario, our approach is able to avoid 37 to 72 percent consistency-maintenance-required code clones by warning developers on only 13 to 40 percent code clones, in the four subjects.</abstract><cop>New York</cop><pub>IEEE</pub><doi>10.1109/TSE.2014.2323972</doi><tpages>22</tpages></addata></record>
fulltext fulltext_linktorsrc
identifier ISSN: 0098-5589
ispartof IEEE transactions on software engineering, 2014-08, Vol.40 (8), p.773-794
issn 0098-5589
1939-3520
language eng
recordid cdi_proquest_journals_1554282579
source IEEE Electronic Library (IEL)
subjects Artificial intelligence
Bayes methods
Bayesian analysis
Cloning
Codes
Computer programs
Consistency
Developers
Educational institutions
Evolution
History
Maintenance
Maintenance engineering
Reproduction
Software
Software engineering
Studies
Systems development
Training
title Predicting Consistency-Maintenance Requirement of Code Clonesat Copy-and-Paste Time
url https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-02-01T22%3A48%3A04IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-proquest_RIE&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft.genre=article&rft.atitle=Predicting%20Consistency-Maintenance%20Requirement%20of%20Code%20Clonesat%20Copy-and-Paste%20Time&rft.jtitle=IEEE%20transactions%20on%20software%20engineering&rft.au=Xiaoyin%20Wang&rft.date=2014-08-01&rft.volume=40&rft.issue=8&rft.spage=773&rft.epage=794&rft.pages=773-794&rft.issn=0098-5589&rft.eissn=1939-3520&rft.coden=IESEDJ&rft_id=info:doi/10.1109/TSE.2014.2323972&rft_dat=%3Cproquest_RIE%3E3406657361%3C/proquest_RIE%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_pqid=1554282579&rft_id=info:pmid/&rft_ieee_id=6815760&rfr_iscdi=true