CSc 308 Homework Assignments
Homework #1
- Study the CSC
308 Coding Standard
(derived from the Sun Java Coding Standard).
- Familiarize yourself with the convenient
coding standard checklist.
- Login to your Unix account on the "vogon" server.
- Download this example poorly
formatted code to your Unix account.
- Identify all the violations of the class coding standard and
record them. You may
a) print the code and make your annotations directly on the printout, or
b) describe each violation on a separate piece of paper.
- Rename the file with a ".java" extension.
- We have a tool, Checkstyle, to automatically check for violations
of the class coding standard. It doesn't catch all of them, but
it gets many of them.
- Read the Checkstyle overview
and features
- Run the Checkstyle program using a script in the grader
account. Here is the command syntax:
~graderjd/bin/stylechecker filename
and make a printout of the output.
- Highlight each item on the checkstyle output that you failed
to find through manual inspection.
Place a star by any items on the printout from step 2 that you
discovered that were not
found by the Checkstyle tool. (Checkstyle is not perfect).
- Here is a Checkstyle
extension for BlueJ
that contains the custom checks for our coding style.
Here is the associated
configuration file
and the custom checks created for our
class: 308checks.jar
- Your team will likely want to integrate CheckStyle into your
daily build
process; visit the CheckStyle website.
- There's also a handy source code formatting extension
for BlueJ, created by Ostrich
Software
a Cal Poly student team.
Submit your marked up printouts from steps 5 and 9.
Homework #2
Complete the online
Keirsey-Bates Temperament Scorer.
Plan to take about 20 minutes.
When you finish the survey, you will be shown
a results page with an interpretation of your temperament. Print
two copies of the results page and
bring both to the next class meeting.
Homework #3
Pseudocode
Problems
Homework #4
Spend not more than an hour studying this
Deck class javadocs. Attempt to identify aspects of the interface
design that were done well and aspects that need improvement. Refer to
the
design QA guidelines for Class Definitions. Create two lists (did
well, needs improvement) that are ranked with the most significant
items first.
Homework #5
Read the brief
Object-Oriented
Design: How-To.
Read the rules
for the game of Go Fish!
Imagine you are creating a program to allow a human player to compete
against the computer at Go Fish. Draw a preliminary UML Class
Diagram (without attibutes and
methods) for an object oriented decomposition of the Go
Fish game. You do not need to use a computer tool, you should
neatly draw your diagram on blank paper. You do not need to
include any User Interface elements
in
your design, just the underlying game elements.
Homework #6
Read the assigned readings before starting the homework.
The Lewis and
Loftus
text provide an Account.java
class (Listing 4.5) that represents a bank account. They have a typical
test driver called BankAccounts
(Listing 4.4).
- Write a JUnit test class, AccountTest, which
performs the same tests as their driver.
- Compile it and run it with JUnit. Note: Use the
assertEquals()
method,
which
implies that you will need to add an equals() method to the
Account
class.
- Write a new test
case that reveals
a defect lurking in the Account class. (Hint:
Bad Money example)
- Submit a source
listing
of your complete JUnit test class, the modified Account
class, and a listing of the execution of your JUnit test (using the
text-based TestRunner).
Homework #7
Follow the steps in the tutorial
How to Test Units in Isolation with JUnit
and complete the
short exercise at the end.
Homework #8
Complete the
system test case revision
activity.
Homework #9
Consider the collection of tasks in this table:
| Task |
Immediate
Predecessor |
Estimated
time (days) |
A
|
-
|
5
|
B
|
-
|
4
|
C
|
A
|
3
|
D
|
B
|
7
|
E
|
C
|
2
|
F
|
D, E
|
1
|
1. Draw the task network diagram for this project.
2. Create a timeline chart.
3. What is the minimum project completion time?
Homework #10
Spend not more than 30 minutes studying this
student prototype
for an interactive mystery game.
Write a one page critique of the prototype.
You may use a list format instead of an essay.
List what was done well and what needs improvement.
Rank your issues in terms of priority.
Homework #11
Critique these
sample requirements.
Homework #12
This assignment is posted on Blackboard.
Homework #13
Each person in the class is to add one line from this poem
to a text file in the instructor's Subversion
repository.
Reference: CVS/SVN
combined tutorial
This is an INDIVIDUAL assignment. You may not discuss it
or get assistance from other students. If you need assistance,
see the instructor.
Directions
- You will be working with an existing team's SVN repository.
You will need to login with a username 'guest' and a password
'guest'. The repository is hosted on Trac here:
http://wiki.csc.calpoly.edu/EmptySet/browser
- After you login as guest, Use Trac's "Browse source" to view the Homework13 folder and notice a file
poem.txt.
- In this training we will update the file poem.txt.
Use a browser to view the file poem.txt to see
how many lines have been added by other students.
- Read the original
poem and determine what is the next line of the poem to be added.
- Obtain a working copy of the repository from this URL:
http://wiki.csc.calpoly.edu/EmptySet/svn
- Tip: Don't checkout the entire repository; it's huge. Just
checkout the Homework13 folder.
- You should edit the file poem.txt and add the next line
of the poem
to the end of the
file. Place your initials at the beginning of the line.
- When your changes are successfully merged in with the rest of the
poem in the repository, you're done.
- Optionally, see if you can determine how to view the complete log
of
everyone's changes.