Neural Unit Test Suggestions

09/20/2021
by   Elizabeth Dinella, et al.
0

Testing is widely recognized as an important stage of the software development lifecycle. Effective software testing can provide benefits such as documentation, bug finding, and preventing regressions. In particular, unit tests document a unit's intended functionality. A test oracle, typically expressed as an condition, documents the intended behavior of the unit under a given test prefix. Synthesizing a functional test oracle is a challenging problem, as it has to capture the intended functionality and not the implemented functionality. In this paper, we propose (Neural Unit Test Suggestions), a unified transformer-based neural approach to infer both exceptional and assertion test oracles based on the context of the focal method. Our approach can handle units with ambiguous or missing documentations, and even units with a missing implementation. We evaluate our approach on both oracle inference accuracy and functional bug-finding. Our technique improves accuracy by 33% over existing oracle inference approaches, achieving 96% overall accuracy on a held out test dataset. Furthermore, we show that when integrated with a automated test generation tool (EvoSuite), our approach finds 54 real world bugs in large-scale Java programs, including bugs that are not found by any other automated testing method in our evaluation.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/03/2023

Perfect Is the Enemy of Test Oracle

Automation of test oracles is one of the most challenging facets of soft...
research
05/26/2023

Towards More Realistic Evaluation for Neural Test Oracle Generation

Effective unit tests can help guard and improve software quality but req...
research
07/29/2023

Neural-Based Test Oracle Generation: A Large-scale Evaluation and Lessons Learned

Defining test oracles is crucial and central to test development, but ma...
research
07/28/2023

Towards Automatic Generation of Amplified Regression Test Oracles

Regression testing is crucial in ensuring that pure code refactoring doe...
research
09/19/2023

Revisiting and Improving Retrieval-Augmented Deep Assertion Generation

Unit testing validates the correctness of the unit under test and has be...
research
12/14/2020

Automatic Property-based Testing of GraphQL APIs

In recent years, GraphQL has become a popular way to expose web APIs. Wi...
research
08/09/2022

Google Test/Google Mock to Verify Critical Embedded Software

Critical embedded systems (CES) have become ubiquitous in whether medica...

Please sign up or login with your details

Forgot password? Click here to reset