CSSE 220 – Object-Oriented Software Development
Homework 3
Objectives
Practice reading and applying the API documentation and developing using unit tests.
Practice implementing a class, including the process for doing so (using documented stubs and test-first programming). Practice at determining what fields are needed to implement a class. Continued practice at using an API.
Tasks
- Complete the assigned reading for the next session, according to the course schedule.
- As you read, see if you can answer the self-check questions.
- If there is something you do not understand, make note of it so you can ask about it.
- Complete the assessment exercises over this reading on ANGEL (under Lessons → Assignments).
- Programming with javadocs and unit testing:
-
In Eclipse, checkout the UnitTesting project.
- Use the
SVN Repositories
view to check out this project.
- We completed this step in class. Create a JUnit 4 Test Case for
StringMethodsPractice
.
- Name your test case class
StringMethodsPracticeTest
.
- Write unit tests for
shout
, whisper
, and holleWerld
.
- Remember, the goal is to write tests that cover “interesting” cases.
- Programming a word game project:
-
In Eclipse, checkout the WordGames project.
- Use the
SVN Repositories
view to check out this project.
-
Continue following the WordGames instructions.
- We completed the first part of this homework in class.
- You should complete at least the first 4
classes (Shouter, Censor, NameDropper, Counter ) before the next class period.
- Some of the later classes require conditionals and loops; we will discuss those concepts in the next class session.
- The entire WordGames project is due at the beginning of Session 5 (that is, not the next class period, but the one after that).
- Use the PROCESS in the WordGames instructions: documented stubs and test-first programming.
- The grading rubric for WordGames appears at the top-right of the WordGames instructions.
-
Written Problem: Draw your answers to this problem neatly on paper. Clearly label each part of the problem.
The ObjectReferenceExamples
class contains several methods. For each method (except main()
):
- Draw a box and pointer diagram, like we did in class, showing the result of running the method.
- Use your drawings to predict the output of the method.
- After you have made your predictions, run the program to check your answers.
- If your prediction was wrong, neatly line through it (and your drawing if necessary) and add the correct answer. We won't take off points for such edits, but we want to see your thought process.
Remember, in all your code:
- Write appropriate comments:
- Javadoc comments for public fields and methods.
- Explanations of anything else that is not obvious.
- Give self-documenting variable and method names:
- Use name completion in Eclipse, Ctrl-Space, to keep typing cost low and readability high.
- Use Ctrl-Shift-F in Eclipse to format your code.
- Take care of all auto-generated TODO’s.
- Then delete the TODO comment.
- Correct ALL compiler warnings.
- Quick Fix is your friend!
Here is the grading rubric for this assignment.
Turn-in Instructions
Turn-in your programming work by committing it to your SVN repository. Bring your paper problems to class.