Published January 29, 2021 | Version v1

Specification-based Test case generation for API misuse detection tools

  • 1. TU Darmstadt
  • 2. Independent
  • 3. Rigs IT
  • 4. University of Paderborn

Description

Misuses of application interfaces (APIs) can cause serious programming mistakes. Past research has proposed to identify and thus avoid misuses through static and dynamic API misuse detection tools. But these tools themselves can be faulty, causing distracting false warnings or otherwise overlooking actual misuses. In this work, we thus present a novel approach that facilitates test automation for API misuse detectors by automatically generating test cases from existing API usage specifications. Our specific prototype APItestGen supports test generation from the API specification language CrySL. Its realization required us to overcome interesting challenges because CrySL specifications not only constrain method parameters but also method-call sequences and combinations of both on multiple related API objects. We evaluated APItestGen by generating tests for the Java’s entire default crypto API, the JCA, and using the tests to validate the static analysis implemented in the CogniCryptSAST static API misuse checker. The evaluation revealed previously unknown bugs in the analyzer.

Files

latest-testcases-selectall.zip

Files (432.1 kB)

Name Size
md5:48c10172e97b6f8432650bcec1bfb870
108.0 kB Preview Download
md5:dc378d10b417bbad2657c903ee5683f9
108.0 kB Preview Download
md5:40df93ba2015c89bb25d321d1d4c6117
108.0 kB Preview Download
md5:176a8af2e7cf294f3315de38a73e7832
108.1 kB Preview Download