Increasing Trust in Software by Synthesizing Property-based Tests from Existing Unit Tests : A study on the expansion of existing test suites through the creation of property-based tests via invariants inferred from existing example-based unit tests
Abstract: Many software projects include an extensive suite of example-based unit tests. The examples in the test suite can be used as an implicit specification of the behavior of the software. Inferring invariants from these examples may aid in the creation of property-based tests. However, the existing research on this topic is scarce and there is none conducted using the inference of invariants. In this thesis, we examine software projects with existing test suites. The Daikon invariant detector is used to infer invariants from test executions. The resulting invariants are then used to formalize properties to be used in property-based tests. The success of the process depends on a few variables. First, the tests have to be descriptive enough to allow any generalization to take place. Second, the Daikon invariant detector needs to be able to create an abstraction from the examples that are not too restrictive nor too lenient. Third, the format of the invariants needs to match available value generator constraints in property-based testing frameworks. Fourth, the resulting tests need to provide some benefit to the test suite. In all experiments, at least one of these requirements is not met. The conclusion is that inferred invariants are likely not useable in the creation of property-based tests. Furthermore, in instances where properties can be derived from invariants, the resulting tests do not practically improve the test suite. For the test suite to be improved, the abstraction of examples needs to describe properties of the software not contained in the existing tests.
AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)