Synthesizing Parameterized Unit Tests to Detect Object Invariant Violations
نویسندگان
چکیده
Automatic test case generation techniques rely on a description of the input data that the unit under test is intended to handle. For heap data structures, such a description is typically expressed as some form of object invariant. If a program may create structures that violate the invariant, the test data generated using the invariant systematically ignores possible inputs and, thus, potentially misses bugs. In this paper, we present a technique that detects violations of object invariants. We describe three scenarios in which traditional invariant checking may miss such violations. Based on templates that capture these scenarios, we synthesize parameterized unit tests that are likely to violate invariants, and use dynamic symbolic execution to generate inputs to the synthesized tests. We have implemented our technique as an extension to Pex and detected a significant number of invariant violations in real applications.
منابع مشابه
Static Detection of Atomic-Set-Serializability Violations
Vaziri et al. [1] propose a data-centric approach to synchronization. The key underlying concept of their work is the atomic set, which specifies the existence of an invariant that holds on a set of fields of an object type. In addition, they formalize a set of eleven data-access scenarios that completely specify the set of non-serializable interleaving patterns that can lead to an atomic-set s...
متن کاملParameterized Unit Testing in the Open Source Wild
With recent advances in test generation research, powerful test generation tools are now at the fingertips of developers in software industry. For example, Microsoft Research Pex, a state-of-the-art tool based on dynamic symbolic execution, has been shipped as IntelliTest in Visual Studio 2015. For test inputs automatically generated by such tool, to supply test oracles (beyond just uncaught ru...
متن کاملAutomatically Binding Variables of Invariants to Violating Elements in an OCL-Aligned XBase-Language
Constraints that have to hold for all models of a modeling language are often specified as invariants using the Object Constraint Language (OCL). If violations of such invariants shall be documented or resolved in a software system, the exact model elements that violate these conditions have to be computed. OCL validation engines provide, however, only a single context element at which a check ...
متن کاملFuzzy adaptive tracking control for a class of nonlinearly parameterized systems with unknown control directions
This paper addresses the problem of adaptive fuzzy tracking control for aclass of nonlinearly parameterized systems with unknown control directions.In this paper, the nonlinearly parameterized functions are lumped into the unknown continuous functionswhich can be approximated by using the fuzzy logic systems (FLS) in Mamdani type. Then, the Nussbaum-type function is used to de...
متن کاملRetrofitting Unit Tests for Parameterized Unit Testing
Recent advances in software testing introduced parameterized unit tests (PUT), which accept parameters, unlike conventional unit tests (CUT), which do not accept parameters. PUTs are more beneficial than CUTs with regards to fault-detection capability, since PUTs help describe the behaviors of methods under test for all test arguments. In general, existing applications often include manually wr...
متن کامل