Skip to main content
Top

2017 | OriginalPaper | Chapter

Detecting and Ranking API Usage Pattern in Large Source Code Repository: A LFM Based Approach

Authors : Jitong Zhao, Yan Liu

Published in: Machine Learning and Knowledge Extraction

Publisher: Springer International Publishing

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Code examples are key resources for helping programmers to learn correct Application Programming Interface (API) usages efficiently. However, most framework and library APIs fail in providing sufficient and adequate code examples in corresponding official documentations. Thus, it takes great programmers’ efforts to browse and extract API usage examples from websites. To reduce such effort, this paper proposes a graph-based pattern-oriented mining approach, LFM-OUPD (Local fitness measure for detecting overlapping usage patterns) for API usage facility, that recommends proper API code examples from data analytics. API method queries are accepted from programmers and corresponding code files are collected from related API dataset. The detailed structural links among API method elements in conceptual source codes are captured and generate a code graph structure. Lancichinetti et al. proposed an overlapping community detecting algorithm (Local fitness measure, LFM), based on the local optimization of a fitness function. In LFM-OUPD, a mining algorithm based on LFM is presented to explore the division of method sequences in the directed source code element graph and detect candidates of different API usage patterns. Then a ranking approach is applied to obtain appropriate API usage pattern and code example candidates. A case study on Google Guava is conducted to evaluate the effectiveness of this approach.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Literature
1.
go back to reference Aeschlimann, M., Baumer, D., Lanneluc, J.: Java tool smithing extending the eclipse java development tools. In: Proceedings of the 2nd EclipseCon (2005) Aeschlimann, M., Baumer, D., Lanneluc, J.: Java tool smithing extending the eclipse java development tools. In: Proceedings of the 2nd EclipseCon (2005)
2.
go back to reference Baumes, J., Goldberg, M.K., Krishnamoorthy, M.S., Magdon-Ismail, M., Preston, N.: Finding communities by clustering a graph into overlapping subgraphs. IADIS AC 5, 97–104 (2005) Baumes, J., Goldberg, M.K., Krishnamoorthy, M.S., Magdon-Ismail, M., Preston, N.: Finding communities by clustering a graph into overlapping subgraphs. IADIS AC 5, 97–104 (2005)
3.
go back to reference Bosu, A., Carver, J.C., Bird, C., Orbeck, J., Chockley, C.: Process aspects and social dynamics of contemporary code review: insights from open source development and industrial practice at microsoft. IEEE Trans. Softw. Eng. 42, 302–321 (2016)CrossRef Bosu, A., Carver, J.C., Bird, C., Orbeck, J., Chockley, C.: Process aspects and social dynamics of contemporary code review: insights from open source development and industrial practice at microsoft. IEEE Trans. Softw. Eng. 42, 302–321 (2016)CrossRef
4.
go back to reference Clauset, A.: Finding local community structure in networks. Phys. Rev. E 72(2), 026132 (2005)CrossRef Clauset, A.: Finding local community structure in networks. Phys. Rev. E 72(2), 026132 (2005)CrossRef
5.
go back to reference Gregory, S.: An algorithm to find overlapping community structure in networks. In: Kok, J.N., Koronacki, J., Lopez de Mantaras, R., Matwin, S., Mladenič, D., Skowron, A. (eds.) PKDD 2007. LNCS, vol. 4702, pp. 91–102. Springer, Heidelberg (2007). doi:10.1007/978-3-540-74976-9_12 CrossRef Gregory, S.: An algorithm to find overlapping community structure in networks. In: Kok, J.N., Koronacki, J., Lopez de Mantaras, R., Matwin, S., Mladenič, D., Skowron, A. (eds.) PKDD 2007. LNCS, vol. 4702, pp. 91–102. Springer, Heidelberg (2007). doi:10.​1007/​978-3-540-74976-9_​12 CrossRef
6.
go back to reference Ko, A.J., Myers, B., Aung, H.H.: Six learning barriers in end-user programming systems. In: IEEE Symposium on Visual Languages and Human Centric Computing, pp. 199–206 (2004) Ko, A.J., Myers, B., Aung, H.H.: Six learning barriers in end-user programming systems. In: IEEE Symposium on Visual Languages and Human Centric Computing, pp. 199–206 (2004)
7.
go back to reference Lancichinetti, A., Fortunato, S., Kertész, J.: Detecting the overlapping and hierarchical community structure in complex networks. New J. Phys. 11(3), 033015 (2009)CrossRef Lancichinetti, A., Fortunato, S., Kertész, J.: Detecting the overlapping and hierarchical community structure in complex networks. New J. Phys. 11(3), 033015 (2009)CrossRef
8.
go back to reference Malliaros, F.D., Vazirgiannis, M.: Clustering and community detection in directed networks: a survey. Phys. Rep. 533(4), 95–142 (2013)MathSciNetCrossRefMATH Malliaros, F.D., Vazirgiannis, M.: Clustering and community detection in directed networks: a survey. Phys. Rep. 533(4), 95–142 (2013)MathSciNetCrossRefMATH
9.
go back to reference Mar, L.W., Wu, Y.C., Jiau, H.C.: Recommending proper API code examples for documentation purpose. In: 2011 18th Asia Pacific Software Engineering Conference (APSEC), pp. 331–338 (2011) Mar, L.W., Wu, Y.C., Jiau, H.C.: Recommending proper API code examples for documentation purpose. In: 2011 18th Asia Pacific Software Engineering Conference (APSEC), pp. 331–338 (2011)
10.
go back to reference Newman, M.E., Girvan, M.: Finding and evaluating community structure in networks. Phys. Rev. E 69(2), 026113 (2004)CrossRef Newman, M.E., Girvan, M.: Finding and evaluating community structure in networks. Phys. Rev. E 69(2), 026113 (2004)CrossRef
11.
go back to reference Ponzanelli, L., Bavota, G., Di Penta, M., Oliveto, R., Lanza, M.: Prompter: a self-confident recommender system. In: 2014 IEEE International Conference on Software Maintenance and Evolution (ICSME), pp. 577–580. IEEE (2014) Ponzanelli, L., Bavota, G., Di Penta, M., Oliveto, R., Lanza, M.: Prompter: a self-confident recommender system. In: 2014 IEEE International Conference on Software Maintenance and Evolution (ICSME), pp. 577–580. IEEE (2014)
12.
go back to reference Radevski, S., Hata, H., Matsumoto, K.: Towards building API usage example metrics. In: 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), vol. 1, pp. 619–623. IEEE (2016) Radevski, S., Hata, H., Matsumoto, K.: Towards building API usage example metrics. In: 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), vol. 1, pp. 619–623. IEEE (2016)
13.
go back to reference Robillard, M.P.: What makes APIs hard to learn? Answers from developers. Softw. IEEE 26(6), 27–34 (2009)CrossRef Robillard, M.P.: What makes APIs hard to learn? Answers from developers. Softw. IEEE 26(6), 27–34 (2009)CrossRef
14.
go back to reference Saied, M.A., Abdeen, H., Benomar, O., Sahraoui, H.: Could we infer unordered API usage patterns only using the library source code? In: 2015 IEEE 23rd International Conference on Program Comprehension (ICPC), pp. 71–81 (2015) Saied, M.A., Abdeen, H., Benomar, O., Sahraoui, H.: Could we infer unordered API usage patterns only using the library source code? In: 2015 IEEE 23rd International Conference on Program Comprehension (ICPC), pp. 71–81 (2015)
15.
go back to reference Saied, M.A., Benomar, O., Abdeen, H., Sahraoui, H.: Mining multi-level API usage patterns. In: 2015 IEEE 22nd International Conference on Software Analysis, Evolution and Reengineering (SANER), pp. 23–32. IEEE (2015) Saied, M.A., Benomar, O., Abdeen, H., Sahraoui, H.: Mining multi-level API usage patterns. In: 2015 IEEE 22nd International Conference on Software Analysis, Evolution and Reengineering (SANER), pp. 23–32. IEEE (2015)
16.
go back to reference Sawant, A.A., Bacchelli, A.: A dataset for API usage. In: Proceedings of the 12th Working Conference on Mining Software Repositories, pp. 506–509. IEEE Press (2015) Sawant, A.A., Bacchelli, A.: A dataset for API usage. In: Proceedings of the 12th Working Conference on Mining Software Repositories, pp. 506–509. IEEE Press (2015)
17.
go back to reference Wang, J., Dang, Y., Zhang, H., Chen, K., Xie, T., Zhang, D.: Mining succinct and high-coverage API usage patterns from source code. In: 2013 10th IEEE Working Conference on Mining Software Repositories (MSR), pp. 319–328 (2013) Wang, J., Dang, Y., Zhang, H., Chen, K., Xie, T., Zhang, D.: Mining succinct and high-coverage API usage patterns from source code. In: 2013 10th IEEE Working Conference on Mining Software Repositories (MSR), pp. 319–328 (2013)
18.
go back to reference Wang, L., Fang, L., Wang, L., Li, G., Xie, B., Yang, F.: APIExample: an effective web search based usage example recommendation system for Java APIs. In: 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE), pp. 592–595 (2011) Wang, L., Fang, L., Wang, L., Li, G., Xie, B., Yang, F.: APIExample: an effective web search based usage example recommendation system for Java APIs. In: 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE), pp. 592–595 (2011)
19.
go back to reference Wu, Y.C., Mar, L.W., Jiau, H.C.: CoDocent: support API usage with code example and API documentation. In: 2010 Fifth International Conference on Software Engineering Advances (ICSEA), pp. 135–140 (2010) Wu, Y.C., Mar, L.W., Jiau, H.C.: CoDocent: support API usage with code example and API documentation. In: 2010 Fifth International Conference on Software Engineering Advances (ICSEA), pp. 135–140 (2010)
20.
go back to reference Xie, J., Kelley, S., Szymanski, B.K.: Overlapping community detection in networks: the state-of-the-art and comparative study. ACM Comput. Surv. (CSUR) 45(4), 43 (2013)CrossRefMATH Xie, J., Kelley, S., Szymanski, B.K.: Overlapping community detection in networks: the state-of-the-art and comparative study. ACM Comput. Surv. (CSUR) 45(4), 43 (2013)CrossRefMATH
21.
go back to reference Zagalsky, A., Barzilay, O., Yehudai, A.: Example overflow: using social media for code recommendation. In: 2012 Third International Workshop on Recommendation Systems for Software Engineering (RSSE), pp. 38–42 (2012) Zagalsky, A., Barzilay, O., Yehudai, A.: Example overflow: using social media for code recommendation. In: 2012 Third International Workshop on Recommendation Systems for Software Engineering (RSSE), pp. 38–42 (2012)
22.
Metadata
Title
Detecting and Ranking API Usage Pattern in Large Source Code Repository: A LFM Based Approach
Authors
Jitong Zhao
Yan Liu
Copyright Year
2017
DOI
https://doi.org/10.1007/978-3-319-66808-6_4

Premium Partner