Behavioral up/down casting for statically typed languages (Tool artifact)
Authors/Creators
Description
You may find the latest version of the tool at https://github.com/jdmota/java-typestate-checker
Artifact Submission
Title of the submitted paper: Behavioral up/down casting for statically typed languages
The Docker image contains:
- The code for the Car example presented in the paper (in the
/tool/examplefolder). The main classes are:- The
ClientCodeclass (presented in the paper) with well-behaved code which is accepted by the tool; - The
WrongClientCodeclass which shows evidence that the tool catches errors regarding protocol compliance or completion.
- The
- The jar file of the tool (in the
/tool/distfolder).
This artifact shows how the developed tool verifies code with respect to protocol compliance and completion, in particular, the motivating example presented in the paper.
- Docker
- GNU Bash
- Open Docker Desktop with your GUI: this will launch the daemon.
- Open a shell.
- Import the image provided into docker:
docker load -i behavioral-casting-tool.tar
- Run the docker image:
docker run -it behavioral-casting-tool:latest
- A prompt of the form
root@8de54d614a6d:/tool/example#should be opened. Now run:
./run.sh
The tool verifies all the Java code in the folder /tool/example, including the main classes ClientCode and WrongClientCode. The ClientCode.java file contains well-behaved code (as presented in the paper), so no error should be reported on it. The WrongClientCode.java file contains ill-behaved code, so errors should be reported on it. In summary, the expected tool output for the given example is the following:
WrongClientCode.java:9: error: [suv] did not complete its protocol (found: State{SUV, COMF_ON})
public static void example2() { // The tool should report an error here about protocol completion
^
WrongClientCode.java:6: error: Cannot call [switchMode] on State{SUV, OFF}
f.switchMode(); // The tool should report an error here about protocol compliance
^
2 errors
Files
Files
(482.2 MB)
| Name | Size | Download all |
|---|---|---|
|
md5:ea4c100d3f3643eb702e4241572662bc
|
482.2 MB | Download |
Additional details
Related works
- Is published in
- Conference paper: 10.4230/LIPIcs.ECOOP.2024.5 (DOI)