scholarly journals Automated Specification-Based Testing of REST APIs

Sensors ◽  
2021 ◽  
Vol 21 (16) ◽  
pp. 5375
Author(s):  
Ovidiu Baniaș ◽  
Diana Florea ◽  
Robert Gyalai ◽  
Daniel-Ioan Curiac

Nowadays, REpresentational State Transfer Application Programming Interfaces (REST APIs) are widely used in web applications, hence a plethora of test cases are developed to validate the APIs calls. We propose a solution that automates the generation of test cases for REST APIs based on their specifications. In our approach, apart from the automatic generation of test cases, we provide an option for the user to influence the test case generation process. By adding user interaction, we aim to augment the automatic generation of APIs test cases with human testing expertise and specific context. We use the latest version of OpenAPI 3.x and a wide range of coverage metrics to analyze the functionality and performance of the generated test cases, and non-functional metrics to analyze the performance of the APIs. The experiments proved the effectiveness and practicability of our method.

Mathematics ◽  
2021 ◽  
Vol 9 (15) ◽  
pp. 1779
Author(s):  
Wanida Khamprapai ◽  
Cheng-Fa Tsai ◽  
Paohsi Wang ◽  
Chi-En Tsai

Test case generation is an important process in software testing. However, manual generation of test cases is a time-consuming process. Automation can considerably reduce the time required to create adequate test cases for software testing. Genetic algorithms (GAs) are considered to be effective in this regard. The multiple-searching genetic algorithm (MSGA) uses a modified version of the GA to solve the multicast routing problem in network systems. MSGA can be improved to make it suitable for generating test cases. In this paper, a new algorithm called the enhanced multiple-searching genetic algorithm (EMSGA), which involves a few additional processes for selecting the best chromosomes in the GA process, is proposed. The performance of EMSGA was evaluated through comparison with seven different search-based techniques, including random search. All algorithms were implemented in EvoSuite, which is a tool for automatic generation of test cases. The experimental results showed that EMSGA increased the efficiency of testing when compared with conventional algorithms and could detect more faults. Because of its superior performance compared with that of existing algorithms, EMSGA can enable seamless automation of software testing, thereby facilitating the development of different software packages.


2021 ◽  
Vol 11 (21) ◽  
pp. 10166
Author(s):  
Leonard Stepien ◽  
Silvia Thal ◽  
Roman Henze ◽  
Hiroki Nakamura ◽  
Jacobo Antona-Makoshi ◽  
...  

Comprehensive safety evaluation methodologies for automated driving systems that account for the large complexity real traffic are currently being developed. This work adopts a scenario-based safety evaluation approach and aims at investigating an advanced methodology to generate test cases by applying heuristics to naturalistic driving data. The targeted requirements of the generated test cases are severity, exposure, and realism. The methodology starts with the extraction of scenarios from the data and their split in two subsets—containing the relatively more critical scenarios and, respectively, the normal driving scenarios. Each subset is analysed separately, in regard to the parameter value distributions and occurrence of dependencies. Subsequently, a heuristic search-based approach is applied to generate test cases. The resulting test cases clearly discriminate between safety critical and normal driving scenarios, with the latter covering a wider spectrum than the former. The verification of the generated test cases proves that the proposed methodology properly accounts for both severity and exposure in the test case generation process. Overall, the current study contributes to fill a gap concerning the specific applicable methodologies capable of accounting for both severity and exposure and calls for further research to prove its applicability in more complex environments and scenarios.


2019 ◽  
Vol 10 (2) ◽  
pp. 1-26 ◽  
Author(s):  
Munish Khanna ◽  
Naresh Chauhan ◽  
Dilip Kumar Sharma

Regression testing of evolving software is a critical constituent of the software development process. Due to resources constraints, test case prioritization is one of the strategies followed in regression testing during which a test case that satisfies predefined objectives the most, as the tester perceives, would be executed the earliest. In this study, all the experiments were performed on three web applications consisting of 65 to 100 pages with lines of code ranging from 5000 to 7000. Various state-of-the-art approaches such as, heuristic approaches, Greedy approaches, and meta heuristic approaches were applied so as to identify the prioritized test sequence which maximizes the value of average percentage of fault detection. Performance of these algorithms was compared using different parameters and it was concluded that the Artificial Bee Colony algorithm performs better than all. Two novel greedy algorithms are also proposed in the study, of which the goal is to smartly manage the state of a tie, where a tie exhibits the condition that all the test cases participating in the tie are of equal significance in achieving the objective. It has also been validated that the performance of these novel proposed algorithm(s) is better than that of traditionally followed greedy approach, most of the time.


Author(s):  
Jesús Morán ◽  
Cristian Augusto ◽  
Antonia Bertolino ◽  
Claudio De La Riva ◽  
Javier Tuya

Web application testing is a great challenge due to the management of complex asynchronous communications, the concurrency between the clients-servers, and the heterogeneity of resources employed. It is difficult to ensure that a test case is re-running in the same conditions because it can be executed in undesirable ways according to several environmental factors that are not easy to fine-grain control such as network bottlenecks, memory issues or screen resolution. These environmental factors can cause flakiness, which occurs when the same test case sometimes obtains one test outcome and other times another outcome in the same application due to the execution of environmental factors. The tester usually stops relying on flaky test cases because their outcome varies during the re-executions. To fix and reduce the flakiness it is very important to locate and understand which environmental factors cause the flakiness. This paper is focused on the localization of the root cause of flakiness in web applications based on the characterization of the different environmental factors that are not controlled during testing. The root cause of flakiness is located by means of spectrum-based localization techniques that analyse the test execution under different combinations of the environmental factors that can trigger the flakiness. This technique is evaluated with an educational web platform called FullTeaching. As a result, our technique was able to locate automatically the root cause of flakiness and provide enough information to both understand it and fix it.


2013 ◽  
Vol 709 ◽  
pp. 616-619
Author(s):  
Jing Chen

This paper proposes a genetic algorithm-based method to generate test cases. This method provides information for test case generation using state machine diagrams. Its feature is realizing automation through fewer generated test cases. In terms of automatic generation of test data based on path coverage, the goal is to build a function that can excellently assess the generated test data and guide the genetic algorithms to find the targeting parameter values.


2014 ◽  
Vol 568-570 ◽  
pp. 1488-1496
Author(s):  
Ming Gang Xu ◽  
Yong Min Mu ◽  
Zhi Hua Zhang ◽  
Ang Liu

Automatic test case generation has been a hotspot and a difficult problem in the software testing, Accurately and efficiently generate test cases can improve the efficiency of software testing. Java programs have many characteristics such as encapsulation, inheritance, polymorphism and so on, it is convenient for software design and development, but to bring automated testing some difficulties. This article on the Java program of automatic test case generation method is studied and presents a framework for automatic generation of test cases. With this framework, test case suite will be generated quickly and accurately. Experimental results show that automatic Java test case generation framework can quickly and accurately generate test cases , reduce labor costs and improve efficiency.


Complexity ◽  
2021 ◽  
Vol 2021 ◽  
pp. 1-11
Author(s):  
Liaoyan Zhang

Streaming media server is the core system of audio and video application in the Internet; it has a wide range of applications in music recommendation. As song libraries and users of music websites and APPs continue to increase, user interaction data are generated at an increasingly fast rate, making the shortcomings of the original offline recommendation system and the advantages of the real-time streaming recommendation system more and more obvious. This paper describes in detail the working methods and contents of each stage of the real-time streaming music recommendation system, including requirement analysis, overall design, implementation of each module of the system, and system testing and analysis, from a practical scenario. Moreover, this paper analyzes the current research status and deficiencies in the field of music recommendation by analyzing the user interaction data of real music websites. From the actual requirements of the system, the functional and performance goals of the system are proposed to address these deficiencies, and then the functional structure, general architecture, and database model of the system are designed, and how to interact with the server side and the client side is investigated. For the implementation of data collection and statistics module, this paper adopts Flume and Kafka to collect user behavior data and uses Spark Streaming and Redis to count music popularity trends and support efficient query. The recommendation engine module in this paper is designed and optimized using Spark to implement incremental matrix decomposition on data streams, online collaborative topic model, and improved item-based collaborative filtering algorithm. In the system testing section, the functionality and performance of the system are tested, and the recommendation engine is tested with real datasets to show the discovered music themes and analyze the test results in detail.


2006 ◽  
Vol 11 (3) ◽  
pp. 273-284 ◽  
Author(s):  
DAVID BROOKE WETZEL

This paper presents a three-stage model (analysis, reconstruction and performance) for the conservation of interactive electroacoustic works for which the original technology is now obsolete or otherwise unavailable. The first stage, analysis, is a detailed documentation of the electronic processes and effects required for each work in a format that is independent of any specific device or system. The analysis provides a blueprint for future realisations using available technology. The second stage, reconstruction, provides a working performance resource, as well as a test case for the validity of the analysis. Reconstructed systems are then tested and refined through the third stage, performance. With repeated performances, compositions gain wider exposure and may be evaluated by listeners on their musical merits. To date, the author has analysed, reconstructed and performed several works for clarinet and interactive electronics. Each performance has informed the continued development of the newly reconstructed system, and has in some cases led to corrections to the underlying analysis. As a classically trained clarinettist and computer musician, the author's approach to the conservation of electroacoustic repertoire comes from a desire to find performable works and to keep them viable and accessible for as long as possible. Four works for clarinet and interactive electronics (by Musgrave, Pennycook, Kramer, and Lippe) are presented as test cases for this model.


2017 ◽  
Vol 8 (4) ◽  
pp. 31-50
Author(s):  
Hossain Shahriar ◽  
Hisham Haddad ◽  
Pranahita Bulusu

Lightweight Directory Access Protocol (LDAP) is commonly used in web applications to provide lookup information and enforcing authentication. Web applications may suffer from LDAP injection vulnerabilities that can lead to security breaches such as login bypass and privilege escalation. This paper1 proposes OCL fault injection-based detection of LDAP injection attacks. The authors extract design-level information and constraints expressed in OCL and then randomly alter them to generate test cases that have the capability to uncover LDAP injection vulnerabilities. The authors proposed approaches to implement test case generation, and they used one open source PHP application and one custom application to evaluate the proposed approach. The analysis shows that this approach can detect LDAP injection vulnerabilities.


Author(s):  
Akihiro Hori ◽  
Shingo Takada ◽  
Toshiyuki Kurabayashi ◽  
Haruto Tanno

Much work has been done on automating regression testing for applications. But most of them focus on test execution. Little work has been done on automatically determining if a test case passes or fails. This decision is often made by comparing the results of executing test cases on a base version of the application and post-modification version of the application. If the two results match, the test case passes, otherwise fails. However, to the best of our knowledge, there is no regression testing method for automatically deciding pass/fail of dynamic Web applications which use JavaScript or CSS. We propose a method that automatically decides if a dynamic Web application passes a regression test case. The basic idea is to obtain a screenshot each time the GUI of the Web application (i.e. Web page) changes its state, and then compare each corresponding screenshot to see if they match. The evaluation results showed that the accuracy rate of our approach is high and our approach can be considered as fast enough for practical use.


Sign in / Sign up

Export Citation Format

Share Document