skip to main content
research-article

Exploring Underdetermined Specifications using Java PathFinder

Published:05 January 2017Publication History
Skip Abstract Section

Abstract

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

References

  1. Ben Lambeth's GitHub. https://github.com/azy2.Google ScholarGoogle Scholar
  2. Checkstyle Pull Request. https://github.com/checkstyle/checkstyle/pull/3393.Google ScholarGoogle Scholar
  3. Class#getDeclaredFields Javadoc. https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getDeclaredFields--.Google ScholarGoogle Scholar
  4. Class#getFields in Java PathFinder. http://babelfish.arc.nasa.gov/hg/jpf/jpf-core/file/0069194b1048/src/peers/gov/nasa/jpf/vm/JPF java lang Class.java#l580.Google ScholarGoogle Scholar
  5. M. B. Dwyer, S. Person, and S. Elbaum. Controlling factors in evaluating path-sensitive error detection techniques. In FSE, pages 92--104, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Gyori, B. Lambeth, A. Shi, O. Legunsen, and D. Marinov. NonDex: A tool for detecting and debugging wrong assumptions on Java API specifications. In FSE Demo 2016 to appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. HashSet Javadoc. https://docs.oracle.com/javase/8/docs/api/java/util/HashSet.html.Google ScholarGoogle Scholar
  8. C. Huo and J. Clause. Improving oracle quality by detecting brittle assertions and unused inputs in tests. In FSE, pages 621--631, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. JUnit 4.11 - What's new? Test execution order. http://randomallsorts.blogspot.com/2012/12/junit-411-whats-new-test-execution-order.html.Google ScholarGoogle Scholar
  10. D. Knuth. Seminumerical algorithms, the art of computer programming, vol. 2 1997.Google ScholarGoogle Scholar
  11. NonDex Source Code. https://github.com/TestingResearchIllinois/NonDex.Google ScholarGoogle Scholar
  12. R. Pelánek. Properties of state spaces and their applications. STTT, 10(5):443--454, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. R. Sedgewick. Permutation generation methods. ACM CSUR, 9(2):137--164, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. Shi, A. Gyori, O. Legunsen, and D. Marinov. Detecting assumptions on deterministic implementations of non-deterministic specifications. In ICST, pages 80--90, 2016. Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Exploring Underdetermined Specifications using Java PathFinder

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGSOFT Software Engineering Notes
      ACM SIGSOFT Software Engineering Notes  Volume 41, Issue 6
      November 2016
      110 pages
      ISSN:0163-5948
      DOI:10.1145/3011286
      Issue’s Table of Contents

      Copyright © 2017 Copyright is held by the owner/author(s)

      Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the Owner/Author.

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 5 January 2017

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader