Some Java libraries have underdetermined specifications that allow more than one correct output for the same input, e.g., an output array may have its elements in any order. While such specifications have a number of advantages (e.g., a library can change while still satisfying the specification), the non-determinism inherent in underdetermined specifications can lead to failures in client code that erroneously assumes behaviors based on the library implementation instead of only the specification. Our recent work introduced the NonDex approach for detecting such erroneous assumptions by checking client code against models of library methods, which encode all behaviors allowed by the specifications
We present NonDex for JPF, which includes JPF models for 11 methods from the Java standard library (i.e., all methods that JPF supports from the current methods in Non-Dex). We use these models to systematically explore state spaces of 46 tests from student homework submissions. Our experiments show several interesting results, which provide new insights into the complexity of exploring the behaviors of code that uses underdetermined APIs and the structure of state spaces that arise in the exploration, and provide basis for future work on better detecting faults in tests that invoke underdetermined APIs as well as developing tool support for writing and maintaining more robust test suites
[1]
Donald E. Knuth,et al.
The art of computer programming. Vol.2: Seminumerical algorithms
,
1981
.
[2]
Darko Marinov,et al.
NonDex: a tool for detecting and debugging wrong assumptions on Java API specifications
,
2016,
SIGSOFT FSE.
[3]
Darko Marinov,et al.
Detecting Assumptions on Deterministic Implementations of Non-deterministic Specifications
,
2016,
2016 IEEE International Conference on Software Testing, Verification and Validation (ICST).
[4]
Radek Pelánek,et al.
Properties of state spaces and their applications
,
2008,
International Journal on Software Tools for Technology Transfer.
[5]
Chen Huo,et al.
Improving oracle quality by detecting brittle assertions and unused inputs in tests
,
2014,
FSE 2014.
[6]
Matthew B. Dwyer,et al.
Controlling factors in evaluating path-sensitive error detection techniques
,
2006,
SIGSOFT '06/FSE-14.
[7]
Robert Sedgewick,et al.
Permutation Generation Methods
,
1977,
CSUR.