Search-Based Mock Generation of External Web Service Interactions

  • Susruthan Seran*
  • , Man Zhang
  • , Andrea Arcuri
  • *Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Testing large and complex enterprise software systems can be a challenging task. This is especially the case when the functionality of the system depends on interactions with other external services over a network (e.g., external REST APIs). Although several techniques in the research literature have been shown to be effective at generating test cases in many different software testing contexts, dealing with external services is still a major research challenge. In industry, a common approach is to mock external web services for testing purposes. However, generating and configuring mock web services can be a very time-consuming task. Furthermore, external services may not be under the control of the same developers of the tested application. In this paper, we present a novel search-based approach aimed at fully automated mocking external web services as part of white-box, search-based fuzzing. We rely on code instrumentation to detect all interactions with external services, and how their response data is parsed. We then use such information to enhance a search-based approach for fuzzing. The tested application is automatically modified (by manipulating DNS lookups) to rather interact with instances of mock web servers. The search process not only generates inputs to the tested applications, but also it automatically setups responses in those mock web server instances, aiming at maximizing code coverage and fault-finding. An empirical study on 3 open-source REST APIs from EMB, and one industrial API from an industry partner, shows the effectiveness of our novel techniques, i.e., significantly improves code coverage and fault detection.

Original languageEnglish
Title of host publicationSearch-Based Software Engineering - 15th International Symposium, SSBSE 2023, Proceedings
EditorsPaolo Arcaini, Tao Yue, Erik M. Fredericks
PublisherSpringer Science and Business Media Deutschland GmbH
Pages52-66
Number of pages15
ISBN (Print)9783031487958
DOIs
StatePublished - 2024
Externally publishedYes
Event15th International Symposium on Search-Based Software Engineering, SSBSE 2023 - San Francisco, United States
Duration: 8 Dec 20238 Dec 2023

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume14415 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Conference

Conference15th International Symposium on Search-Based Software Engineering, SSBSE 2023
Country/TerritoryUnited States
CitySan Francisco
Period8/12/238/12/23

Keywords

  • Automated Mock Generation
  • Microservices
  • Search-Based Test Generation
  • Search-based Software Engineering

Fingerprint

Dive into the research topics of 'Search-Based Mock Generation of External Web Service Interactions'. Together they form a unique fingerprint.

Cite this