Published July 6, 2023 | Version v1
Software Open

Behavioral up/down casting for statically typed languages (Tool artifact)

Authors/Creators

Description

Software requirements

* Docker

* GNU Bash

Getting Started

* Open Docker Desktop with your GUI: this will launch the daemon.

* Open a shell.

Shell instructions

1. Import the image provided into docker:

  * `docker load -i behavioral-casting-tool.tar`

2. Run the docker image:

  * `docker run -it behavioral-casting-tool:latest`

3. A prompt of the form `root@8de54d614a6d:/tool/example#` should be opened. Now run:

  * `./run.sh`

Expected output

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.8 MB)

Name Size Download all
md5:30287edf8d8ccc2337a7638ca42634fd
482.8 MB Download