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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
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
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
Cardoso, J., Miller, J.A., Vasquez, V.: Introduction to Web Services (2007). https://doi.org/10.4018/978-1-59904-045-5.ch007
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
Fisal, N., Hamdy,A., Rashed, E.: Search-based regression testing optimization. Int. J. Open Source Softw. Process. 12, 1–20 (2021)
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)
Fisal, N., Hamdy, A., Rashed, E.: Multi-objective adapted binary bat for test suite reduction. Intell. Autom. Soft Comput. (2022)
Fraser, G.A.: Whole test suite generation. IEEE Trans. Softw. Eng. 39, 276–291 (2013). https://doi.org/10.1109/TSE.2012.14
Hamdy, A.: Genetic fuzzy system for enhancing software estimation models. Int. J. Model. Optim. 4, 227–232 (2014)
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)
Karaboga, D.: An Idea Based on Honey Bee Swarm for Numerical Optimization (2005)
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
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
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
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
RESTful Web Services—Introduction: Tutorialspoint (2021). https://www.tutorialspoint.com/restful/restful_introduction.htm
Richardson, L., Ruby, S.: Restful Web Services, vol. 316. O’Reilly Media, 1st edn (2007)
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
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
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
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
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
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.
About this paper
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
DOI: https://doi.org/10.1007/978-981-99-6706-3_1
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-99-6705-6
Online ISBN: 978-981-99-6706-3
eBook Packages: Intelligent Technologies and RoboticsIntelligent Technologies and Robotics (R0)