Book Description

About the Author

Table of Contents

Source Code

Errata

Send Comments

Teaching Materials

Author's Homepage
 

Object-Oriented Software Development Using Java
Xiaoping Jia, Ph.D
Chapter 6: From Building Blocks to Projects

Contents
   6.1 Design and Implementation of Classes
         6.1.1 Public and Helper Classes
         6.1.2 Class Members
         6.1.3 Design Guidelines
         6.1.4 Documenting the Source Code
   6.2 Contracts and Invariants
         6.2.1 Contracts of Methods
         6.2.2 Invaraints of Classes
         6.2.3 Assertions
         6.2.4 Design by Contract
   6.3 The Canonical Form of Classes
         6.3.1 No-Argument Constructor
         6.3.2 Object Equality
         6.3.3 Hash Code of Objects
         6.3.4 Cloning Objects
         6.3.5 String Representation of Objects
         6.3.6 Serialization
   6.4 Unit Testing
         6.4.1 Simple Unit Testing
         6.4.2 JUnit A Unit Testing Tool
         6.4.3 Testing Coverage Criteria
   6.5 Project Build
         6.5.1 Ant A Build Tool



Other Chapters

  • List interface
  • Linked list implementation
  • Simple unit test for linked list implementation
    • Source code: test/LinkedListTest1.java
    • Compile:
      • javac -source 1.4 test/LinkedListTest1.java
    • Run:
      • java -ea test.LinkedListTest1
  • Simple unit test for linked list implementation, using assertions
  • Simple unit test for linked list implementation, using  JUnit
    • Source code: unittest/LinkedListUnitTest.java
    • Compile:
      • javac unittest/LinkedListUnitTest.java
    • Run:
      • Using text-based test runner:
        • java -ea junit.textui.TestRunner unittest.LinkedListUnitTest
      • Using Swing-based test runner:
        • java -ea junit.swingui.TestRunner unittest.LinkedListUnitTest
         

Book Description - About the Author - Table of Contents
Source Code - Errata - Send Comments
Teaching Materials - Author's Homepage