Assignment 7

Due: Monday, November 17th in the Distribution Center

Name: YOUR NAME
Student ID: YOUR ID NUMBER

1. Integrated Development Environments (20%)

A. Download and unzip this simple program. Compile and run it using the Eclipse IDE. Eclipse is available in the ICS labs, or you can download it from eclipse.org. Follow these detailed instructions on how to do it. Run it several times untill you get a result other than "everyone busted". Show the output of the program below.

COPY THE PROGRAM OUTPUT FROM THE CONSOLE PANE AND PASTE IT HERE.

B. Place a breakpoint on the call to dealTo() in BlackJack4.java. Run the program again and step through until round = 3. Print out a screenshot of the Eclipse debug perspective with the source code, Console showing 3 lines of output, and the Variables pane showing "round = 3".

PRINT OUT YOUR SCREENSHOT AND STAPLE IT TO THESE PAGES.

C. Refactor the code to make the following changes:

For each refactoring, in the source code pane, select all lines of the code to extract. Then use the Refactor menu, "Extract method..." command. In the "Extract Method" dialog box, enter the new method name.

PRINT OUT THE REVISED SOURCE CODE AND STAPLE IT TO THESE PAGES.

2. Automated builds (20%)

A. Use "Window" menu, "Show view", "Ant" to open the "Ant" view. In the Ant view, press the first button (labeled "+++") and add "build.xml" to your Eclipse project. Then expand the tree widget in the Ant view and double click on "run" to compile and run the program. Show all Ant output below (it does not matter if everyone busts).

COPY THE ANT OUTPUT FROM THE CONSOLE PANE AND PASTE IT HERE.

B. Run the "prepare-docs" target. Show all Ant output below.

COPY THE ANT OUTPUT FROM THE CONSOLE PANE AND PASTE IT HERE.

3. Assertions (20%)

A. Uncomment the source code lines with assert statements in Card.java and save the file. Note: Eclipse will mark each "assert" an error, unless you use "Project", "Properties", "Java Compiler", "Compliance and classfiles" to set the "Compiler compliance level" to "1.4". Compile and run the program again using the Ant "run" target. An assertions will fail. Show the error message below.

COPY THE ERROR MESSAGE FROM THE CONSOLE PANE AND PASTE IT HERE.

B. Change both assert statements in Card.java to allow all possible legal values. You will have to understand the program to do this.

PRINT OUT THE REVISED Card.java AND STAPLE IT TO THESE PAGES.

C. This program is missing some key checks on its input. Specifically, if there are 13 players, the deck will run out of cards and raise an exception. Describe in English how you would prevent this error.

TYPE ONE SHORT PARAGRAPH HERE.

4. Source code analysis (20%)

A. Double-click on the "checkstyle" target in the "Ant" pane. This will run the checkstyle source code analysis tool on your code. It will take about 10 seconds to finish. Afterwards, click on "bj4" in the explorer view and use the "Refresh" command on its popup menu. You will see a new file named "checkstyle_report.txt". Show the output below.

COPY CONTENTS OF checkstyle_report.txt AND PASTE IT HERE.

B. View the file checkstyle_report.txt and edit the Java source to correct at least five problems other than missing javadocs. The "features" section on the Checkstyle web site has links to explanations of Checkstyle messages. Include all source code and copy the messages from the original checkstyle_report.txt that you have resolved.

PRINT OUT THE REVISED SOURCE CODE AND STAPLE IT TO THESE PAGES.

COPY AT LEAST 5 Checkstyle MESSAGES FROM PART 4A THAT YOU HAVE RESOLVED AND PASTE THEM HERE.

5. Finding out more (20%)

List 4 to 7 URLs, books, or articles that describe the use of other automated build or source code analysis tools. For each item, briefly describe why you think that resource would be useful to you or your classmates. Do not list the books and URLs that have been given to you in class.

TYPE YOUR ANSWER HERE: 4-7 SHORT PARAGRAPHS

example use case templatesample test plan templateProject plan template