CS 455 Lecture Notes

Week One, Tuesday: Introduction

Instructor and Teaching Assistant

Handouts

The following handouts (thanks to Ms. Claire Bono) are available on paper in class or from the Web:

Please complete the student questionaire in class and pass it forward. Remote (ITV) students can use courier, fax, or e-mail.

Review of Introduction to Programming

Program Specification and Design

Basic design strategy:

  1. Specify the input and output.
  2. Design the algorithm and data structures.
  3. Translate the algorithm into a programming language such as C++.
  4. Test and debug the program.

The software life-cycle:

  1. Analysis and specification of the task.
  2. Design of the algorithms and data structures.
  3. Implementation (coding).
  4. Testing.
  5. Maintenance and evolution of the system.
  6. Obsolescence.

Algorithm Analysis

The stair counting problem: three methods. How do we know which is best? Running time analysis. Results: quadratic time, linear time, logarithmic time.

Algorithms in daily life. Swim meet example. Seeding swimmers requires sorting them on swimming speed. How do we sort the cards? Each card is a data object that holds information about a swimmer.

Testing and Debugging

Properties of good test data:

  1. You must know what output a correct program should produce for each test input.
  2. The test inputs should include those inputs that are most likely to cause errors.
Boundary values. Fully exercising code.

Debugging tips:

  1. Never start changing suspicious code on the hope that the change "might work better."
  2. Discover exactly why a test case is failing and limit your changes to corrections of known errors.
  3. After correcting a known error, rerun all test cases (regression testing).


This page established August 27, 1999; last updated August 29, 1999.