Skip to main content

Artificial Bee Colony for Automated Black-Box Testing of RESTful API

  • Conference paper
  • First Online:
Intelligent Data Engineering and Analytics (FICTA 2023)

Part of the book series: Smart Innovation, Systems and Technologies ((SIST,volume 371))

Abstract

Recently, RESTful APIs are widely utilized in a variety of web applications; developers utilize RESTful APIs as a blacked-out component in micro-services. Black-box testing for RESTful APIs is essential as neither of the API’s source code nor its compiled binary is always available for public access. A handful number of research studies were conducted for the automatic generation of test suite for RESTful APIs based on black-box testing. However, to our knowledge, none of them considered the test coverage criteria or the test suite optimization. This paper proposed adapting the Artificial Bee Colony (ABC) swarm intelligence algorithm for the automatic generation of test suites for RESTful APIs based on OpenAPI Specification (OAS), while also maximizing the API test coverage (path, operation, parameter, input value, and status code). Experiments were conducted on six APIs that differ from each other in the number of routes, operation types, input values, and how well the API is documented. The experiments showed that the ABC algorithm can generate test suites that achieve high coverage criteria.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 229.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 299.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Arcuri, A.: RESTful API automated test case generation with EvoMaster. ACM Trans. Softw. Eng. Methodol. 28(January 2019), 37 (2019). https://doi.org/10.1145/3293455

    Article  Google Scholar 

  2. Banias, O., Florea, D., Gyalai, R., Curiac, D.-I.: Automated specification-based testing of REST APIs. In: Selected Papers from the International Symposium on Electronics and Telecommunications ISETC 2020 (2021). https://doi.org/10.3390/s21165375

  3. Cardoso, J., Miller, J.A., Vasquez, V.: Introduction to Web Services (2007). https://doi.org/10.4018/978-1-59904-045-5.ch007

  4. Ed-douibi, H., Izquierdo, J.L., Cabot, J.: Automatic generation of test cases for REST APIs: a specification-based approach. In: 2018 IEEE 22nd International Enterprise Distributed Object Computing Conference (EDOC), pp. 181–190 (2018). doi:https://doi.org/10.1109/EDOC.2018.00031

  5. Fisal, N., Hamdy,A., Rashed, E.: Search-based regression testing optimization. Int. J. Open Source Softw. Process. 12, 1–20 (2021)

    Google Scholar 

  6. Fisal, N., Hamdy, A., Rashed, E.: Adaptive weighted sum bi-objective bat for regression testing optimization. In: Artificial Intelligence and Online Engineering: Proceedings of the 19th International Conference on Remote Engineering and Virtual Instrumentation, pp. 486–495. Springer International Publishing (2022)

    Google Scholar 

  7. Fisal, N., Hamdy, A., Rashed, E.: Multi-objective adapted binary bat for test suite reduction. Intell. Autom. Soft Comput. (2022)

    Google Scholar 

  8. Fraser, G.A.: Whole test suite generation. IEEE Trans. Softw. Eng. 39, 276–291 (2013). https://doi.org/10.1109/TSE.2012.14

    Article  Google Scholar 

  9. Hamdy, A.: Genetic fuzzy system for enhancing software estimation models. Int. J. Model. Optim. 4, 227–232 (2014)

    Google Scholar 

  10. Hamdy, A., Mohamed, A.: Greedy binary particle swarm optimization for multi-objective constrained next release problem. Int. J. Mach. Learn. Comput. 9, 561–568 (2019)

    Article  Google Scholar 

  11. Karaboga, D.: An Idea Based on Honey Bee Swarm for Numerical Optimization (2005)

    Google Scholar 

  12. Karlsson, S., Cauševič, A., Sundmark, D.: QuickREST: Property-Based Test Generation of OpenAPI-Described RESTful APIs, pp. 131–141 (2020). https://doi.org/10.1109/ICST46399.2020.00023

  13. Martin-Lopez, A., Segura, S., Ruiz-Cortés, A.: Test Coverage Criteria for RESTful Web APIs, pp. 15–21 (2019). https://doi.org/10.1145/3340433.3342822

  14. Martin-Lopez, A., Segura, S., Ruiz-Cortés, A.: RESTest: Automated Black-Box Testing of RESTful Web APIs. In: Proceedings of the 30th ACM SIGSOFT International Symposium on Software Testing and Analysis, pp. 682–685 (2021). https://doi.org/10.1145/3460319.3469082

  15. Pahl, C., Jamshidi, P.: Microservices: a systematic mapping study. In: Proceedings of the 6th International Conference on Cloud Computing and Services Science, vols. 1 and 2, pp. 137–146. SCITEPRESS—Science and Technology Publications, Lda, Rome (2016). https://doi.org/10.5220/0005785501370146

  16. RESTful Web Services—Introduction: Tutorialspoint (2021). https://www.tutorialspoint.com/restful/restful_introduction.htm

  17. Richardson, L., Ruby, S.: Restful Web Services, vol. 316. O’Reilly Media, 1st edn (2007)

    Google Scholar 

  18. Sahin, O., Akay, B.: Comparisons of metaheuristic algorithms and fitness functions on software test data generation. Appl. Soft Comput. 49, 1202–1214 (2016). https://doi.org/10.1016/j.asoc.2016.09.045

    Article  Google Scholar 

  19. Sahin, O., Akay, B.: A discrete dynamic artificial bee colony with hyper-scout for RESTful. Appl. Soft Comput. 104 (2021). https://doi.org/10.1016/j.asoc.2021.107246

  20. Segura, S., Parejo, J.A., Troya, J., Ruiz-Cortes, A.: Metamorphic testing of RESTful web APIs. IEEE Trans. Softw. Eng. 44, 1083–1099 (2018). https://doi.org/10.1109/TSE.2017.2764464

    Article  Google Scholar 

  21. Viglianisi, E., Dallago, M., Ceccato, M.: RESTTESTGEN: automated black-box testing of RESTful APIs. In: 2020 IEEE 13th International Conference on Software Testing, Validation and Verification (ICST), pp. 142–152 (2020). https://doi.org/10.1109/ICST46399.2020.00024

  22. Zhang, M., Marculescu, B., Arcuri, A.: Resource-based test case generation for RESTful web services. In: Proceedings of the Genetic and Evolutionary Computation Conference, pp. 1426–1434. Association for Computing Machinery, New York, NY, USA (2019). https://doi.org/10.1145/3321707.3321815

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Abeer Hamdy .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Ahmed, S., Hamdy, A. (2023). Artificial Bee Colony for Automated Black-Box Testing of RESTful API. In: Bhateja, V., Carroll, F., Tavares, J.M.R.S., Sengar, S.S., Peer, P. (eds) Intelligent Data Engineering and Analytics. FICTA 2023. Smart Innovation, Systems and Technologies, vol 371. Springer, Singapore. https://doi.org/10.1007/978-981-99-6706-3_1

Download citation

Publish with us

Policies and ethics