{"id":"https://openalex.org/W4396523220","doi":"https://doi.org/10.1109/tse.2024.3395519","title":"How Do Developers Adapt Code Snippets to Their Contexts? An Empirical Study of Context-Based Code Snippet Adaptations","display_name":"How Do Developers Adapt Code Snippets to Their Contexts? An Empirical Study of Context-Based Code Snippet Adaptations","publication_year":2024,"publication_date":"2024-04-30","ids":{"openalex":"https://openalex.org/W4396523220","doi":"https://doi.org/10.1109/tse.2024.3395519"},"language":"en","primary_location":{"id":"doi:10.1109/tse.2024.3395519","is_oa":false,"landing_page_url":"https://doi.org/10.1109/tse.2024.3395519","pdf_url":null,"source":{"id":"https://openalex.org/S8351582","display_name":"IEEE Transactions on Software Engineering","issn_l":"0098-5589","issn":["0098-5589","1939-3520","2326-3881"],"is_oa":false,"is_in_doaj":false,"is_core":true,"host_organization":"https://openalex.org/P4310320439","host_organization_name":"IEEE Computer Society","host_organization_lineage":["https://openalex.org/P4310320439","https://openalex.org/P4310319808"],"host_organization_lineage_names":["IEEE Computer Society","Institute of Electrical and Electronics Engineers"],"type":"journal"},"license":null,"license_id":null,"version":"publishedVersion","is_accepted":true,"is_published":true,"raw_source_name":"IEEE Transactions on Software Engineering","raw_type":"journal-article"},"type":"article","indexed_in":["crossref"],"open_access":{"is_oa":false,"oa_status":"closed","oa_url":null,"any_repository_has_fulltext":false},"authorships":[{"author_position":"first","author":{"id":"https://openalex.org/A5063804889","display_name":"Tanghaoran Zhang","orcid":"https://orcid.org/0000-0001-7241-9730"},"institutions":[{"id":"https://openalex.org/I170215575","display_name":"National University of Defense Technology","ror":"https://ror.org/05d2yfz11","country_code":"CN","type":"education","lineage":["https://openalex.org/I170215575"]}],"countries":["CN"],"is_corresponding":true,"raw_author_name":"Tanghaoran Zhang","raw_affiliation_strings":["Key Laboratory of Software Engineering for Complex Systems, National University of Defense Technology, Changsha, China"],"affiliations":[{"raw_affiliation_string":"Key Laboratory of Software Engineering for Complex Systems, National University of Defense Technology, Changsha, China","institution_ids":["https://openalex.org/I170215575"]}]},{"author_position":"middle","author":{"id":"https://openalex.org/A5088010119","display_name":"Yao Lu","orcid":"https://orcid.org/0000-0002-3520-5829"},"institutions":[{"id":"https://openalex.org/I170215575","display_name":"National University of Defense Technology","ror":"https://ror.org/05d2yfz11","country_code":"CN","type":"education","lineage":["https://openalex.org/I170215575"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Yao Lu","raw_affiliation_strings":["Key Laboratory of Software Engineering for Complex Systems, National University of Defense Technology, Changsha, China"],"affiliations":[{"raw_affiliation_string":"Key Laboratory of Software Engineering for Complex Systems, National University of Defense Technology, Changsha, China","institution_ids":["https://openalex.org/I170215575"]}]},{"author_position":"middle","author":{"id":"https://openalex.org/A5100397991","display_name":"Yue Yu","orcid":"https://orcid.org/0000-0002-9865-2212"},"institutions":[{"id":"https://openalex.org/I170215575","display_name":"National University of Defense Technology","ror":"https://ror.org/05d2yfz11","country_code":"CN","type":"education","lineage":["https://openalex.org/I170215575"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Yue Yu","raw_affiliation_strings":["Key Laboratory of Parallel and Distributed Computing, National University of Defense Technology, Changsha, China"],"affiliations":[{"raw_affiliation_string":"Key Laboratory of Parallel and Distributed Computing, National University of Defense Technology, Changsha, China","institution_ids":["https://openalex.org/I170215575"]}]},{"author_position":"middle","author":{"id":"https://openalex.org/A5083124500","display_name":"Xinjun Mao","orcid":"https://orcid.org/0000-0001-6003-5748"},"institutions":[{"id":"https://openalex.org/I170215575","display_name":"National University of Defense Technology","ror":"https://ror.org/05d2yfz11","country_code":"CN","type":"education","lineage":["https://openalex.org/I170215575"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Xinjun Mao","raw_affiliation_strings":["Key Laboratory of Software Engineering for Complex Systems, National University of Defense Technology, Changsha, China"],"affiliations":[{"raw_affiliation_string":"Key Laboratory of Software Engineering for Complex Systems, National University of Defense Technology, Changsha, China","institution_ids":["https://openalex.org/I170215575"]}]},{"author_position":"middle","author":{"id":"https://openalex.org/A5100354667","display_name":"Yang Zhang","orcid":"https://orcid.org/0000-0002-3111-1534"},"institutions":[{"id":"https://openalex.org/I170215575","display_name":"National University of Defense Technology","ror":"https://ror.org/05d2yfz11","country_code":"CN","type":"education","lineage":["https://openalex.org/I170215575"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Yang Zhang","raw_affiliation_strings":["Key Laboratory of Parallel and Distributed Computing, National University of Defense Technology, Changsha, China"],"affiliations":[{"raw_affiliation_string":"Key Laboratory of Parallel and Distributed Computing, National University of Defense Technology, Changsha, China","institution_ids":["https://openalex.org/I170215575"]}]},{"author_position":"last","author":{"id":"https://openalex.org/A5100565175","display_name":"Yuxin Zhao","orcid":"https://orcid.org/0009-0003-7852-8518"},"institutions":[{"id":"https://openalex.org/I170215575","display_name":"National University of Defense Technology","ror":"https://ror.org/05d2yfz11","country_code":"CN","type":"education","lineage":["https://openalex.org/I170215575"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Yuxin Zhao","raw_affiliation_strings":["Key Laboratory of Software Engineering for Complex Systems, National University of Defense Technology, Changsha, China"],"affiliations":[{"raw_affiliation_string":"Key Laboratory of Software Engineering for Complex Systems, National University of Defense Technology, Changsha, China","institution_ids":["https://openalex.org/I170215575"]}]}],"institutions":[],"countries_distinct_count":1,"institutions_distinct_count":6,"corresponding_author_ids":["https://openalex.org/A5063804889"],"corresponding_institution_ids":["https://openalex.org/I170215575"],"apc_list":null,"apc_paid":null,"fwci":2.1979,"has_fulltext":false,"cited_by_count":6,"citation_normalized_percentile":{"value":0.87854945,"is_in_top_1_percent":false,"is_in_top_10_percent":false},"cited_by_percentile_year":{"min":98,"max":99},"biblio":{"volume":"50","issue":"11","first_page":"2712","last_page":"2731"},"is_retracted":false,"is_paratext":false,"is_xpac":false,"primary_topic":{"id":"https://openalex.org/T12127","display_name":"Software System Performance and Reliability","score":0.98580002784729,"subfield":{"id":"https://openalex.org/subfields/1705","display_name":"Computer Networks and Communications"},"field":{"id":"https://openalex.org/fields/17","display_name":"Computer Science"},"domain":{"id":"https://openalex.org/domains/3","display_name":"Physical Sciences"}},"topics":[{"id":"https://openalex.org/T12127","display_name":"Software System Performance and Reliability","score":0.98580002784729,"subfield":{"id":"https://openalex.org/subfields/1705","display_name":"Computer Networks and Communications"},"field":{"id":"https://openalex.org/fields/17","display_name":"Computer Science"},"domain":{"id":"https://openalex.org/domains/3","display_name":"Physical Sciences"}},{"id":"https://openalex.org/T10639","display_name":"Advanced Software Engineering Methodologies","score":0.9815000295639038,"subfield":{"id":"https://openalex.org/subfields/1702","display_name":"Artificial Intelligence"},"field":{"id":"https://openalex.org/fields/17","display_name":"Computer Science"},"domain":{"id":"https://openalex.org/domains/3","display_name":"Physical Sciences"}},{"id":"https://openalex.org/T10679","display_name":"Service-Oriented Architecture and Web Services","score":0.9764000177383423,"subfield":{"id":"https://openalex.org/subfields/1710","display_name":"Information Systems"},"field":{"id":"https://openalex.org/fields/17","display_name":"Computer Science"},"domain":{"id":"https://openalex.org/domains/3","display_name":"Physical Sciences"}}],"keywords":[{"id":"https://openalex.org/keywords/computer-science","display_name":"Computer science","score":0.8638099431991577},{"id":"https://openalex.org/keywords/snippet","display_name":"Snippet","score":0.8572841882705688},{"id":"https://openalex.org/keywords/code","display_name":"Code (set theory)","score":0.6471220850944519},{"id":"https://openalex.org/keywords/context","display_name":"Context (archaeology)","score":0.6440758109092712},{"id":"https://openalex.org/keywords/programming-language","display_name":"Programming language","score":0.4462154507637024},{"id":"https://openalex.org/keywords/empirical-research","display_name":"Empirical research","score":0.4326309561729431},{"id":"https://openalex.org/keywords/world-wide-web","display_name":"World Wide Web","score":0.39090991020202637}],"concepts":[{"id":"https://openalex.org/C41008148","wikidata":"https://www.wikidata.org/wiki/Q21198","display_name":"Computer science","level":0,"score":0.8638099431991577},{"id":"https://openalex.org/C2777822670","wikidata":"https://www.wikidata.org/wiki/Q1120538","display_name":"Snippet","level":2,"score":0.8572841882705688},{"id":"https://openalex.org/C2776760102","wikidata":"https://www.wikidata.org/wiki/Q5139990","display_name":"Code (set theory)","level":3,"score":0.6471220850944519},{"id":"https://openalex.org/C2779343474","wikidata":"https://www.wikidata.org/wiki/Q3109175","display_name":"Context (archaeology)","level":2,"score":0.6440758109092712},{"id":"https://openalex.org/C199360897","wikidata":"https://www.wikidata.org/wiki/Q9143","display_name":"Programming language","level":1,"score":0.4462154507637024},{"id":"https://openalex.org/C120936955","wikidata":"https://www.wikidata.org/wiki/Q2155640","display_name":"Empirical research","level":2,"score":0.4326309561729431},{"id":"https://openalex.org/C136764020","wikidata":"https://www.wikidata.org/wiki/Q466","display_name":"World Wide Web","level":1,"score":0.39090991020202637},{"id":"https://openalex.org/C111472728","wikidata":"https://www.wikidata.org/wiki/Q9471","display_name":"Epistemology","level":1,"score":0.0},{"id":"https://openalex.org/C138885662","wikidata":"https://www.wikidata.org/wiki/Q5891","display_name":"Philosophy","level":0,"score":0.0},{"id":"https://openalex.org/C151730666","wikidata":"https://www.wikidata.org/wiki/Q7205","display_name":"Paleontology","level":1,"score":0.0},{"id":"https://openalex.org/C86803240","wikidata":"https://www.wikidata.org/wiki/Q420","display_name":"Biology","level":0,"score":0.0},{"id":"https://openalex.org/C177264268","wikidata":"https://www.wikidata.org/wiki/Q1514741","display_name":"Set (abstract data type)","level":2,"score":0.0}],"mesh":[],"locations_count":1,"locations":[{"id":"doi:10.1109/tse.2024.3395519","is_oa":false,"landing_page_url":"https://doi.org/10.1109/tse.2024.3395519","pdf_url":null,"source":{"id":"https://openalex.org/S8351582","display_name":"IEEE Transactions on Software Engineering","issn_l":"0098-5589","issn":["0098-5589","1939-3520","2326-3881"],"is_oa":false,"is_in_doaj":false,"is_core":true,"host_organization":"https://openalex.org/P4310320439","host_organization_name":"IEEE Computer Society","host_organization_lineage":["https://openalex.org/P4310320439","https://openalex.org/P4310319808"],"host_organization_lineage_names":["IEEE Computer Society","Institute of Electrical and Electronics Engineers"],"type":"journal"},"license":null,"license_id":null,"version":"publishedVersion","is_accepted":true,"is_published":true,"raw_source_name":"IEEE Transactions on Software Engineering","raw_type":"journal-article"}],"best_oa_location":null,"sustainable_development_goals":[],"awards":[{"id":"https://openalex.org/G8573793745","display_name":null,"funder_award_id":"62302515","funder_id":"https://openalex.org/F4320321001","funder_display_name":"National Natural Science Foundation of China"}],"funders":[{"id":"https://openalex.org/F4320321001","display_name":"National Natural Science Foundation of China","ror":"https://ror.org/01h0zpd94"}],"has_content":{"grobid_xml":false,"pdf":false},"content_urls":null,"referenced_works_count":50,"referenced_works":["https://openalex.org/W1972978214","https://openalex.org/W1979290264","https://openalex.org/W2022090474","https://openalex.org/W2053154970","https://openalex.org/W2065489029","https://openalex.org/W2074842205","https://openalex.org/W2076646346","https://openalex.org/W2115130131","https://openalex.org/W2123955623","https://openalex.org/W2139374478","https://openalex.org/W2150098915","https://openalex.org/W2463123136","https://openalex.org/W2517541169","https://openalex.org/W2610548325","https://openalex.org/W2789661710","https://openalex.org/W2794992746","https://openalex.org/W2809426407","https://openalex.org/W2810627707","https://openalex.org/W2907381941","https://openalex.org/W2955685982","https://openalex.org/W2963541700","https://openalex.org/W2971660263","https://openalex.org/W3016509176","https://openalex.org/W3037862795","https://openalex.org/W3046570025","https://openalex.org/W3093604544","https://openalex.org/W3103014234","https://openalex.org/W3126906649","https://openalex.org/W3161713900","https://openalex.org/W3215149878","https://openalex.org/W4237854095","https://openalex.org/W4289255588","https://openalex.org/W4310081672","https://openalex.org/W4313006773","https://openalex.org/W4386175199","https://openalex.org/W4403646946","https://openalex.org/W6649949691","https://openalex.org/W6665170819","https://openalex.org/W6713419932","https://openalex.org/W6732855490","https://openalex.org/W6735164992","https://openalex.org/W6736321323","https://openalex.org/W6740119983","https://openalex.org/W6765209086","https://openalex.org/W6765503933","https://openalex.org/W6770697670","https://openalex.org/W6796862986","https://openalex.org/W6798788310","https://openalex.org/W6801441594","https://openalex.org/W6854177850"],"related_works":["https://openalex.org/W1607713096","https://openalex.org/W3036724449","https://openalex.org/W2798329462","https://openalex.org/W1511521437","https://openalex.org/W3201315194","https://openalex.org/W4318980730","https://openalex.org/W4289376745","https://openalex.org/W2950904665","https://openalex.org/W2023083803","https://openalex.org/W4231058664"],"abstract_inverted_index":{"Reusing":[0],"code":[1,21,25,38,74,143,215,287],"snippets":[2,22,90],"from":[3,150,183],"online":[4],"programming":[5,31],"Q&A":[6],"communities":[7],"has":[8,291],"become":[9],"a":[10,53,78,134],"common":[11],"development":[12],"practice,":[13,296],"in":[14,126],"which":[15,114,274],"developers":[16,35,58,104,121],"often":[17],"need":[18],"to":[19,23,27,59,91,107,111,117,153,178],"adapt":[20],"their":[24,29,61,93,108],"contexts":[26,42,259],"satisfy":[28],"own":[30],"needs.":[32],"However,":[33],"how":[34,120],"make":[36],"these":[37],"adaptations":[39,124,149,225,237],"based":[40],"on":[41,137,169],"is":[43,77,240,248],"still":[44],"unclear.":[45],"To":[46,129],"bridge":[47],"this":[48,68,130],"gap,":[49],"we":[50,132,158,173],"first":[51],"conduct":[52,133],"semi-structured":[54],"interview":[55],"of":[56,213,223,232,256],"21":[57],"investigate":[60],"adaptation":[62,76,139,289],"practices":[63],"and":[64,80,95,163,199,221,238,254,266,290,297],"perceived":[65],"challenges":[66],"during":[67],"process.":[69],"The":[70],"result":[71],"suggests":[72],"that":[73,103],"snippet":[75,144,216,288],"challenging":[79],"exhausting":[81],"task":[82],"for":[83,277,294],"developers,":[84],"as":[85],"they":[86],"should":[87],"tailor":[88],"the":[89,166,214,224,233,241,249,257,262],"guarantee":[92],"correctness":[94],"quality":[96],"with":[97,147,165],"laborious":[98],"work.":[99],"We":[100],"also":[101],"note":[102],"all":[105],"resort":[106],"intra-file":[109],"context":[110,253],"complete":[112],"adaptations,":[113],"motivates":[115],"us":[116],"further":[118],"study":[119,136,282],"performed":[122],"context-based":[123],"(CAs)":[125],"real":[127],"scenarios.":[128],"end,":[131],"quantitative":[135],"an":[138],"dataset":[140],"comprising":[141],"300":[142],"reuse":[145,217],"cases":[146,218],"1,384":[148],"Stack":[151],"Overflow":[152],"GitHub.":[154],"For":[155],"each":[156],"adaptation,":[157],"manually":[159],"annotate":[160],"its":[161],"intention":[162],"relationship":[164],"context.":[167],"Based":[168],"our":[170,184,281],"annotated":[171],"data,":[172],"employ":[174],"frequent":[175],"itemset":[176],"mining":[177],"obtain":[179],"four":[180],"CA":[181],"patterns":[182],"dataset,":[185],"including":[186],"<italic":[187,191,196,200],"xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"":[188,192,197,201],"xmlns:xlink=\"http://www.w3.org/1999/xlink\">Fortification</i>":[189],",":[190,195],"xmlns:xlink=\"http://www.w3.org/1999/xlink\">Code":[193],"Wiring</i>":[194],"xmlns:xlink=\"http://www.w3.org/1999/xlink\">Attribute-ization</i>":[198],"xmlns:xlink=\"http://www.w3.org/1999/xlink\">Parameterization</i>":[202],".":[203],"Our":[204],"main":[205],"findings":[206],"reveal":[207],"that:":[208],"(1)":[209],"more":[210,229],"than":[211,230],"half":[212,231],"include":[219],"CAs":[220,234,268],"23.3%":[222],"are":[226,235,260,272,275],"CAs;":[227],"(2)":[228],"corrective":[236],"variable":[239],"primary":[242],"adapted":[243],"language":[244],"construct;":[245],"(3)":[246],"attribute":[247],"most":[250],"frequently":[251],"utilized":[252],"88%":[255],"local":[258],"within":[261],"nearest":[263],"10":[264],"LOCs;":[265],"(4)":[267],"towards":[269],"different":[270],"intentions":[271],"repetitive,":[273],"useful":[276],"automatic":[278],"adaptation.":[279],"Overall,":[280],"provides":[283],"valuable":[284],"insights":[285],"into":[286],"important":[292],"implications":[293],"research,":[295],"tool":[298],"design.":[299]},"counts_by_year":[{"year":2025,"cited_by_count":6}],"updated_date":"2025-11-06T03:46:38.306776","created_date":"2025-10-10T00:00:00"}
