Are Code Examples on an Online Q&A Forum Reliable?

dc.contributor.author Zhang, Tianyi
dc.contributor.author Upadhyaya, Ganesha
dc.contributor.author Rajan, Hridesh
dc.contributor.author Reinhardt, Anastasia
dc.contributor.author Rajan, Hridesh
dc.contributor.author Kim, Miryung
dc.contributor.department Computer Science
dc.date 2018-06-26T08:09:48.000
dc.date.accessioned 2020-06-30T01:54:40Z
dc.date.available 2020-06-30T01:54:40Z
dc.date.copyright Mon Jan 01 00:00:00 UTC 2018
dc.date.embargo 2018-06-21
dc.date.issued 2018-01-01
dc.description.abstract <p>Programmers often consult an online Q&A forum such as Stack Overflow to learn new APIs. This paper presents an empirical study on the prevalence and severity of API misuse on Stack Overflow. To reduce manual assessment effort, we design ExampleCheck, an API usage mining framework that extracts patterns from over 380K Java repositories on GitHub and subsequently reports potential API usage violations in Stack Overflow posts. We analyze 217,818 Stack Overflow posts using ExampleCheck and find that 31% may have potential API usage violations that could produce unexpected behavior such as program crashes and resource leaks. Such API misuse is caused by three main reasons---<em>missing control constructs, missing or incorrect order of API calls</em>, and <em>incorrect guard conditions.</em> Even the posts that are accepted as correct answers or upvoted by other programmers are not necessarily more reliable than other posts in terms of API misuse. This study result calls for a new approach to augment Stack Overflow with alternative API usage details that are not typically shown in curated examples.</p>
dc.description.comments <p>This is the author's version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in Zhang, Tianyi, Ganesha Upadhyaya, Anastasia Reinhardt, Hridesh Rajan, and Miryung Kim. "Are code examples on an online Q&A forum reliable?: a study of API misuse on stack overflow." In <em>Proceedings of the 40th International Conference on Software Engineering</em>, pp. 886-896. ACM, 2018. DOI: <a href="http://dx.doi.org/10.1145/3180155.3180260" target="_blank">10.1145/3180155.3180260</a>. Posted with permission.</p>
dc.format.mimetype application/pdf
dc.identifier archive/lib.dr.iastate.edu/cs_conf/46/
dc.identifier.articleid 1045
dc.identifier.contextkey 12355047
dc.identifier.s3bucket isulib-bepress-aws-west
dc.identifier.submissionpath cs_conf/46
dc.identifier.uri https://dr.lib.iastate.edu/handle/20.500.12876/19854
dc.language.iso en
dc.source.bitstream archive/lib.dr.iastate.edu/cs_conf/46/2018_Rajan_AreCode.pdf|||Sat Jan 15 00:22:52 UTC 2022
dc.source.uri 10.1145/3180155.3180260
dc.subject.disciplines Computer Sciences
dc.subject.disciplines Databases and Information Systems
dc.subject.disciplines Programming Languages and Compilers
dc.subject.keywords online Q&A forum
dc.subject.keywords API usage pattern
dc.subject.keywords code example assessment
dc.title Are Code Examples on an Online Q&A Forum Reliable?
dc.type article
dc.type.genre conference
dspace.entity.type Publication
relation.isAuthorOfPublication 4e3f4631-9a99-4a4d-ab81-491621e94031
relation.isOrgUnitOfPublication f7be4eb9-d1d0-4081-859b-b15cee251456
File
Original bundle
Now showing 1 - 1 of 1
Name:
2018_Rajan_AreCode.pdf
Size:
1002.86 KB
Format:
Adobe Portable Document Format
Description: