Metamorphic Testing of Navigation Software: a Pilot Study with Google Maps
Total Page:16
File Type:pdf, Size:1020Kb
Proceedings of the 51st Hawaii International Conference on System Sciences j 2018 Metamorphic Testing of Navigation Software: A Pilot Study with Google Maps Joshua Brown, Zhi Quan Zhou£, and Yang-Wai Chow Institute of Cybersecurity and Cryptology School of Computing and Information Technology University of Wollongong Wollongong, NSW 2522, Australia Abstract—Millions of people use navigation software every day exceed 50% of the total development budget. Testing in- to commute and travel. In addition, many systems rely upon the volves executing the software under test (SUT) with a set of correctness of navigation software to function, ranging from test cases together with a mechanism against which the tester directions applications to self-driving machinery. Navigation can decide whether the outcomes of test case executions are software is difficult to test because it is hard or very expensive correct (that is, a test oracle). The oracle problem refers to evaluate its output. This difficulty is generally known as the to the situation where an oracle does not exist or it is oracle problem, a fundamental challenge in software testing. theoretically available but practically too expensive to be In this study, we propose a metamorphic testing strategy to applied. The oracle problem is a fundamental challenge in alleviate the oracle problem in testing navigation software, and software testing practice but this problem is often ignored conduct a case study by testing the Google Maps mobile app, its by the research community — compared with many other web service API, and its graphical user interface. The results aspects of testing such as automated test case generation, show that our strategy is effective with the detection of several the challenge of test oracle automation “has received signif- real-life bugs in Google Maps. This study is the first work on icantly less attention, and remains comparatively less well- automated testing of navigation software with the detection of solved” [3]. real-life bugs. There is a severe oracle problem when testing navigation Keywords: Mobile navigation software, Google Maps, di- software. This is because the real-world road networks are rections API, Web service, Graphical User Interface, software so complex that in most situations it is infeasible to validate whether or not a route returned by the navigation software testing, oracle problem, metamorphic testing, verification, val- is correct and optimal, except trivial cases. This difficulty idation. results in a scenario where developers cannot utilize con- ventional testing techniques. In fact, there has been little 1. Introduction research on automated testing of navigation software in the literature. A related study was conducted by Wright et al. The road network is a vast and complex system of [4], where they manually evaluated the position accuracy interconnecting roads and intersections which are extended and measurement accuracy (driving distance) computed by through the use of external services such as a road-ferry. In GPS receivers against a local area road map. the world, there are over 64 million kilometres of road [1] A growing body of research and industrial application and it continues to grow and change every day. Navigation has investigated the concept of metamorphic testing (MT) software is designed to plan an optimal route between two [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], and has points within the constraints it has been passed; the route proven MT to be a highly effective testing paradigm for contains the directions that the user should follow to reach the detection of real-life software faults in the absence of the destination. Navigation systems are one of the most an ideal test oracle. The idea of MT is simple: Instead of popular applications on the Internet, and on smart phones. focusing on the correctness of each individual output, MT They are the most popular application installed on over looks at the relationships among the inputs and outputs of 50% of the global smart phone market [2]. Furthermore, multiple executions of the SUT. Such relationships are called these systems are mission critical applications, as their metamorphic relations (MRs), and are necessary properties failure could potentially cause traffic accidents, especially of the intended software’s functionality. For example, when when they are used for the navigation of self-driving cars. testing a web search engine, it is very hard for testers Navigation systems, therefore, must be thoroughly verified to assess the quality of the search results, such as their and validated. accuracy and completeness [8]. Nevertheless, MT can be To verify and validate software systems, testing is es- applied by identifying the following metamorphic relation: sential. It is widely accepted that, in a typical commercial A stable search engine should return similar results for sim- software development project, the cost of testing can easily ilar queries. For instance, although a search for [ today’s £Corresponding author. Email: [email protected]. Telephone: (+61-2) movies in Honolulu ] and a search for [ Honolulu 4221 5399. movies today ] may return different results, the two URI: http://hdl.handle.net/10125/50602 Page 5687 ISBN: 978-0-9981331-1-9 (CC BY-NC-ND 4.0) sets of search results should have a large intersection if the validation: The vast majority of users do not have access search engine under test is robust [8]. Because MT looks to the detailed algorithm designs and system/subsystem at the relationships among multiple SUT executions instead specifications of the navigation software they are using. of focusing on the verification of each individual output, it Without access to these specifications, the user manual or can be performed in the absence of an ideal oracle, hence online help pages are the only type of information source alleviating the oracle problem. available to the users. However, as pointed out by Zhou et al. Although the basic concept of MT is simple, it requires [8], user manuals or online help pages are usually very brief specific study when applied to different application domains and are not equivalent to the system specification defined as [9]. This is because different application areas can have “an adequate guide to building a product that will fulfill its different properties of interest to investigate. The present goals” [15]. Consequently, it is basically impossible for users paper proposes applying MT to test navigation software to evaluate the navigation system they are using against its in order to alleviate the oracle problem in testing such technical specifications or the intended algorithms. systems. A case study has been conducted with Google Zhou et al. [8] pointed out that the above phenomenon Maps, including the testing of its mobile applications, its can be quite common when testing many types of software web service APIs (namely, the Directions API), as well as its applications such as web services, poorly evolved software, Graphical User Interface (GUI) at maps.google.com. Google and open source software, and showed that MT can be an Maps was selected for the case study because it is the most effective approach to addressing these difficulties caused by popular mapping system by far [2] (except in China, where a lack of detailed knowledge about the system design and Google services could not be accessed). specifications coupled with the oracle problem. In this study we ask the following research question: For developers of the navigation systems, even if they have complete documentation and specifications, it is still ∙ RQ: Can we have a practical and effective method of automatically testing navigation systems in the face very challenging for them to test such systems because of of the severe oracle problem? the complexity of the underlying algorithms and data. As will be shown in this paper, MT can be an effective testing The contributions of this paper are summarized as fol- approach for both developers and users, as well as third- lows: party independent testers. ∙ To the best of our knowledge, this is the first work in the literature to address automated testing of nav- 2.2. Metamorphic Testing (MT) igation software. ∙ The detection of real-life bugs in Google Maps is MT [5], [8], [9] alleviates the oracle problem by testing significant, and demonstrates the effectiveness of our the SUT against prescribed MRs, which are necessary prop- approach. erties of the intended program’s behavior. The difference The testing methodology presented in this study can also between MRs and other types of program correctness prop- be applied to other forms of navigation systems beyond erties is that an MR involves multiple executions of the target Google Maps, and can be used as the foundation for future program. Even if the correctness of an individual output work in the verification and validation of similar systems cannot be verified due to the lack of an oracle, the tester can such as self-driving cars. still check whether the expected relationship among multiple The rest of this paper is organized as follows: Sec- executions is satisfied. If the MR is violated for any of the tion 2 further introduces some background knowledge and test cases, a failure is detected. describes our testing approach with a focus on the identi- For example, let p.G; x; y/ be a program that calculates fied MRs for the navigation software under test. Section 3 the shortest path from node x to node y in an undirected presents our test results by highlighting the detected defects graph G. When G is large and complex, it can be difficult to in Google Maps. Section 4 makes further discussions and verify the output of p because no oracle can be practically concludes the paper. applied. To perform MT in this situation, we can identify many MRs for the shortest path problem, one of which 2.