Software Construction Assignment 6: Contracts |
Due: May 8, 2018 @ 10pm. Please include a README.txt that has both partners' names and email addresses. |
For this assignment, you should add contracts to your Tsuro implementation. For some of the contracts, blame for failure lies with the player and for some, blame lies with the administrative infrastucture. For those where blame lies with the administrator, abort the program when a failure is detected. For those where the blame lies with the player, note that the player has violated the contract (via a print out), kick them out of the game, and replace them with a random player. Do not stop the game for the other players. Behavioral Contracts The following invariants govern the interactions in Tsuro:
Sequence Contracts Here is the player interface's sequence contract: (initialize . place-pawn . play-turn * . end-game)*(where get-name can be called at any time). Implement this contracts in the classes that implement these interfaces Your own contracts As we discussed in class, contracts belong at key interfaces in the program. The above contracts protect the administration of the game from the players (and vice-versa). Find another place in your own organization of your program that would benefit from contracts and work out some contracts to add to it. |
Software Construction |