Pedagogical Pattern #33
Mistake Pattern

(Version 1.2, October 1998)

Contributed by:
Joseph Bergin
Pace University
One Pace Plaza
New York, NY 10038 USA
berginf@pace.edu

NAME:

Mistake

THUMBNAIL:

Students are asked to create an artifact such as a program or design that contains a specific error. Use of this pattern explicitly teaches students how to recognize and fix errors. We ask the student to explicitly make certain errors and then examine the consequences.

AUDIENCE/ CONTEXT:

This is very applicable to the early stages of learning programming. Syntax and semantic errors are frequent and students need to become familiar with the messages produced by compilers and run-time systems and what they indicate about the program.

The pattern could also be used in an analysis or design course in which certain specific, but fairly common, errors are required to be part of the design. The instructor can provide a part of the design, which is flawed in some way, and the students are asked to complete the design without changing the instructor's part. (See the Fixer Upper pattern also.)

This pattern is often used in Database and Operating Systems courses where the students are asked to explore the conditions leading to deadlock, by specifically causing it. Similarly, in learning concurrent programming, students are often asked to write programs in which race conditions between processes lead to the corruption of data.

FORCES:

Students, like professionals, make errors. Professionals generally know what the indications of an error are, but students do not.

We usually help students avoid errors, but they occur anyway. Students should have a way to explore the effects of errors so that they can recognize them by their effects.

SOLUTION:

Students are asked to produce an artifact with certain specific errors (usually a single error), and the effect of the error is then explored.

For example, students are given an assignment in which they are instructed to create and run a program with certain specific errors. They are then asked to comment on the diagnostics produced and/or why no diagnostics were produced for the error.

DISCUSSION/ CONSEQUENCES/ IMPLEMENTATION:

Students become more familiar with errors and how to correct them. Having seen specific errors, they can learn to avoid making them in the first place.

The instructor should carefully prepare exercises using this pattern and be sure to do the exercise before the class does, so that unanticipated occurrences can be prepared for and explanations of precisely what happened can be provided later.

Follow up. It is important that the students get a chance to discuss interesting things that occur while making these errors.

One especially useful technique is to ask students to make errors that, when they occur accidentally, are especially hard to diagnose when made accidentally. One example of this is errors made in C++ template instantiations.

SPECIAL RESOURCES:

The instructor simply needs knowledge of common errors.

RELATED PATTERNS:

See Also: Fixer Upper, Spiral, Mistake, Early Bird, Toy Box, Tool Box, Lay of the Land, Test Tube and Larger Than Life as a pattern language.

EXAMPLE INSTANCES:

Several were given under Applicability, above. In addition, this pattern can be used effectively to teach students about pointers in languages like C or C++, by having them make all of the common pointer errors purposely. This particular use is somewhat dangerous on computers that have memory mapped i/o and unprotected operating systems. Both syntax and semantic errors can easily be explored using this pattern.

One exercise from an old book [Teague] was to write a program that produced every diagnostic mentioned in the manuals for a given (Fortran) compiler. This is, not surprisingly, very difficult to do. Impossible, for some compilers, as the documentation and the compiler are not completely parallel.

CONTRAINDICATIONS:

This pattern can be over used. It is best used early and in response to student questions.

REFERENCES:

Computing Problems for Fortran Solution, Robert Teague, Canfield Press, 1972.


Home Project
Leaders
Pedagogical Pattern
Format
Evolution of a
pedagogical pattern
Sample
Patterns
Publications
Subject
Index
Learning Obj.
Index
Teaching/Learning
Element Index
Alphabetical
Index
Author(s)
Index
Contact
Us
Previous pattern Search This Site Next pattern