Starting from:

$30

EECS3311-Lab 3 Solved

2      Problem
In this lab, you will work on completing the contracts of a simple Library system, which involves two classes, i.e., Library and Book. An object of Library contains a list of books. A library can add new books, delete existing books, find the books by given title, etc. The project we provided has been implemented completely, your task is to write appropriate contracts by using JML.

The resource of JML can be found here:

•    JML command-line tool: https://github.com/OpenJML/OpenJML/releases/tag/0.8.51

•    Example: http://www.openjml.org/documentation/execution.shtml

•    Tutorial of Lab3 is in https://echo360.ca/

3        Getting Started
•    Go to the course eClass page for Section Z. Under Lab 3, download the file EECS3311 Lab3.zip which contains the completed java source file for this lab.

•    Unzip the file, and you should see a Java file named Library.java.

•    You will use the command-line version of JML to verify your contracts.

4       You Tasks
4.1       Complete the Contracts
You are expected to write valid contracts in the Library class. Each instance of “TODO:” in the class indicates which contract you have to complete.

4.2        Verify Contracts with JML
You are expected to verify your contracts with the type-checking provided by JML. Note that, the static checking and runtime assertion checking are not required.

command: java -jar openjml.jar Library.java

More products