CS5004: Object-Oriented Design Course Charter

Introduction

CS5004 provides an intensive tour of class-based program design, building on ideas introduced in CS5001. It includes object-oriented concepts such as information hiding, encapsulation, and polymorphism. It contrasts the use of inheritance and composition as techniques for software reuse. It provides an understanding of object-oriented design using graphical design notation such as UML (Unified Modeling Language), as well as object design patterns.

This course introduces abstract data types (ADTs) and implementations. It also examines the relationship between algorithms and data structures, as well as basic techniques for analyzing algorithm complexity.

CS5004 introduces the above in the context of the Java programming language. Students gain significant experience writing programs in Java.

The aim of this document is to lay out the objectives, outcomes and assessments for CS5004.

Example Course Page (PDF)

Goals

CS5004 serves as the second programming course in the Align bridge curriculum. The main objective is to familiarize students with the concepts and practice of object-oriented design. In this context it introduces students to new data structures and algorithms. The course enables students to discuss and evaluate programs in terms of their design, correctness, and efficiency (space and time).

Although the course uses Java as the programming language, most of the concepts transcend a particular programming language.

Specifically:

  1. Experience with medium sized code bases. Get comfortable with medium sized code bases (1000 LOC).
  2. Establish good design, development, testing, and documentation practices.
  3. Use existing libraries and frameworks.
  4. Evaluate alternative designs and implementations.

High-Level Learning Objectives

The course’s outcomes are captured in the following list of high-level learning objectives. Some of these build on the objectives for CS5001.

  1. Write correct and clearly documented small- to medium-sized programs that others can read, understand, and modify.
  2. Represent information as data. Beyond documenting their data, students must be able to document and discuss alternative representations with pros and cons in terms of design (e.g., coupling, abstraction barriers) and complexity (space and time).
  3. Testing as an integral part of development. Students use similar build tools as the open source community to test, analyze, and document their code.
  4. Organize programs with clear, distinct packages and interfaces. Minimize dependencies by providing clear interfaces and using appropriate abstractions.
  5. Use method signatures, purpose statements, pre- and post-conditions, and invariants to specify a method’s assumptions, guarantees and behavior. Document methods using pre- and post-conditions explaining what each method does, not how it does it. Purpose statements must be clear English explanations of what each method does.
  6. Use generalization for data, classes, and methods to limit code duplication.
  7. Use and implement abstract data types and analyze their performance. Design and implementation must consider time and space complexity.
  8. Use common OO Design Patterns.

Implementation Details

The course evaluates students through

  1. Weekly programming assignments.
  2. Weekly lab sessions.
  3. Exams. There are typically 2 exams – midterm and final.
  4. Codewalks, when possible. Ideally, some lab sessions are used to perform codewalks. Students present their designs and code to the course staff and their classmates. Students who are not presenting their code provide feedback that the course staff reviews. Note that with large numbers of students, it may be difficult or even impossible to implement this.

The following provides one example of a week-by-week schedule:

  • Week 1: Data Definitions, Classes, and Testing in Java
  • Week 2: Methods for simple classes, Exceptions
  • Week 3: Representing more complex forms of data
  • Note: It is possible to condense the material above to two weeks, given CS5001’s coverage of object, methods, and classes.
  • Week 4: Lists
  • Week 5: Lists continued
  • Note: This course is typically taken by students who are also taking CS5007 & 06, where they also implement linked lists in C. Faculty should, whenever possible, coordinate across courses so they are complementing presentations of linked lists, rather than duplicating them.
  • Week 6: Equality and comparison
  • Week 7: Applications of Equality
  • Week 8: Design of programs, Model-View-Controller (MVC) architecture
  • Week 9: Encapsulation and invariants
  • Week 10: Inheritance vs composition
  • Week 11: Design patterns for object creation
  • Week 12: Strategies, decorators, visitors
  • Week 13: Designing for alternatives; measuring algorithmic efficiency

Topics and Learning Outcomes

Note that the topics and learning outcomes (some of which repeat those for CS5001 and 5002) are the minimum to be achieved in CS5004. Faculty may choose to present additional material or cover a topic in greater depth. The order of topics here does not imply an ordering for the course itself. Faculty are encouraged to develop syllabi that complement their teaching style. Faculty are also encouraged to share syllabi and other materials with each other.

A note on levels of mastery, which are taken from CS2013 (see cs2013.org): For levels of mastery, CS2013 takes inspiration from (but does not directly follow) Bloom’s Taxonomy. CS2013 defines three levels:

  • Familiarity: The student understands what a concept is or what it means. This level of mastery concerns a basic awareness of a concept as opposed to expecting real facility with its application. It provides an answer to the question “What do you know about this?”
  • Usage: The student is able to use or apply a concept in a concrete way. Using a concept may include, for example, appropriately using a specific concept in a program, using a particular proof technique, or performing a particular analysis. It provides an answer to the question “What do you know how to do?”
  • Assessment: The student is able to consider a concept from multiple viewpoints and/or justify the selection of a particular approach to solve a problem. This level of mastery implies more than using a concept; it involves the ability to select an appropriate approach from understood alternatives. It provides an answer to the question “Why would you do that?”

Note that course topics appear in regular font. Learning outcomes appear in italics.

Also note that some learning outcomes apply to many course topics. More specific learning outcomes appear with their respective topics.

Course Topics Learning Outcomes
Design concepts and principles:
  • Levels of abstraction (architectural design and detailed design)
  • Separation of concerns
  • Encapsulation and information hiding
  • Coupling and cohesion
  • Reuse of standard structures
  • Articulate design principles including separation of concerns, information hiding, coupling and cohesion, and encapsulation. [Familiarity]
  • Apply techniques of decomposition to break a program into smaller pieces. [Usage]
  • Identify the data components and behaviors of multiple abstract data types. [Usage]
  • Implement a coherent abstract data type, with loose coupling between components and behaviors. [Usage]
  • [X-ref abstract data types below]
  • Identify the relative strengths and weaknesses among multiple designs or implementations for a problem. [Assessment]
Object-oriented analysis and design
  • Describe design patterns that are applicable to the object-oriented design of a software system. [Familiarity]
  •  Use object-oriented principles to design a medium-sized software system and explain how the principles have been applied in this design. [Usage]
  •  Construct models of the design of a medium-sized software system. [Usage]
Object-Oriented Programming

Design

  • Decomposition into objects carrying state and having behavior
  • Class-hierarchy design for modeling

Definition of classes: fields, methods, and constructors

Subclasses, inheritance, and method overriding

Dynamic dispatch: definition of method-call

  • Design and implement classes. [Usage]
  • Use subclassing to design class hierarchies that allow code to be reused for distinct subclasses. [Usage]
  • Correctly reason about control flow in a program using dynamic dispatch. [Usage]
Development Methods
  • Program comprehension

Program correctness

  • The concept of a specification
  • Testing fundamentals and test-case generation
  • The role and the use of contracts, including pre- and post-conditions
  • Unit testing

Simple refactoring

Modern programming environments

  • Code search
  • Programming using library components and their APIs

Debugging strategies

Documentation and program style

  • Trace the execution of a variety of code segments and write summaries of their computations. [Assessment]
  • Explain why the creation of correct program components is important in the production of high-quality software. [Familiarity]
  • Describe how a contract can be used to specify the behavior of a program component. [Familiarity]
  • Refactor a program by identifying opportunities to apply procedural abstraction. [Usage]
  • Apply a variety of strategies to the testing and debugging of simple programs. [Usage]
  • Construct, execute, and debug programs using a modern IDE and associated tools such as unit testing tools and visual debuggers. [Usage]
  • Construct and debug programs using standard Java libraries. [Usage]
  • Analyze the extent to which another programmer’s code meets documentation and programming style standards. [Assessment]
  • Apply consistent documentation and program style standards that contribute to the readability and maintainability of software. [Usage]
Basic Type Systems (Note that some of these are also covered in other courses.)A type as a set of values together with a set of operations
  • Primitive types (e.g., numbers, Booleans)
  • Compound types built from other types

Association of types to variables, arguments, results, and fields

Type safety and errors caused by using values inconsistently given their intended types

  • For primitive and compound types, informally describe the values that have that type. [Familiarity]
  • Describe the operations that are forbidden statically, such as passing the wrong type of value to a method. [Familiarity]
  • Describe examples of program errors detected by the Java type system. [Familiarity]
  • Identify program properties checked statically and program properties checked dynamically. [Usage]
  • Use types and type-error messages to write and debug programs. [Usage]
Abstract data types: Usage and Implementation
  • Stacks [Usage] Also in 5001
  • Queues [Usage] Also in 5001
  • Trees [Usage, Implementation] Some in 5002 and 5006
  • Lists [Usage, Implementation] Used also in 5001
  • Maps [Usage] Some in 5001, 06, 07
Data Structures: Use and Implementation
  • Arrays [Usage] Also in 5006, 07
  • Linked Lists [Usage, Implementation] Also in 5007, 06
  • Discuss appropriate use of data structures above. [Familiarity]
  • Describe common applications for abstract data types. [Familiarity]
  • Write programs that use the above. [Usage]
  • Compare alternative implementations with respect to performance. [Assessment]
  • Choose the appropriate data type for modeling a given problem. [Assessment]
Algorithms and Design

The concept and properties of algorithms

  • Informal comparison of algorithm efficiency (e.g., operation counts)
  • Formal comparison

The role of algorithms in the problem-solving process

Problem-solving strategies

  • Iterative and recursive mathematical functions
  • Iterative and recursive traversal of data structures
  • Discuss how a problem may be solved by multiple algorithms, each with different properties. [Familiarity]
  • Determine informally the time and space complexity of simple algorithms. [Usage]
  • Implement, test, and debug recursive functions and procedures. [Usage]
  • Implement a divide-and-conquer algorithm for solving a problem. [Usage]