Over the past few years, deep neural networks (DNNs) have been continuously expanding their real-world applications for source code processing tasks across the software engineering domain, e.g., clone detection, code search, comment generation. Although quite a few recent works have been performed on testing of DNNs in the context of image and speech processing, limited progress has been achieved so far on DNN testing in the context of source code processing, that exhibits rather unique characteristics and challenges.
In this paper, we propose a search-based testing framework for DNNs of source code embedding and its downstream processing tasks like Code Search. To generate new test inputs, we adopt popular source code refactoring tools to generate the semantically equivalent variants. For more effective testing, we leverage the DNN mutation testing to guide the testing direction. To demonstrate the usefulness of our technique, we perform a large-scale evaluation on popular DNNs of source code processing based on multiple state-of-the-art code embedding methods (i.e., Code2vec, Code2seq and CodeBERT). The testing results show that our generated adversarial samples can on average reduce the performance of these DNNs from 5.41% to 9.58%. Through retraining the DNNs with our generated adversarial samples, the robustness of DNN can improve by 23.05% on average. The evaluation results also show that our adversarial test generation strategy has the least negative impact (median of 3.56%), on the performance of the DNNs for regular test data, compared to the other methods.
Search-based software testing (SBT) is an effective and efficient approach for testing automated driving systems (ADS). However, testing pipelines for ADS testing are particularly challenging as they involve integrating complex driving simulation platforms and establishing communication protocols and APIs with the desired search algorithm. This complexity prevents a wide adoption of SBT and thorough empirical comparative experiments with different simulators and search approaches. We present OpenSBT, an open-source, modular and extensible framework to facilitate the SBT of ADS. With OpenSBT, i…
Generating a test suite for a quantum program such that it has the maximum number of failing tests is an optimization problem. For such optimization, search-based testing has shown promising results in the context of classical programs. To this end, we present a test generation tool for quantum programs based on a genetic algorithm, called QuSBT (Search-based Testing of Quantum Programs). QuSBT automates the testing of quantum programs, with the aim of finding a test suite having the maximum number of failing test cases. QuSBT utilizes IBM's Qiskit as the simulation framework for quantum progr…
The complexity of computer games is ever increasing. In this setup, guiding an automated test algorithm to find a solution to solve a testing task in a game's huge interaction space is very challenging. Having a model of a system to automatically generate test cases would have a strong impact on the effectiveness and efficiency of the algorithm. However, manually constructing a model turns out to be expensive and time-consuming. In this study, we propose an online agent-based search approach to solve common testing tasks when testing computer games that also constructs a model of the system on…
Drivora: A Unified and Extensible Infrastructure for Search-based Autonomous Driving Testing
Singapore Management University(新加坡管理大学);University of Ottawa(渥太华大学);Lero Centre, University of Limerick(利默里克大学Lero中心);Zhejiang Sci-Tech University(浙江理工大学)
Today, most automated test generators, such as search-based software testing (SBST) techniques focus on achieving high code coverage. However, high code coverage is not sufficient to maximise the number of bugs found, especially when given a limited testing budget. In this paper, we propose an automated test generation technique that is also guided by the estimated degree of defectiveness of the source code. Parts of the code that are likely to be more defective receive more testing budget than the less defective parts. To measure the degree of defectiveness, we leverage Schwa, a notable defec…
Technical University of Munich(慕尼黑工业大学);Università degli Studi di Napoli Federico II(那不勒斯费德里科二世大学);University of St. Gallen(圣加仑大学);Università della Svizzera italiana(瑞士意大利语区大学)
Search-Based Metamorphic Testing of Vision-Language Models in Autonomous Underwater Robotic Software
Simula Research Laboratory(Simula 研究实验室);Oslo Metropolitan University(奥斯陆都市大学);Mondragon University(蒙德拉贡大学);National Institute of Informatics(国立情报学研究所);Group Research and Development, DNV AS(DNV AS 集团研发部)
Software faults are commonly occurred due to interactions between one or more input parameters in complex software systems. Software test design techniques can be implemented to ensure the quality of the developed software. Exhaustive testing tests all possible test configurations; however, it is infeasible considering time and resource constraints. Pairwise t-way testing is a sampling strategy that focuses on testing every pair of parameter combination, effectively reducing the generated test size as opposed to testing exhaustively. In this paper, we propose a new pairwise t-way strategy call…
Block-based programming languages enable young learners to quickly implement fun programs and games. The Scratch programming environment is particularly successful at this, with more than 50 million registered users at the time of this writing. Although Scratch simplifies creating syntactically correct programs, learners and educators nevertheless frequently require feedback and support. Dynamic program analysis could enable automation of this support, but the test suites necessary for dynamic analysis do not usually exist for Scratch programs. It is, however, possible to cast test generation …
Automated test generators, such as search based software testing (SBST) techniques, replace the tedious and expensive task of manually writing test cases. SBST techniques are effective at generating tests with high code coverage. However, is high code coverage sufficient to maximise the number of bugs found? We argue that SBST needs to be focused to search for test cases in defective areas rather in non-defective areas of the code in order to maximise the likelihood of discovering the bugs. Defect prediction algorithms give useful information about the bug-prone areas in software. Therefore, w…
Defect predictors, static bug detectors and humans inspecting the code can locate the parts of the program that are buggy before they are discovered through testing. Automated test generators such as search-based software testing (SBST) techniques can use this information to direct their search for test cases to likely buggy code, thus speeding up the process of detecting existing bugs. However, often the predictions given by these tools or humans are imprecise, which can misguide the SBST technique and may deteriorate its performance. In this paper, we study the impact of imprecision in defec…
Graz University of Technology(格拉茨工业大学);Silicon Austria Labs(奥地利硅实验室);Lamarr Security Research(拉马尔安全研究中心)
Evaluation of deep reinforcement learning (RL) is inherently challenging. Especially the opaqueness of learned policies and the stochastic nature of both agents and environments make testing the behavior of deep RL agents difficult. We present a search-based testing framework that enables a wide range of novel analysis capabilities for evaluating the safety and performance of deep RL agents. For safety testing, our framework utilizes a search algorithm that searches for a reference trace that solves the RL task. The backtracking states of the search, called boundary states, pose safety-critica…
Graz University of Technology(格拉茨工业大学);Institute for Software Technology(软件技术研究所);Christian Doppler Laboratory for Quality Assurance Methodologies for Autonomous Cyber-Physical Systems(克里斯蒂安·多普勒自主网络物理系统质量保障方法实验室)
In this paper, we outline an approach for automatic generation of challenging road networks for virtual testing of an automated lane keep system. Based on a set of control points, we construct a parametric curve that represents a road network, which defines the dynamic driving task an automated lane keep system equipped vehicle has to perform. Changing control points has global influence on the resulting road geometry. Our approach uses search to find a set of control points that results in a challenging road geometry, eventually forcing the vehicle to leave the intended path. We evaluated our…