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
- Data types: int, float, char, etc.
- Decision and loop structures: if(), switch(), while(), for(), etc.
- Function calls and the procedural paradigm.
- Recursion.
- Arrays and strings.
- Pointers.
- Abstract data types and the C "struct" data structure.
- Data modeling and nested structs.
- File I/O.
Program Specification and Design
Basic design strategy:
- Specify the input and output.
- Design the algorithm and data structures.
- Translate the algorithm into a programming language such as C++.
- Test and debug the program.
The software life-cycle:
- Analysis and specification of the task.
- Design of the algorithms and data structures.
- Implementation (coding).
- Testing.
- Maintenance and evolution of the system.
- 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:
- You must know what output a correct program should produce for each test input.
- The test inputs should include those inputs that are most likely to cause errors.
Boundary values. Fully exercising code.
Debugging tips:
- Never start changing suspicious code on the hope that the change "might work better."
- Discover exactly why a test case is failing and limit your changes to corrections
of known errors.
- After correcting a known error, rerun all test cases (regression testing).
This page established August 27, 1999; last updated August 29, 1999.