Context-Adaptation Bugs in Micro-Clones

Whenever we copy a code fragment from one place of a code-base and paste it to another place, the pasted fragment might appear to be a buggy fragment if it is not properly adapted to its surrounding code. In such a situation, the bug that is contained in the pasted fragment because of not adapting i...

Full description

Saved in:
Bibliographic Details
Published inProceedings / Asia Pacific Software Engineering Conference pp. 239 - 248
Main Authors Mottakin, Sayeedi, Zaman, Maliha Bintay, Mondal, Manishankar, Shome, Atanu
Format Conference Proceeding
LanguageEnglish
Published IEEE 04.12.2023
Subjects
Online AccessGet full text

Cover

Loading…
Abstract Whenever we copy a code fragment from one place of a code-base and paste it to another place, the pasted fragment might appear to be a buggy fragment if it is not properly adapted to its surrounding code. In such a situation, the bug that is contained in the pasted fragment because of not adapting it to its context is known as a context-adaptation bug (simply, context bug). In this research, we investigate the context adaptation bugs in micro-clones (code clones of at most 4LOC) through analyzing their evolutionary history from thousands of revisions of our subject systems. An existing study has investigated such bugs in regular code clones (code clones of at least 5LOC). However, context bugs in micro-clones have never been studied. If microclones also contain context bugs, automatic support for repairing such bugs in micro-clones is important as well. We automatically identify patterns that indicate fixes of context bugs in microclones, and then analyze and compare the intensity of such bugs in regular and micro-clones. We also identify the vulnerable coding patterns that introduce context-bugs in micro-clones. According to our study on thousands of revisions of five subject systems written in three different programming languages, micro-clones generally have a higher possibility of containing context bugs during evolution compared to regular clones. Making microclones through copy/pasting across different files has a significantly higher tendency of introducing context bugs compared to cloning within the same file. We also realize that Type 1 and Type 3 micro-clones are generally more vulnerable than Type 2 micro-clones. Our findings are important for devising automatic mechanisms for fixing context bugs. We have also identified risky cloning patterns so that programmers can avoid those patterns during coding to minimize context-bugs in micro-clones.
AbstractList Whenever we copy a code fragment from one place of a code-base and paste it to another place, the pasted fragment might appear to be a buggy fragment if it is not properly adapted to its surrounding code. In such a situation, the bug that is contained in the pasted fragment because of not adapting it to its context is known as a context-adaptation bug (simply, context bug). In this research, we investigate the context adaptation bugs in micro-clones (code clones of at most 4LOC) through analyzing their evolutionary history from thousands of revisions of our subject systems. An existing study has investigated such bugs in regular code clones (code clones of at least 5LOC). However, context bugs in micro-clones have never been studied. If microclones also contain context bugs, automatic support for repairing such bugs in micro-clones is important as well. We automatically identify patterns that indicate fixes of context bugs in microclones, and then analyze and compare the intensity of such bugs in regular and micro-clones. We also identify the vulnerable coding patterns that introduce context-bugs in micro-clones. According to our study on thousands of revisions of five subject systems written in three different programming languages, micro-clones generally have a higher possibility of containing context bugs during evolution compared to regular clones. Making microclones through copy/pasting across different files has a significantly higher tendency of introducing context bugs compared to cloning within the same file. We also realize that Type 1 and Type 3 micro-clones are generally more vulnerable than Type 2 micro-clones. Our findings are important for devising automatic mechanisms for fixing context bugs. We have also identified risky cloning patterns so that programmers can avoid those patterns during coding to minimize context-bugs in micro-clones.
Author Mondal, Manishankar
Mottakin, Sayeedi
Zaman, Maliha Bintay
Shome, Atanu
Author_xml – sequence: 1
  givenname: Sayeedi
  surname: Mottakin
  fullname: Mottakin, Sayeedi
  email: sayeedi1827@cseku.ac.bd
  organization: Khulna University,Computer Science and Engineering Discipline,Bangladesh
– sequence: 2
  givenname: Maliha Bintay
  surname: Zaman
  fullname: Zaman, Maliha Bintay
  email: maliha1810@cseku.ac.bd
  organization: Khulna University,Computer Science and Engineering Discipline,Bangladesh
– sequence: 3
  givenname: Manishankar
  surname: Mondal
  fullname: Mondal, Manishankar
  email: mshankar@cse.ku.ac.bd
  organization: Khulna University,Computer Science and Engineering Discipline,Bangladesh
– sequence: 4
  givenname: Atanu
  surname: Shome
  fullname: Shome, Atanu
  email: atanu@cse.ku.ac.bd
  organization: Khulna University,Computer Science and Engineering Discipline,Bangladesh
BookMark eNotjc1Kw0AURkdRsK19A4XsXE16586dv2UMVQsVBXVdJp2JjNRJSSLo2xvQ1XcWh_PN2VnucmTsWkApBLhV9fyyrjVYsiUCyhIAJJ2wpTPOSjUxCYOnbIaagIMR6oLNh-EDAIFAzdhN3eUxfo-8Cv44-jF1ubj9eh-KlIvHtO87Xh-mx-GSnbf-MMTl_y7Y2936tX7g26f7TV1teZqCI0fXSh0DCqWd9WBb5YxB8l5bLShCK4wLJkDTmNAGchZJRe88hsZP0l4u2NVfN8UYd8c-ffr-ZyeAjCOF8hdEb0K1
CODEN IEEPAD
ContentType Conference Proceeding
DBID 6IE
6IL
CBEJK
RIE
RIL
DOI 10.1109/APSEC60848.2023.00034
DatabaseName IEEE Electronic Library (IEL) Conference Proceedings
IEEE Proceedings Order Plan All Online (POP All Online) 1998-present by volume
IEEE Xplore All Conference Proceedings
IEEE Electronic Library (IEL)
IEEE Proceedings Order Plans (POP All) 1998-Present
DatabaseTitleList
Database_xml – sequence: 1
  dbid: RIE
  name: IEEE Electronic Library (IEL)
  url: https://proxy.k.utb.cz/login?url=https://ieeexplore.ieee.org/
  sourceTypes: Publisher
DeliveryMethod fulltext_linktorsrc
Discipline Computer Science
EISBN 9798350344172
EISSN 2640-0715
EndPage 248
ExternalDocumentID 10479452
Genre orig-research
GrantInformation_xml – fundername: Khulna University
  funderid: 10.13039/501100008677
GroupedDBID 6IE
6IF
6IK
6IL
6IN
AAJGR
AAWTH
ABLEC
ADZIZ
ALMA_UNASSIGNED_HOLDINGS
BEFXN
BFFAM
BGNUA
BKEBE
BPEOZ
CBEJK
CHZPO
IEGSK
IPLJI
M43
OCL
RIE
RIL
RNS
ID FETCH-LOGICAL-i204t-29f36ed215698a08f597724aa68614e0f179d7d0bb7dfd498245ea9a2dbaaa6c3
IEDL.DBID RIE
IngestDate Wed Aug 27 02:09:39 EDT 2025
IsPeerReviewed false
IsScholarly true
Language English
LinkModel DirectLink
MergedId FETCHMERGED-LOGICAL-i204t-29f36ed215698a08f597724aa68614e0f179d7d0bb7dfd498245ea9a2dbaaa6c3
PageCount 10
ParticipantIDs ieee_primary_10479452
PublicationCentury 2000
PublicationDate 2023-Dec.-4
PublicationDateYYYYMMDD 2023-12-04
PublicationDate_xml – month: 12
  year: 2023
  text: 2023-Dec.-4
  day: 04
PublicationDecade 2020
PublicationTitle Proceedings / Asia Pacific Software Engineering Conference
PublicationTitleAbbrev APSEC
PublicationYear 2023
Publisher IEEE
Publisher_xml – name: IEEE
SSID ssj0020405
Score 2.2402568
Snippet Whenever we copy a code fragment from one place of a code-base and paste it to another place, the pasted fragment might appear to be a buggy fragment if it is...
SourceID ieee
SourceType Publisher
StartPage 239
SubjectTerms Cloning
Code Clones
Codes
Computer bugs
Computer languages
Context Adaptation Bugs
Encoding
History
Maintenance engineering
Micro-Clones
Software Maintenance
Title Context-Adaptation Bugs in Micro-Clones
URI https://ieeexplore.ieee.org/document/10479452
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
link http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwjV1La4NAEB7anHpKH5a-8VDoaY3RdXWPaUgIhYRAG8gt7LpjCS1paPXSX9_ZVVNaKPQmIqujrjPjfg-AW6EyqcMImTI5Mi4xYTqOLWi8SEyMRqfOJWI6E5MFf1gmy4as7rgwiOjAZxjYTbeWb97yyv4q6_WdHnpCX9x96txqstauu6K3MWkoOv1Q9gbzx9FQWLX4wDqEB06J5YeFissg4y7M2nPXwJGXoCp1kH_-kmX898UdgvdN1vPnuzR0BHu4OYZu69bgN5P3BO6cEBX1uQOjtvUCvH9fPX_4640_tbA8Nny1wv0eLMajp-GENTYJbE1BlyySRSzQUO4WMlNhVlhJuYgrJTLKvRgWNOdMakKtU1MYLrOIJ6ikioxWdFAen0JnQ-OfgU-1nPV_SQ01HVwIKgXiSGOBVHPRIBieg2cDX21rJYxVG_PFH_sv4cDefAf_4FfQKd8rvKYkXuob9_C-AMSGmgU
linkProvider IEEE
linkToHtml http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwjV3PS8MwFA4yD3qaPyb-tgfBU7quTdLmOMfG1G0M3GC3kTSvMiZzaHvxr_cl7SYKgrdSStpHmn7vNd_7PkJuhUqkDkKgyqRAmQROdRRZ0njGTQRGx84lYjgS_Sl7nPFZ1azuemEAwJHPwLeHbi_fvKWF_VXWbDk9dI5f3F0Eft4q27W29RW-j7xq0mkFstkeP3c7wurF-9Yj3HdaLD9MVByG9OpktLl7SR1Z-kWu_fTzlzDjvx_vgDS-2_W88RaIDskOrI5IfePX4FXL95jcOSkqrHTbRq3LLXjvvnj58BYrb2iJebTzaqX7G2Ta6046fVoZJdAFBp3TUGaRAIPoLWSigiSzonIhU0okiL4QZLjqTGwCrWOTGSaTkHFQUoVGK7wojU5IbYXjnxIPsznrABMbLDuYEJgMRKGGDDDrwkEgOCMNG_h8XWphzDcxn_9x_obs9SfDwXzwMHq6IPt2IhwZhF2SWv5ewBVCeq6v3UR-AQTqnU4
openUrl ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=proceeding&rft.title=Proceedings+%2F+Asia+Pacific+Software+Engineering+Conference&rft.atitle=Context-Adaptation+Bugs+in+Micro-Clones&rft.au=Mottakin%2C+Sayeedi&rft.au=Zaman%2C+Maliha+Bintay&rft.au=Mondal%2C+Manishankar&rft.au=Shome%2C+Atanu&rft.date=2023-12-04&rft.pub=IEEE&rft.eissn=2640-0715&rft.spage=239&rft.epage=248&rft_id=info:doi/10.1109%2FAPSEC60848.2023.00034&rft.externalDocID=10479452