Publication:
Toxic Code Snippets on Stack Overflow

dc.contributor.authorChaiyong Ragkhitwetsagulen_US
dc.contributor.authorJens Krinkeen_US
dc.contributor.authorMatheus Paixaoen_US
dc.contributor.authorGiuseppe Biancoen_US
dc.contributor.authorRocco Olivetoen_US
dc.contributor.otherUCLen_US
dc.contributor.otherUniversidade Estadual do Cearaen_US
dc.contributor.otherUniversità degli Studi del Moliseen_US
dc.contributor.otherMahidol Universityen_US
dc.date.accessioned2020-01-27T08:23:58Z
dc.date.available2020-01-27T08:23:58Z
dc.date.issued2019-01-01en_US
dc.description.abstractIEEE Online code clones are code fragments that are copied from software projects or online sources to Stack Overflow as examples. Due to an absence of a checking mechanism after the code has been copied to Stack Overflow, they can become toxic code snippets, e.g., they suffer from being outdated or violating the original software license. We present a study of online code clones on Stack Overflow and their toxicity by incorporating two developer surveys and a large-scale code clone detection. A survey of 201 high-reputation Stack Overflow answerers (33% response rate) showed that 131 participants (65%) have ever been notified of outdated code and 26 of them (20%) rarely or never fix the code. 138 answerers (69%) never check for licensing conflicts between their copied code snippets and Stack Overflow?s CC BY-SA 3.0. A survey of 87 Stack Overflow visitors shows that they experienced several issues from Stack Overflow answers: mismatched solutions, outdated solutions, incorrect solutions, and buggy code. 85% of them are not aware of CC BY-SA 3.0 license enforced by Stack Overflow, and 66% never check for license conflicts when reusing code snippets. Our clone detection found online clone pairs between 72,365 Java code snippets on Stack Overflow and 111 open source projects in the curated Qualitas corpus. We analysed 2,289 non-trivial online clone candidates. Our investigation revealed strong evidence that 153 clones have been copied from a Qualitas project to Stack Overflow. We found 100 of them (66%) to be outdated, of which 10 were buggy and harmful for reuse. Furthermore, we found 214 code snippets that could potentially violate the license of their original software and appear 7,112 times in 2,427 GitHub projects.en_US
dc.identifier.citationIEEE Transactions on Software Engineering. (2019)en_US
dc.identifier.doi10.1109/TSE.2019.2900307en_US
dc.identifier.issn19393520en_US
dc.identifier.issn00985589en_US
dc.identifier.other2-s2.0-85061983117en_US
dc.identifier.urihttps://repository.li.mahidol.ac.th/handle/20.500.14594/50689
dc.rightsMahidol Universityen_US
dc.rights.holderSCOPUSen_US
dc.source.urihttps://www.scopus.com/inward/record.uri?partnerID=HzOxMe3b&scp=85061983117&origin=inwarden_US
dc.subjectComputer Scienceen_US
dc.titleToxic Code Snippets on Stack Overflowen_US
dspace.entity.typePublication
mu.datasource.scopushttps://www.scopus.com/inward/record.uri?partnerID=HzOxMe3b&scp=85061983117&origin=inwarden_US

Files

Collections