Modern web applications make extensive use of API calls to update the UI state in response to user events or server- side changes. For such applications, API-level testing can play an important role, in-between unit-level testing and UI-level (or end-to-end) testing. Existing API testing tools require API specifications (e.g., OpenAPI), which often may not be available or, when available, be inconsistent with the API implementation, thus limiting the applicability of automated API testing to web applications. In this paper, we present an approach that leverages UI testing to enable API-level testing for web applications. Our technique navigates the web application under test and automatically generates an API-level test suite, along with an OpenAPI specification that describes the application’s server-side APIs (for REST-based web applications). A key element of our solution is a dynamic approach for inferring API endpoints with path parameters via UI navigation and directed API probing. We evaluated the technique for its accuracy in inferring API specifications and the effectiveness of the “carved” API tests. Our results on seven open-source web applications show that the technique achieves 98% precision and 56% recall in inferring endpoints. The carved API tests, when added to test suites generated by two automated REST API testing tools, increase statement coverage by 24% and 29% and branch coverage by 75% and 77%, on average. The main benefits of our technique are: (1) it enables API-level testing of web applications in cases where existing API testing tools are inapplicable and (2) it creates API-level test suites that cover server-side code efficiently, while exercising APIs as they would be invoked from an application’s web UI, and that can augment existing API test suites.
Fri 19 MayDisplayed time zone: Hobart change
11:00 - 12:30 | Reverse engineeringTechnical Track / Journal-First Papers / SEIP - Software Engineering in Practice at Meeting Room 104 Chair(s): Wei Le Iowa State University | ||
11:00 15mTalk | SeeHow: Workflow Extraction from Programming Screencasts through Action-Aware Video Analytics Technical Track Dehai Zhao Australian National University, Australia, Zhenchang Xing , Xin Xia Huawei, Deheng Ye Tencent AI Lab, Xiwei (Sherry) Xu CSIRO’s Data61, Liming Zhu CSIRO’s Data61 | ||
11:15 15mTalk | AidUI: Toward Automated Recognition of Dark Patterns in User Interfaces Technical Track S M Hasan Mansur George Mason University, Sabiha Salma George Mason University, Damilola Awofisayo Duke University, Kevin Moran George Mason University | ||
11:30 15mTalk | Carving UI Tests to Generate API Tests and API Specification Technical Track Rahulkrishna Yandrapally University of British Columbia, Canada, Saurabh Sinha IBM Research, Rachel Tzoref-Brill IBM Research, Ali Mesbah University of British Columbia (UBC) Pre-print | ||
11:45 15mTalk | CFG2VEC: Hierarchical Graph Neural Network for Cross-Architectural Software Reverse Engineering SEIP - Software Engineering in Practice Shih-Yuan Yu UCI, Yonatan Achamyeleh UCI, Chonghan Wang UCI, Anton Kocheturov Siemens Technology, Patrick Eisen Siemens Technology, Mohammad Al Faruque UCI | ||
12:00 15mTalk | Ex pede Herculem: Augmenting Activity Transition Graph for Apps via Graph Convolution Network Technical Track Zhe Liu Institute of Software, Chinese Academy of Sciences, Chunyang Chen Monash University, Junjie Wang Institute of Software at Chinese Academy of Sciences; University of Chinese Academy of Sciences, Yuhui Su Institute of Software, Chinese Academy of Sciences, Yuekai Huang Institute of Software, Chinese Academy of Sciences, Jun Hu Institute of Software, Chinese Academy of Sciences, Qing Wang Institute of Software at Chinese Academy of Sciences; University of Chinese Academy of Sciences | ||
12:15 7mTalk | VID2XML: Automatic Extraction of a Complete XML Data from Mobile Programming Screencasts Journal-First Papers Mohammad D. Alahmadi Department of Software Engineering, College of Computer Science and Engineering, University of Jeddah, Jeddah, Saudi Arabia. |