Journal of Computer Applications ›› 2022, Vol. 42 ›› Issue (11): 3520-3526.DOI: 10.11772/j.issn.1001-9081.2021122070
• ChinaService 2021 • Previous Articles
Jiaqi ZHANG1,2, Yanchun SUN1,2(), Gang HUANG1,2
Received:
2021-12-07
Revised:
2022-01-02
Accepted:
2022-01-13
Online:
2022-03-02
Published:
2022-11-10
Contact:
Yanchun SUN
About author:
ZHANG Jiaqi, born in 1999, M. S. candidate. Her research interests include service computing, big data analysis.Supported by:
通讯作者:
孙艳春
作者简介:
张佳琪(1999—),女,河北石家庄人,硕士研究生,主要研究方向:服务计算、大数据分析基金资助:
CLC Number:
Jiaqi ZHANG, Yanchun SUN, Gang HUANG. Recommendation service for API use cases based on open source community analysis[J]. Journal of Computer Applications, 2022, 42(11): 3520-3526.
张佳琪, 孙艳春, 黄罡. 基于开源社区分析的API使用案例推荐服务[J]. 《计算机应用》唯一官方网站, 2022, 42(11): 3520-3526.
Add to citation manager EndNote|Ris|BibTeX
URL: http://www.joca.cn/EN/10.11772/j.issn.1001-9081.2021122070
调查情况 | 理解程度/% | ||
---|---|---|---|
完全 可以 | 有时 可以 | 基本 不可以 | |
通过一个代码文件中多个函数实现的某功能 | 32.9 | 40.5 | 26.6 |
通过多个代码文件中函数实现的某功能 | 11.4 | 63.3 | 25.3 |
Tab. 1 Questionnaire survey results on help effect of single function annotation on completing a certain use scenario or function
调查情况 | 理解程度/% | ||
---|---|---|---|
完全 可以 | 有时 可以 | 基本 不可以 | |
通过一个代码文件中多个函数实现的某功能 | 32.9 | 40.5 | 26.6 |
通过多个代码文件中函数实现的某功能 | 11.4 | 63.3 | 25.3 |
使用场景 | 案例数量 | 使用场景 | 案例数量 |
---|---|---|---|
logout | 335 | register | 303 |
login | 1 118 | search | 514 |
delete | 3 926 | upload | 428 |
add | 2 329 |
Tab. 2 Number of cases under different usage scenarios
使用场景 | 案例数量 | 使用场景 | 案例数量 |
---|---|---|---|
logout | 335 | register | 303 |
login | 1 118 | search | 514 |
delete | 3 926 | upload | 428 |
add | 2 329 |
API学习方式 | 占比/% | 涉及过或预期涉及的 使用场景 | 占比/% |
---|---|---|---|
阅读官方文档 | 77.42 | Add | 90.32 |
查找相关博客 | 95.16 | Delete | 98.39 |
通过实际案例学习 | 93.55 | Search | 95.16 |
Login | 90.32 | ||
Logout | 82.26 | ||
Register | 93.55 | ||
Upload | 91.94 |
Tab. 3 Some results of questionnaire collection on API learning approaches and selected usage scenarios
API学习方式 | 占比/% | 涉及过或预期涉及的 使用场景 | 占比/% |
---|---|---|---|
阅读官方文档 | 77.42 | Add | 90.32 |
查找相关博客 | 95.16 | Delete | 98.39 |
通过实际案例学习 | 93.55 | Search | 95.16 |
Login | 90.32 | ||
Logout | 82.26 | ||
Register | 93.55 | ||
Upload | 91.94 |
是否有帮助 | 可理解性 | 是否具有代表性 | |||
---|---|---|---|---|---|
评价 | 占比/% | 评价 | 占比/% | 评价 | 占比/% |
很有帮助 | 76.19 | 可理解性强 | 90.48 | 是 | 92.86 |
有帮助 | 19.05 | 可理解性一般 | 9.52 | 否 | 7.14 |
基本没有帮助 | 4.76 | 基本无可理解性 | 0.00 | ||
完全没有帮助 | 0.00 |
Tab. 4 Evaluation results of inexperienced developers
是否有帮助 | 可理解性 | 是否具有代表性 | |||
---|---|---|---|---|---|
评价 | 占比/% | 评价 | 占比/% | 评价 | 占比/% |
很有帮助 | 76.19 | 可理解性强 | 90.48 | 是 | 92.86 |
有帮助 | 19.05 | 可理解性一般 | 9.52 | 否 | 7.14 |
基本没有帮助 | 4.76 | 基本无可理解性 | 0.00 | ||
完全没有帮助 | 0.00 |
是否有帮助 | 可理解性 | 是否具有代表性 | |||
---|---|---|---|---|---|
评价 | 占比/% | 评价 | 占比/% | 评价 | 占比/% |
很有帮助 | 66.67 | 可理解性强 | 90.47 | 是 | 95.24 |
有帮助 | 23.81 | 可理解性一般 | 95.24 | 否 | 4.76 |
基本没有帮助 | 9.52 | 基本无可理解性 | 0.00 | ||
完全没有帮助 | 0.00 |
Tab. 5 Evaluation results of experienced developers
是否有帮助 | 可理解性 | 是否具有代表性 | |||
---|---|---|---|---|---|
评价 | 占比/% | 评价 | 占比/% | 评价 | 占比/% |
很有帮助 | 66.67 | 可理解性强 | 90.47 | 是 | 95.24 |
有帮助 | 23.81 | 可理解性一般 | 95.24 | 否 | 4.76 |
基本没有帮助 | 9.52 | 基本无可理解性 | 0.00 | ||
完全没有帮助 | 0.00 |
标注者 | 标注选择的 代码行数 | 属于本文抽取结果 的代码行数 | 重合率/% |
---|---|---|---|
1 | 1 032 | 763 | 73.90 |
2 | 1 102 | 792 | 71.87 |
Tab. 6 Information extraction verification results
标注者 | 标注选择的 代码行数 | 属于本文抽取结果 的代码行数 | 重合率/% |
---|---|---|---|
1 | 1 032 | 763 | 73.90 |
2 | 1 102 | 792 | 71.87 |
方法 | TOP‑3命中率 | TOP‑5命中率 | TOP‑10命中率 |
---|---|---|---|
本文算法 | 42.86 | 54.29 | 82.86 |
特征向量 | 33.33 | 45.71 | 65.71 |
Tab. 7 Expert verification results of recommended cases
方法 | TOP‑3命中率 | TOP‑5命中率 | TOP‑10命中率 |
---|---|---|---|
本文算法 | 42.86 | 54.29 | 82.86 |
特征向量 | 33.33 | 45.71 | 65.71 |
1 | SEKER A, DIRI B, ARSLAN H, et al. Open source software development challenges: a systematic literature review on GitHub[J]. International Journal of Open Source Software and Processes, 2020, 11(4): 1-26. 10.4018/ijossp.2020100101 |
2 | GOUSIOS G, SPINELLIS D. GHTorrent: GitHub's data from a firehose[C]// Proceedings of the 9th IEEE Working Conference on Mining Software Repositories. Piscataway: IEEE, 2012: 12-21. 10.1109/msr.2012.6224294 |
3 | 陈丹,王星,何鹏,等. 开源社区中已有开发者的合作行为分析[J]. 计算机科学, 2016, 43(6A):476-479, 501. 10.11896/j.issn.1002-137X.2016.6A.112 |
CHEN D, WANG X, HE P, et al. Towards understanding existing developers’ collaborative behavior in OSS communities[J]. Computer Science, 2016, 43(6A):476-479, 501. 10.11896/j.issn.1002-137X.2016.6A.112 | |
4 | RAHMAN M M, ROY C K, REDL J, et al. CORRECT: code reviewer recommendation at GitHub for Vendasta technologies[C]// Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering. New York: ACM, 2016: 792-797. 10.1145/2970276.2970283 |
5 | MONTANDON J E, SILVA L L, VALENTE M T. Identifying experts in software libraries and frameworks among GitHub users[C]// Proceedings of the IEEE/ACM 16th International Conference on Mining Software Repositories. Piscataway: IEEE, 2019: 276-287. 10.1109/msr.2019.00054 |
6 | MANES S S, BAYSAL O. How often and what StackOverflow posts do developers reference in their GitHub projects?[C]// Proceedings of the IEEE/ACM 16th International Conference on Mining Software Repositories. Piscataway: IEEE, 2019:235-239. 10.1109/msr.2019.00047 |
7 | BALTES S, DUMANI L, TREUDE C, et al. SOTorrent: reconstructing and analyzing the evolution of stack overflow posts[C]// Proceedings of the ACM/IEEE 15th International Conference on Mining Software Repositories. New York: ACM, 2018: 319-330. 10.1145/3196398.3196430 |
8 | BALTES S, TREUDE C, DIEHL S. SOTorrent: studying the origin, evolution, and usage of stack overflow code snippets[C]// Proceedings of the IEEE/ACM 16th International Conference on Mining Software Repositories. Piscataway: IEEE, 2019: 191-194. 10.1109/msr.2019.00038 |
9 | ZEROUALI A, MENS T, ROBLES G, et al. On the diversity of software package popularity metrics: an empirical study of NPM[C]// Proceedings of the IEEE 26th International Conference on Software Analysis, Evolution and Reengineering. Piscataway: IEEE, 2019: 589-593. 10.1109/saner.2019.8667997 |
10 | 张云帆,周宇,黄志球. 基于语义相似度的API使用模式推荐[J]. 计算机科学, 2020, 47(3): 34-40. 10.11896/jsjkx.190300053 |
ZHANG Y F, ZHOU Y, HUANG Z Q. Semantic similarity based API usage pattern recommendation[J]. Computer Science, 2020, 47(3): 34-40. 10.11896/jsjkx.190300053 | |
11 | LIN Z Q, ZOU Y Z, ZHAO J F, et al. Improving software text retrieval using conceptual knowledge in source code[C]// Proceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering. Piscataway: IEEE, 2017: 123-134. 10.1109/ase.2017.8115625 |
12 | HUANG Q, XIA X, XING Z C, et al. API method recommendation without worrying about the task‑API knowledge gap[C]// Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering. Piscataway: IEEE, 2018: 293-304. 10.1145/3238147.3238191 |
13 | NIE L M, HE J, REN Z L, et al. Query expansion based on crowd knowledge for code search[J]. IEEE Transactions on Services Computing, 2016, 9(5): 771-783. 10.1109/tsc.2016.2560165 |
14 | XIE W K, PENG X, LIU M W, et al. API method recommendation via explicit matching of functionality verb phrases[C]// Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. New York: ACM, 2020: 1015-1026. 10.1145/3368089.3409731 |
15 | SHATNAWI A, SHATNAWI H, SAIED M A, et al. Identifying software components from object‑oriented APIs based on dynamic analysis[C]// Proceedings of the 2018 ACM/IEEE 26th International Conference on Program Comprehension. New York: ACM, 2018: 189-199. 10.1145/3196321.3196349 |
16 | SHATNAWI A, SERIAI A, SAHRAOUI H, et al. Mining software components from object‑oriented APIs[EB/OL]. (2016-06-02) [2021-05-06]. . 10.1007/978-3-319-14130-5_23 |
17 | MATOS A S, FERREIRA FILHO J B, ROCHA L S. Splitting APIs: an exploratory study of software unbundling[C]// Proceedings of the 2019 IEEE/ACM 16th International Conference on Mining Software Repositories. Piscataway: IEEE, 2019: 360-370. 10.1109/msr.2019.00062 |
18 | 杨程,范强,王涛,等. 基于多维特征的开源项目个性化推荐方法[J]. 软件学报, 2017, 28(6): 1357-1372. 10.13328/j.cnki.jos.005230 |
YANG C, FAN Q, WANG T, et al. Multi‑feature based personal recommendation approach for open source project[J]. Journal of Software, 2017, 28(6): 1357-1372. 10.13328/j.cnki.jos.005230 | |
19 | SHEN Q, XIE B, ZOU Y Z, et al. NLI2Code: reusing libraries with natural language interface[C]// Proceedings of the 2019 International Conference on Software and Systems Reuse, LNCS 11602. Cham: Springer, 2019: 168-184. |
20 | ZIMMERMAN K, RUPAKHETI C R. An automated framework for recommending program elements to novices[C]// Proceedings of the 30th IEEE/ACM International Conference on Automated Software Engineering. Piscataway: IEEE, 2015: 283-288. 10.1109/ase.2015.54 |
21 | KIM J, LEE S, HWANG S W, et al. Enriching documents with examples: a corpus mining approach[J]. ACM Transactions on Information Systems, 2013, 31(1): No.1. 10.1145/2414782.2414783 |
22 | ZHONG H, XIE T, ZHANG L, et al. MAPO: mining and recommending API usage patterns[C]// Proceedings of the 2009 European Conference on Object‑Oriented Programming, LNCS 5653. Berlin: Springer, 2009: 318-343. |
23 | WANG J, DANG Y N, ZHANG H Y, et al. Mining succinct and high‑coverage API usage patterns from source code[C]// Proceedings of the 10th Working Conference on Mining Software Repositories. Piscataway: IEEE, 2013: 319-328. 10.1109/msr.2013.6624045 |
24 | NGUYEN T T, NGUYEN H A, PHAM N H, et al. Graph‑based mining of multiple object usage patterns[C]// Proceedings of the 7th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering. New York: ACM, 2009: 383-392. 10.1145/1595696.1595767 |
25 | NGUYEN T T, PHAM H V, VU P M, et al. Learning API usages from bytecode: a statistical approach[C]// Proceedings of the IEEE/ACM 38th International Conference on Software Engineering. New York: ACM, 2016: 416-427. 10.1145/2884781.2884873 |
26 | GU X D, ZHANG H Y, KIM S. CodeKernel: a graph kernel based approach to the selection of API usage examples[C]// Proceedings of the 34th IEEE/ACM International Conference on Automated Software Engineering. Piscataway: IEEE, 2019: 590-601. 10.1109/ase.2019.00061 |
27 | CHEN C, PENG X, XING Z C, et al. Holistic combination of structural and textual code information for context based API recommendation[J]. IEEE Transactions on Software Engineering, 2022, 48(8): 2987-3009. 10.1109/tse.2021.3074309 |
28 | BORGWARDT K M, KRIEGEL H P. Shortest‑path kernels on graphs[C]// Proceedings of the 5th IEEE International Conference on Data Mining. Piscataway: IEEE, 2005: 74-81. |
[1] | Jialiang HAN, Yudong HAN, Xuanzhe LIU, Yaoshuai ZHAO, Di FENG. Personalized recommendation service system based on cloud-client-convergence [J]. Journal of Computer Applications, 2022, 42(11): 3506-3512. |
[2] | LI Zhen, NIU Jun, WANG Kui, XIN Yuanyuan. Optimization of source code search based on multi-feature weight assignment [J]. Journal of Computer Applications, 2018, 38(3): 812-817. |
[3] | GU Yisheng, ZENG Guosun. Accurate search method for source code by combining syntactic and semantic queries [J]. Journal of Computer Applications, 2017, 37(10): 2958-2963. |
[4] | FENG Qiuyan. System-level test case generating method based on UML model [J]. Journal of Computer Applications, 2014, 34(1): 276-280. |
[5] | . Design and implementation of file monitoring system of Windows Mobile [J]. Journal of Computer Applications, 2009, 29(09): 2534-2536. |
[6] | . Design and implementation of distributed file buffer system based on synchronization engine [J]. Journal of Computer Applications, 2006, 26(12): 2994-2997. |
Viewed | ||||||
Full text |
|
|||||
Abstract |
|
|||||