Are code examples on an online Q&A forum reliable? a study of API misuse on stack overflow

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 p...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE) S. 886 - 896
Hauptverfasser: Zhang, Tianyi, Upadhyaya, Ganesha, Reinhardt, Anastasia, Rajan, Hridesh, Kim, Miryung
Format: Tagungsbericht
Sprache:Englisch
Veröffentlicht: New York, NY, USA ACM 27.05.2018
Schriftenreihe:ACM Conferences
Schlagworte:
ISBN:9781450356381, 1450356389
ISSN:1558-1225
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Abstract 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---missing control constructs, missing or incorrect order of API calls, and incorrect guard conditions. 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.
AbstractList 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---missing control constructs, missing or incorrect order of API calls, and incorrect guard conditions. 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.
Author Zhang, Tianyi
Kim, Miryung
Upadhyaya, Ganesha
Reinhardt, Anastasia
Rajan, Hridesh
Author_xml – sequence: 1
  givenname: Tianyi
  surname: Zhang
  fullname: Zhang, Tianyi
  email: tianyi.zhang@cs.ucla.edu
  organization: University of California
– sequence: 2
  givenname: Ganesha
  surname: Upadhyaya
  fullname: Upadhyaya, Ganesha
  email: miryung@cs.ucla.edu
  organization: Iowa State University
– sequence: 3
  givenname: Anastasia
  surname: Reinhardt
  fullname: Reinhardt, Anastasia
  email: ganeshau@iastate.edu
  organization: George Fox University
– sequence: 4
  givenname: Hridesh
  surname: Rajan
  fullname: Rajan, Hridesh
  email: hridesh@iastate.edu
  organization: Iowa State University
– sequence: 5
  givenname: Miryung
  surname: Kim
  fullname: Kim, Miryung
  email: areinhardt14@georgefox.edu
  organization: University of California
BookMark eNqNkDtLxEAUhccXuK6pLWymEpvEuTOZm0klYfEFCyJoPUwmNxBNMkuioP_ehE1lZXNP8Z3vFueMHfehJ8YuQCQAqb5RYARoncwpURywKM_MBITSqAwcstVETQxS6qM_7JRF4_guxOSZ1ACumCwG4j5UxOnbdbuWRh567vrptk1P_OWq4HUYvjo-UNu4sqXbc3ZSu3akaMk1e7u_e908xtvnh6dNsY0doPyMEXTuVV5nKRCCxNo48I4ckkp9prUSqKrKEeVlhjWVXklRGfBIc9c7tWaX-78NEdnd0HRu-LEm1QoQJ5rsqfOdLUP4GC0IOw9kl4HsMpAth4bqSbj-p6B-AXouYI4
CODEN IEEPAD
ContentType Conference Proceeding
Copyright 2018 ACM
Copyright_xml – notice: 2018 ACM
DBID 6IE
6IH
CBEJK
RIE
RIO
DOI 10.1145/3180155.3180260
DatabaseName IEEE Electronic Library (IEL) Conference Proceedings
IEEE Proceedings Order Plan (POP) 1998-present by volume
IEEE Xplore All Conference Proceedings
IEEE Electronic Library (IEL)
IEEE Proceedings Order Plans (POP) 1998-present
DatabaseTitleList

Database_xml – sequence: 1
  dbid: RIE
  name: IEEE Electronic Library (IEL)
  url: https://ieeexplore.ieee.org/
  sourceTypes: Publisher
DeliveryMethod fulltext_linktorsrc
Discipline Computer Science
EISBN 9781450356381
1450356389
EISSN 1558-1225
EndPage 896
ExternalDocumentID 8453166
Genre orig-research
GroupedDBID 6IE
6IF
6IG
6IL
6IM
6IN
AAJGR
ABLEC
ABQGA
ACM
ADPZR
ALMA_UNASSIGNED_HOLDINGS
APO
BEFXN
BFFAM
BGNUA
BKEBE
BPEOZ
CBEJK
GUFHI
IEGSK
IJVOP
LHSKQ
OCL
RIB
RIC
RIE
RIL
RIO
-~X
.4S
.DC
123
23M
29O
5VS
6IH
6IK
8US
AAWTH
ADZIZ
AFFNX
ARCSS
AVWKF
CHZPO
EDO
FEDTE
I-F
I07
IPLJI
M43
RNS
XOL
ID FETCH-LOGICAL-a162t-6159c39f741e6126f8a1caea6e34c7553063ddaee9b76febc320d81c6e26f8ca3
IEDL.DBID RIE
ISBN 9781450356381
1450356389
IngestDate Wed Aug 27 02:07:57 EDT 2025
Fri Sep 13 11:04:35 EDT 2024
IsPeerReviewed false
IsScholarly true
Keywords API usage pattern
online Q&A forum
code example assessment
Language English
License Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from Permissions@acm.org.
LinkModel DirectLink
MeetingName ICSE '18: 40th International Conference on Software Engineering
MergedId FETCHMERGED-LOGICAL-a162t-6159c39f741e6126f8a1caea6e34c7553063ddaee9b76febc320d81c6e26f8ca3
PageCount 11
ParticipantIDs acm_books_10_1145_3180155_3180260
ieee_primary_8453166
acm_books_10_1145_3180155_3180260_brief
PublicationCentury 2000
PublicationDate 20180527
2018-May
PublicationDateYYYYMMDD 2018-05-27
2018-05-01
PublicationDate_xml – month: 05
  year: 2018
  text: 20180527
  day: 27
PublicationDecade 2010
PublicationPlace New York, NY, USA
PublicationPlace_xml – name: New York, NY, USA
PublicationSeriesTitle ACM Conferences
PublicationTitle 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE)
PublicationTitleAbbrev ICSE
PublicationYear 2018
Publisher ACM
Publisher_xml – name: ACM
SSID ssj0002684816
ssj0006499
Score 2.5045364
Snippet 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...
SourceID ieee
acm
SourceType Publisher
StartPage 886
SubjectTerms API usage pattern
code example assessment
Data mining
General and reference -- Cross-computing tools and techniques -- Empirical studies
Java
Libraries
online Q&A forums
Software
Software and its engineering -- Software creation and management -- Collaboration in software development
Software and its engineering -- Software organization and properties -- Extra-functional properties -- Software reliability
Software reliability
Syntactics
Subtitle a study of API misuse on stack overflow
Title Are code examples on an online Q&A forum reliable?
URI https://ieeexplore.ieee.org/document/8453166
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
link http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV3BattAEB1s00NPaWqHOm3DFEpyqRJLWq2kXIIxNskhjgsNBHoQq91ZMEmkItlt8vfdkVSXQqH0JCF2QQyz2jeree8BfMxDX0kjrOfgqvEc_pdeKnLhWSuFCfJJokzemE3Ey2Vyd5euevBpx4Uhoqb5jE75tvmXb0q95aOys0S4jJGyD_04jluu1u48hVVLEoY63VdYOijfSfn4Ijpzqcvo4JSvAetR9pV-_MNRpdlQFnv_9yqvYPSbmYer3Z6zDz0qXsPeL2sG7FbqEL5OK8JZaQjnT4oFgGssC1QFttKi-Pl4igvWYUDuSWb61MU5TpG7Cp-xtDhdXeH1ut7WxPMcItX3eOOy3j6UP0Zwu5h_mV16nY-Cp3wZbFx1GKU6TK0DD-QAjbSJ8rUiJSkUOmbfIBkao4jSPJaWch0GE5P4WhKP1So8gEFRFvQGMBJufuKKHlclCStVGsUUTFToh3JitaAxfHBxzbhAqLOW8xxlXeyzLvZjOPnnmCyv1mTHMOTIZ99a4Y2sC_rh3x-_hZcOzSRtN-I7GGyqLb2HF_r7Zl1XR022_ATtF7eB
linkProvider IEEE
linkToHtml http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV3fS9xAEB78BfpkrYrXVp2C2Bejl2Szl_hSDvFQ1PMEC4IPYbM7C4eayOWu1f--O0k8EQTxKSHsQhhms99s5vs-gJ0s9JU0wnoOrhrP4X_pJSITnrVSmCBrx8pkldlEp9-Pb26SwQzsTbkwRFQ1n9E-31b_8k2hJ3xUdhALlzFSzsJ8JETg12yt6YkK65bEDHaa77B0YL4R8_FFdOCSl_HBPl8DVqScVfrhjadKtaX0lj_3Ml9g7ZWbh4PprrMCM5R_heUXcwZs1uoq3HZHhEeFITx-UiwBXGKRo8qxFhfFq90u9liJAbkrmQlUvw-xi9xX-IyFxe7gFC-G5aQknucwqb7DS5f39r74twZ_esfXRyde46TgKV8GY1cfRokOE-vgAzlII22sfK1ISQqF7rBzkAyNUURJ1pGWMh0GbRP7WhKP1Spch7m8yGkDMBJufuzKHlcnCStVEnUoaKvQD2XbakEt-OnimnKJUKY16zlKm9inTexb8OvDMWk2GpJtwSpHPn2spTfSJujf3n-8DYsn1xfn6flp_-w7LDlsE9e9iT9gbjya0CYs6L_jYTnaqjLnP6zhusg
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+of+the+40th+International+Conference+on+Software+Engineering&rft.atitle=Are+code+examples+on+an+online+Q%26A+forum+reliable%3F&rft.au=Zhang%2C+Tianyi&rft.au=Upadhyaya%2C+Ganesha&rft.au=Reinhardt%2C+Anastasia&rft.au=Rajan%2C+Hridesh&rft.series=ACM+Conferences&rft.date=2018-05-27&rft.pub=ACM&rft.isbn=9781450356381&rft.spage=886&rft.epage=896&rft_id=info:doi/10.1145%2F3180155.3180260
thumbnail_l http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=9781450356381/lc.gif&client=summon&freeimage=true
thumbnail_m http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=9781450356381/mc.gif&client=summon&freeimage=true
thumbnail_s http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=9781450356381/sc.gif&client=summon&freeimage=true