Software Construction in for HSE Series 3

Preparation

Download links and other details can be found via the course web page:

http://www.win.tue.nl/˜wstomv/edu/sc-hse/

1. In the book Introduction to Programming Using Java by David Eck, read §4.5, 4.6.

2. In the book Programming in the Large with Design Patterns by Eddie Burris, read Chapter 7.

3. Read the handouts Notation and Specification.

4. Install local version of Java Platform Standard Edition 8 Documentation.

5. Download PrePostDoclet.jar, configure your IDE (DrJava, NetBeans, IntelliJ) to use the TU/e PrePostDoclet (see FAQ), and make sure you know how to configure a NetBeans project to use it. This makes javadoc recognize some additional tags used in 2IP15. You can also configure DrJava to use it.

6. (Advanced) Install a Checkstyle plugin for NetBeans, and configure it to use the 2IP15 Checkstyle configuration file. This file may be updated in the future.

7. Review the programs that you submitted for Series 1 and 2, using the Coding Standard for 2IPC0. Every space matters.

Assignments

1. Candy Where necessary, improve your Candy program. Your programs must adhere to the Coding Standard for 2IPC0, and score all 14 points. There should be no Checkstyle complaints.

2. DiceGame Decomposed Where necessary, improve your DiceGameDecomposed programs. Your programs must adhere to the Coding Standard for 2IPC0, and score all 33 points. There should be at most one Checkstyle complaint.

3. DiceGame Contracts Provide Javadoc contracts for all the methods in DiceGameDecomposed.java. Include preconditions and postconditions through the @pre and @post tags, with predicates that are as formal as possible (see handouts on Notation and Specification; also see the example solution for Candy). Your program must adhere to the Coding Standard for 2IPC0, and score 33 points. Implement and use all given methods.

2014, TUE.NL 1/3 Software Construction in Java for HSE Series 3

4. Secure Key Collection Given are a description, contract, and implementa- tion of a method with signature public boolean isSecure(int[][][] keys)

that determines whether a collection of lock keys is secure. This method contains a defect and is too complex. Improve the implementation by ap- plying functional decomposition to spread it out over at least three methods, with reduced control nesting. The top-level method may contain the outer two nested loops, which should be turned into for-each loops. Also provide (possibly informal) contracts as javadoc for the auxiliary methods. These methods need not be robust. Provide some test cases for the auxiliary methods of your decomposition. Given are the files:

• AbstractKeyCollection.java • KeyCollectionMonolithic.java (with defect) • KeyCollectionDecomposed.java (with holes to fill) • AbstractKeyCollectionTest.java • AbstractKeyCollectionTestCases.java • KeyCollectionMonolithicTest.java • KeyCollectionDecomposedTest.java (with holes to fill)

In peach3, submit the following files with your code filling the holes:

• KeyCollectionDecomposed.java • KeyCollectionDecomposedTest.java

Do not include package statements.

5. Peer Review of Secure Key Collection Do the peer review of Secure Key Collection. See peach3 for details. Note that this review can only be done if you have an accepted submission for Secure Key Collection.

Submit your work for the assignments to peach3. Deadline: Thursday 25 September 2014, 23:00 (Moscow time) N.B. The peer review will start on Friday morning, and run until Sunday evening.

General Rules

1. In each submitted file, write above the cut line --8<-- :

• full author name,

c 2014, TUE.NL 2/3 Software Construction in Java for HSE Series 3

• group number, • date of latest change.

2. Make sure you work neatly; pay attention to layout, spelling, and grammar. Adhere to the Coding Standard for 2IPC0.

3. You are responsible for checking your work before submitting it.

4. Submit only your own work.

c 2014, TUE.NL 3/3