TCEA State 1998 Slides


Examples: Summary

The methodology we have presented follows these steps:

  1. Read the problem
  2. Write down data definitions
  3. Begin the template:
    1. Write the function header
    2. For conditional inputs, write cond's
  4. Write selectors
  5. Notice self-references
  6. From the problem, fill in the answers:
    1. Use the selectors
    2. Write more cond's, functions, etc as needed
    3. Use recursion!

One thing notable about our examples is that they fail to emphasize the importance of testing. In reality, we require our students to generate test cases before starting to write the code, working purely from the data definitions. (This prevents the all-too-common error of biasing the tests according to the actual code structure.) Second, the tests help decide what the outputs should be at each stage. Finally, the tests are used to validate the solution.


This approach has many benefits over traditional approaches to teaching program design.

This is only the first of a sequence of design methodologies which deal with other data structures that have different definitions. Eventually, the methodology scales to all the data and operations found in traditional programming languages. Thus, it is language independent.

PLT / scheme@cs.rice.edu

Last modified at 23:42:13 CST on Sunday, February 08, 1998