Session Details

Week 1, Session 3 — Thu Dec 2

Reading

  1. Big Java, §2.8–2.10
  2. First two pages of this intro to UML Class Diagrams
  3. Big Java, §3.1–3.8, Pay particular attention to §3.8

HW Due

  1. HW 2

Topics

  1. API documentation, Javadoc
  2. Unit tests with JUnit
  3. Object references
  4. Object-Oriented Encapsulation
  5. Implementing Classes in Java

Resources

  1. Slides
  2. Example code implementing classes
  3. Moving from JUnit 3.8 to 4 (ignore if you don’t already know JUnit 3.8)

Outline

  1. [5] Questions
  2. [5] Javadocs
  3. [15] Javadoc exercise (add comments to StringMethodsPractice in JavadocsAndUnitTesting project), then summary.
  4. [10] Unit testing with JUnit. Examine JUnitMoveTester in JavadocsAndUnitTesting project.
  5. [15] JUnit exercise: create and implement StringMethodsPracticeTest in JavadocsAndUnitTesting project.
  6. [10] Object references, assignment, box and pointer diagrams
  7. [5 min] OO encapsulation
  8. [5 min] Break
  9. [20 min] Java classes. Live coding on implementing a class: implement Shouter and add a test to ShouterTest in the WordGames project, as specified in the WordGames instructions.
  10. [15 min] More live coding on implementing a class: implement Censor and add a test to CensorTest in the WordGames project, as specified in the WordGames instructions.

HW Assigned

  1. HW 3