Loading…

FACER: An API usage-based code-example recommender for opportunistic reuse

To save time, developers often search for code examples that implement their desired software features. Existing code search techniques typically focus on finding code snippets for a single given query, which means that developers need to perform a separate search for each desired functionality. In...

Full description

Saved in:
Bibliographic Details
Published in:Empirical software engineering : an international journal 2021-11, Vol.26 (6), Article 110
Main Authors: Abid, Shamsa, Shamail, Shafay, Basit, Hamid Abdul, Nadi, Sarah
Format: Article
Language:English
Subjects:
Citations: Items that this one cites
Items that cite this one
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
cited_by cdi_FETCH-LOGICAL-c319t-41b9dc7f38d04322c6804acde0676f17f0b60fe79c7787bf2368d6bc5b5620a83
cites cdi_FETCH-LOGICAL-c319t-41b9dc7f38d04322c6804acde0676f17f0b60fe79c7787bf2368d6bc5b5620a83
container_end_page
container_issue 6
container_start_page
container_title Empirical software engineering : an international journal
container_volume 26
creator Abid, Shamsa
Shamail, Shafay
Basit, Hamid Abdul
Nadi, Sarah
description To save time, developers often search for code examples that implement their desired software features. Existing code search techniques typically focus on finding code snippets for a single given query, which means that developers need to perform a separate search for each desired functionality. In this paper, we propose FACER ( F eature-driven A PI usage-based C ode E xamples R ecommender), a technique that avoids repeated searches through opportunistic reuse. Specifically, given the selected code snippet that matches the initial search query, FACER finds and suggests related code snippets that represent features that the developer may want to implement next. FACER first constructs a code fact repository by parsing the source code of open-source Java projects to obtain methods’ textual information, call graphs, and Application Programming Interface (API) usages. It then detects unique features by clustering methods based on similar API usages, where each cluster represents a feature or functionality. Finally, it detects frequently co-occurring features across projects using frequent pattern mining and recommends related methods from the mined patterns. To evaluate FACER, we run it on 120 Java Android apps from GitHub. We first manually validate that the detected method clusters represent methods with similar functionality. We then perform an automated evaluation to determine the best parameters (e.g., similarity threshold) for FACER. We recruit 10 professional developers along with 39 experienced students to judge FACER’s recommendation of related methods. Our results show that, on average, FACER’s recommendations are 80% precise. We also survey a total of 20 professional Android and Java developers to understand their code search and reuse experiences, and also to obtain their feedback on the usability and usefulness of FACER. The survey results show that 95% of our surveyed professional developers find the idea of related method recommendations useful during code reuse.
doi_str_mv 10.1007/s10664-021-10000-w
format article
fullrecord <record><control><sourceid>proquest_cross</sourceid><recordid>TN_cdi_proquest_journals_2562365260</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>2562365260</sourcerecordid><originalsourceid>FETCH-LOGICAL-c319t-41b9dc7f38d04322c6804acde0676f17f0b60fe79c7787bf2368d6bc5b5620a83</originalsourceid><addsrcrecordid>eNp9kEFLxDAQhYMouK7-AU8Fz9FJ0iatt7Ls6oqgiJ5Dm06WXbZNTVpW_73RCt48zQzzvTfMI-SSwTUDUDeBgZQpBc5onAHo4YjMWKYEVZLJ49iLnFPBM3lKzkLYRaRQaTYjD6tysXy5TcouKZ_XyRiqDdK6CtgkxjVI8aNq-z0mHo1rW-wa9Il1PnF97_wwdtswbE3cjgHPyYmt9gEvfuucvK2Wr4t7-vh0t16Uj9QIVgw0ZXXRGGVF3kAqODcyh7QyDYJU0jJloZZgURVGqVzVlguZN7I2WZ1JDlUu5uRq8u29ex8xDHrnRt_Fkzr-F_GMS4gUnyjjXQgere79tq38p2agvzPTU2Y6ZqZ_MtOHKBKTKES426D_s_5H9QW3pm4O</addsrcrecordid><sourcetype>Aggregation Database</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype><pqid>2562365260</pqid></control><display><type>article</type><title>FACER: An API usage-based code-example recommender for opportunistic reuse</title><source>Springer Nature</source><creator>Abid, Shamsa ; Shamail, Shafay ; Basit, Hamid Abdul ; Nadi, Sarah</creator><creatorcontrib>Abid, Shamsa ; Shamail, Shafay ; Basit, Hamid Abdul ; Nadi, Sarah</creatorcontrib><description>To save time, developers often search for code examples that implement their desired software features. Existing code search techniques typically focus on finding code snippets for a single given query, which means that developers need to perform a separate search for each desired functionality. In this paper, we propose FACER ( F eature-driven A PI usage-based C ode E xamples R ecommender), a technique that avoids repeated searches through opportunistic reuse. Specifically, given the selected code snippet that matches the initial search query, FACER finds and suggests related code snippets that represent features that the developer may want to implement next. FACER first constructs a code fact repository by parsing the source code of open-source Java projects to obtain methods’ textual information, call graphs, and Application Programming Interface (API) usages. It then detects unique features by clustering methods based on similar API usages, where each cluster represents a feature or functionality. Finally, it detects frequently co-occurring features across projects using frequent pattern mining and recommends related methods from the mined patterns. To evaluate FACER, we run it on 120 Java Android apps from GitHub. We first manually validate that the detected method clusters represent methods with similar functionality. We then perform an automated evaluation to determine the best parameters (e.g., similarity threshold) for FACER. We recruit 10 professional developers along with 39 experienced students to judge FACER’s recommendation of related methods. Our results show that, on average, FACER’s recommendations are 80% precise. We also survey a total of 20 professional Android and Java developers to understand their code search and reuse experiences, and also to obtain their feedback on the usability and usefulness of FACER. The survey results show that 95% of our surveyed professional developers find the idea of related method recommendations useful during code reuse.</description><identifier>ISSN: 1382-3256</identifier><identifier>EISSN: 1573-7616</identifier><identifier>DOI: 10.1007/s10664-021-10000-w</identifier><language>eng</language><publisher>New York: Springer US</publisher><subject>Application programming interface ; Applications programs ; Clustering ; Code reuse ; Compilers ; Computer Science ; Data mining ; Interpreters ; Java ; Pattern analysis ; Programming Languages ; Recommendation Systems for Software Engineering ; Recommender systems ; Searching ; Software Engineering/Programming and Operating Systems ; Source code</subject><ispartof>Empirical software engineering : an international journal, 2021-11, Vol.26 (6), Article 110</ispartof><rights>The Author(s), under exclusive licence to Springer Science+Business Media, LLC, part of Springer Nature 2021</rights><rights>The Author(s), under exclusive licence to Springer Science+Business Media, LLC, part of Springer Nature 2021.</rights><lds50>peer_reviewed</lds50><woscitedreferencessubscribed>false</woscitedreferencessubscribed><citedby>FETCH-LOGICAL-c319t-41b9dc7f38d04322c6804acde0676f17f0b60fe79c7787bf2368d6bc5b5620a83</citedby><cites>FETCH-LOGICAL-c319t-41b9dc7f38d04322c6804acde0676f17f0b60fe79c7787bf2368d6bc5b5620a83</cites><orcidid>0000-0002-7491-8258</orcidid></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>314,780,784,27923,27924</link.rule.ids></links><search><creatorcontrib>Abid, Shamsa</creatorcontrib><creatorcontrib>Shamail, Shafay</creatorcontrib><creatorcontrib>Basit, Hamid Abdul</creatorcontrib><creatorcontrib>Nadi, Sarah</creatorcontrib><title>FACER: An API usage-based code-example recommender for opportunistic reuse</title><title>Empirical software engineering : an international journal</title><addtitle>Empir Software Eng</addtitle><description>To save time, developers often search for code examples that implement their desired software features. Existing code search techniques typically focus on finding code snippets for a single given query, which means that developers need to perform a separate search for each desired functionality. In this paper, we propose FACER ( F eature-driven A PI usage-based C ode E xamples R ecommender), a technique that avoids repeated searches through opportunistic reuse. Specifically, given the selected code snippet that matches the initial search query, FACER finds and suggests related code snippets that represent features that the developer may want to implement next. FACER first constructs a code fact repository by parsing the source code of open-source Java projects to obtain methods’ textual information, call graphs, and Application Programming Interface (API) usages. It then detects unique features by clustering methods based on similar API usages, where each cluster represents a feature or functionality. Finally, it detects frequently co-occurring features across projects using frequent pattern mining and recommends related methods from the mined patterns. To evaluate FACER, we run it on 120 Java Android apps from GitHub. We first manually validate that the detected method clusters represent methods with similar functionality. We then perform an automated evaluation to determine the best parameters (e.g., similarity threshold) for FACER. We recruit 10 professional developers along with 39 experienced students to judge FACER’s recommendation of related methods. Our results show that, on average, FACER’s recommendations are 80% precise. We also survey a total of 20 professional Android and Java developers to understand their code search and reuse experiences, and also to obtain their feedback on the usability and usefulness of FACER. The survey results show that 95% of our surveyed professional developers find the idea of related method recommendations useful during code reuse.</description><subject>Application programming interface</subject><subject>Applications programs</subject><subject>Clustering</subject><subject>Code reuse</subject><subject>Compilers</subject><subject>Computer Science</subject><subject>Data mining</subject><subject>Interpreters</subject><subject>Java</subject><subject>Pattern analysis</subject><subject>Programming Languages</subject><subject>Recommendation Systems for Software Engineering</subject><subject>Recommender systems</subject><subject>Searching</subject><subject>Software Engineering/Programming and Operating Systems</subject><subject>Source code</subject><issn>1382-3256</issn><issn>1573-7616</issn><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2021</creationdate><recordtype>article</recordtype><recordid>eNp9kEFLxDAQhYMouK7-AU8Fz9FJ0iatt7Ls6oqgiJ5Dm06WXbZNTVpW_73RCt48zQzzvTfMI-SSwTUDUDeBgZQpBc5onAHo4YjMWKYEVZLJ49iLnFPBM3lKzkLYRaRQaTYjD6tysXy5TcouKZ_XyRiqDdK6CtgkxjVI8aNq-z0mHo1rW-wa9Il1PnF97_wwdtswbE3cjgHPyYmt9gEvfuucvK2Wr4t7-vh0t16Uj9QIVgw0ZXXRGGVF3kAqODcyh7QyDYJU0jJloZZgURVGqVzVlguZN7I2WZ1JDlUu5uRq8u29ex8xDHrnRt_Fkzr-F_GMS4gUnyjjXQgere79tq38p2agvzPTU2Y6ZqZ_MtOHKBKTKES426D_s_5H9QW3pm4O</recordid><startdate>20211101</startdate><enddate>20211101</enddate><creator>Abid, Shamsa</creator><creator>Shamail, Shafay</creator><creator>Basit, Hamid Abdul</creator><creator>Nadi, Sarah</creator><general>Springer US</general><general>Springer Nature B.V</general><scope>AAYXX</scope><scope>CITATION</scope><scope>7SC</scope><scope>8FD</scope><scope>8FE</scope><scope>8FG</scope><scope>ABJCF</scope><scope>AFKRA</scope><scope>ARAPS</scope><scope>BENPR</scope><scope>BGLVJ</scope><scope>CCPQU</scope><scope>DWQXO</scope><scope>HCIFZ</scope><scope>JQ2</scope><scope>L6V</scope><scope>L7M</scope><scope>L~C</scope><scope>L~D</scope><scope>M7S</scope><scope>P5Z</scope><scope>P62</scope><scope>PQEST</scope><scope>PQQKQ</scope><scope>PQUKI</scope><scope>PRINS</scope><scope>PTHSS</scope><scope>S0W</scope><orcidid>https://orcid.org/0000-0002-7491-8258</orcidid></search><sort><creationdate>20211101</creationdate><title>FACER: An API usage-based code-example recommender for opportunistic reuse</title><author>Abid, Shamsa ; Shamail, Shafay ; Basit, Hamid Abdul ; Nadi, Sarah</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-LOGICAL-c319t-41b9dc7f38d04322c6804acde0676f17f0b60fe79c7787bf2368d6bc5b5620a83</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2021</creationdate><topic>Application programming interface</topic><topic>Applications programs</topic><topic>Clustering</topic><topic>Code reuse</topic><topic>Compilers</topic><topic>Computer Science</topic><topic>Data mining</topic><topic>Interpreters</topic><topic>Java</topic><topic>Pattern analysis</topic><topic>Programming Languages</topic><topic>Recommendation Systems for Software Engineering</topic><topic>Recommender systems</topic><topic>Searching</topic><topic>Software Engineering/Programming and Operating Systems</topic><topic>Source code</topic><toplevel>peer_reviewed</toplevel><toplevel>online_resources</toplevel><creatorcontrib>Abid, Shamsa</creatorcontrib><creatorcontrib>Shamail, Shafay</creatorcontrib><creatorcontrib>Basit, Hamid Abdul</creatorcontrib><creatorcontrib>Nadi, Sarah</creatorcontrib><collection>CrossRef</collection><collection>Computer and Information Systems Abstracts</collection><collection>Technology Research Database</collection><collection>ProQuest SciTech Collection</collection><collection>ProQuest Technology Collection</collection><collection>Materials Science &amp; Engineering Collection</collection><collection>ProQuest Central</collection><collection>Advanced Technologies &amp; Aerospace Collection</collection><collection>AUTh Library subscriptions: ProQuest Central</collection><collection>Technology Collection</collection><collection>ProQuest One Community College</collection><collection>ProQuest Central</collection><collection>SciTech Premium Collection</collection><collection>ProQuest Computer Science Collection</collection><collection>ProQuest Engineering Collection</collection><collection>Advanced Technologies Database with Aerospace</collection><collection>Computer and Information Systems Abstracts – Academic</collection><collection>Computer and Information Systems Abstracts Professional</collection><collection>Engineering Database</collection><collection>Advanced Technologies &amp; Aerospace Database</collection><collection>ProQuest Advanced Technologies &amp; Aerospace Collection</collection><collection>ProQuest One Academic Eastern Edition (DO NOT USE)</collection><collection>ProQuest One Academic</collection><collection>ProQuest One Academic UKI Edition</collection><collection>ProQuest Central China</collection><collection>Engineering Collection</collection><collection>DELNET Engineering &amp; Technology Collection</collection><jtitle>Empirical software engineering : an international journal</jtitle></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext</fulltext></delivery><addata><au>Abid, Shamsa</au><au>Shamail, Shafay</au><au>Basit, Hamid Abdul</au><au>Nadi, Sarah</au><format>journal</format><genre>article</genre><ristype>JOUR</ristype><atitle>FACER: An API usage-based code-example recommender for opportunistic reuse</atitle><jtitle>Empirical software engineering : an international journal</jtitle><stitle>Empir Software Eng</stitle><date>2021-11-01</date><risdate>2021</risdate><volume>26</volume><issue>6</issue><artnum>110</artnum><issn>1382-3256</issn><eissn>1573-7616</eissn><abstract>To save time, developers often search for code examples that implement their desired software features. Existing code search techniques typically focus on finding code snippets for a single given query, which means that developers need to perform a separate search for each desired functionality. In this paper, we propose FACER ( F eature-driven A PI usage-based C ode E xamples R ecommender), a technique that avoids repeated searches through opportunistic reuse. Specifically, given the selected code snippet that matches the initial search query, FACER finds and suggests related code snippets that represent features that the developer may want to implement next. FACER first constructs a code fact repository by parsing the source code of open-source Java projects to obtain methods’ textual information, call graphs, and Application Programming Interface (API) usages. It then detects unique features by clustering methods based on similar API usages, where each cluster represents a feature or functionality. Finally, it detects frequently co-occurring features across projects using frequent pattern mining and recommends related methods from the mined patterns. To evaluate FACER, we run it on 120 Java Android apps from GitHub. We first manually validate that the detected method clusters represent methods with similar functionality. We then perform an automated evaluation to determine the best parameters (e.g., similarity threshold) for FACER. We recruit 10 professional developers along with 39 experienced students to judge FACER’s recommendation of related methods. Our results show that, on average, FACER’s recommendations are 80% precise. We also survey a total of 20 professional Android and Java developers to understand their code search and reuse experiences, and also to obtain their feedback on the usability and usefulness of FACER. The survey results show that 95% of our surveyed professional developers find the idea of related method recommendations useful during code reuse.</abstract><cop>New York</cop><pub>Springer US</pub><doi>10.1007/s10664-021-10000-w</doi><orcidid>https://orcid.org/0000-0002-7491-8258</orcidid></addata></record>
fulltext fulltext
identifier ISSN: 1382-3256
ispartof Empirical software engineering : an international journal, 2021-11, Vol.26 (6), Article 110
issn 1382-3256
1573-7616
language eng
recordid cdi_proquest_journals_2562365260
source Springer Nature
subjects Application programming interface
Applications programs
Clustering
Code reuse
Compilers
Computer Science
Data mining
Interpreters
Java
Pattern analysis
Programming Languages
Recommendation Systems for Software Engineering
Recommender systems
Searching
Software Engineering/Programming and Operating Systems
Source code
title FACER: An API usage-based code-example recommender for opportunistic reuse
url http://sfxeu10.hosted.exlibrisgroup.com/loughborough?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-01-09T07%3A50%3A02IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-proquest_cross&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft.genre=article&rft.atitle=FACER:%20An%20API%20usage-based%20code-example%20recommender%20for%20opportunistic%20reuse&rft.jtitle=Empirical%20software%20engineering%20:%20an%20international%20journal&rft.au=Abid,%20Shamsa&rft.date=2021-11-01&rft.volume=26&rft.issue=6&rft.artnum=110&rft.issn=1382-3256&rft.eissn=1573-7616&rft_id=info:doi/10.1007/s10664-021-10000-w&rft_dat=%3Cproquest_cross%3E2562365260%3C/proquest_cross%3E%3Cgrp_id%3Ecdi_FETCH-LOGICAL-c319t-41b9dc7f38d04322c6804acde0676f17f0b60fe79c7787bf2368d6bc5b5620a83%3C/grp_id%3E%3Coa%3E%3C/oa%3E%3Curl%3E%3C/url%3E&rft_id=info:oai/&rft_pqid=2562365260&rft_id=info:pmid/&rfr_iscdi=true