Inline Tests

09/13/2022
by   Yu Liu, et al.
0

Unit tests are widely used to check source code quality, but they can be too coarse-grained or ill-suited for testing individual program statements. We introduce inline tests to make it easier to check for faults in statements. We motivate inline tests through several language features and a common testing scenario in which inline tests could be beneficial. For example, inline tests can allow a developer to test a regular expression in place. We also define language-agnostic requirements for inline testing frameworks. Lastly, we implement I-Test, the first inline testing framework. I-Test works for Python and Java, and it satisfies most of the requirements. We evaluate I-Test on open-source projects by using it to test 144 statements in 31 Python programs and 37 Java programs. We also perform a user study. All nine user study participants say that inline tests are easy to write and that inline testing is beneficial. The cost of running inline tests is negligible, at 0.007x–0.014x, and our inline tests helped find two faults that have been fixed by the developers.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/01/2020

The test set for the TransCoder system

The TransCoder system translates source code between Java, C++, and Pyth...
research
12/16/2019

RTj: a Java framework for detecting and refactoring rotten green test cases

Rotten green tests are passing tests which have, at least, one assertion...
research
08/01/2022

Flaky Test Sanitisation via On-the-Fly Assumption Inference for Tests with Network Dependencies

Flaky tests cause significant problems as they can interrupt automated b...
research
11/21/2020

An Empirical Study on Failed Error Propagation in Java Programs with Real Faults

During testing, developers can place oracles externally or internally wi...
research
04/11/2018

An Easy & Collaborative RDF Data Entry Method using the Spreadsheet Metaphor

Spreadsheets are widely used by knowledge workers, especially in the ind...
research
08/31/2022

Predicting Flaky Tests Categories using Few-Shot Learning

Flaky tests are tests that yield different outcomes when run on the same...
research
08/29/2018

Certified Mapper: Repeated testing for acyclicity and obstructions to the nerve lemma

The Mapper algorithm does not include a check for whether the cover prod...

Please sign up or login with your details

Forgot password? Click here to reset