Reinforcement Learning for Optimal API Recommendation in Large Systems

  • Authors

    • Dr. Giulia Romano Associate Professor, University of Milan, Italy. Author

    DOI:

    https://doi.org/10.67228/3142788X/IJMLPA-2021PII1F8H

    Published 11-02-2021

  • Reinforcement Learning, API Recommendation, Software Development Automation, Sequential Decision Making, Software Metrics, Code Context Analysis, Large-Scale Systems, Software Engineering Intelligence, Adaptive API Selection, Intelligent Software Assistance

    Issue

    Section

    Articles

    How to Cite

    [1]
    G. Romano, “Reinforcement Learning for Optimal API Recommendation in Large Systems”, IJMLPA, vol. 4, no. 2, pp. 01–07, Nov. 2021, doi: 10.67228/3142788X/IJMLPA-2021PII1F8H.
  • Abstract

    Efficient API usage is crucial for building scalable, maintainable, and high-performance software systems. Developers often struggle to select the most appropriate APIs from large and complex libraries, leading to suboptimal design, increased development time, and potential software errors. This research proposes a Reinforcement Learning (RL)–based framework to recommend optimal APIs in large software systems. The framework models the API recommendation problem as a sequential decision-making task, where an RL agent learns to select APIs that maximize system efficiency, reduce errors, and improve code quality. The agent leverages code context, historical API usage patterns, and software metrics to make informed recommendations. Experimental evaluation on open-source repositories demonstrates that the RL-based approach outperforms traditional recommendation methods, including frequency-based and collaborative filtering techniques, in terms of recommendation accuracy and relevance. The proposed method provides actionable insights to developers, reduces trial-and-error API selection, and contributes to the automation of software development processes.

  • References

    [1] Sutton, R. S., & Barto, A. G. (2018). Reinforcement Learning: An Introduction (2nd ed.). MIT Press.

    [2] Mnih, V., Kavukcuoglu, K., Silver, D., et al. (2015). Human-level control through deep reinforcement learning. Nature, 518(7540), 529–533.

    [3] Zeng, X., Zhang, D., & Chen, Q. (2019). API recommendation using deep learning models. Journal of Systems and Software, 151, 1–14.

    [4] Allamanis, M., Peng, H., & Sutton, C. (2016). A convolutional attention network for extreme summarization of source code. ICLR.

    [5] Chen, H., Zhang, H., & Li, P. (2020). Context-aware API recommendation with sequential deep learning. Information and Software Technology, 123, 106294.

    [6] Bell, R. M., & Ostrand, T. J. (2007). Predicting the fault-proneness of classes. IEEE Transactions on Software Engineering, 33(3), 167–182.

    [7] Buse, R. P., & Weimer, W. (2010). Learning a metric for code readability. IEEE Transactions on Software Engineering, 36(4), 546–558.

    [8] He, X., Liao, L., Zhang, H., et al. (2017). Neural collaborative filtering. WWW, 173–182.

    [9] Lu, S., Zhang, F., & Kim, S. (2021). Reinforcement learning-based recommendation systems in software engineering. Journal of Systems and Software, 174, 110874.

    [10] Zhang, H., Zhang, D., & Mei, H. (2018). API usage pattern mining and recommendation. Empirical Software Engineering, 23(4), 2004–2037.

    [11] Chen, H., & Zhang, H. (2019). Deep learning for context-aware API recommendation. Software: Practice and Experience, 49(12), 1771–1791.

    [12] McCabe, T. J. (1976). A complexity measure. IEEE Transactions on Software Engineering, SE-2(4), 308–320.

  • Downloads