Pedagogical Pattern #52
Test Tube

(Version 1.0, October 1998)

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

NAME:

Test Tube

THUMBNAIL:

Students can answer their own "What if…" programming questions with access to a computer. Sometimes this is quicker and more effective than formal documentation. Students can also explore the undefined parts of some computer languages.

AUDIENCE/ CONTEXT:

Beginning programming courses.

FORCES:

Students can take up a large amount of class time asking questions at a very low level of detail. They can also become very frustrated if they cannot find sufficiently detailed documentation to answer their questions.

SOLUTION:

Give the students several exercises in which they are asked to write small programs to get the computer to answer simple questions of the form "What happens if…". These exercises should be frequent enough that students get in the habit if probing the machine for what it does, rather than the documentation.

DISCUSSION/ CONSEQUENCES/ IMPLEMENTATION:

Some languages are underdefined. In these languages, the instructor will need to point out a few places where there are no rules. In particular, the order of evaluation of parameters in C++ is not defined in the standard. Therefore, the most that a program will tell you is what is the effect using a compiler at hand. It can't give you a general rule as there is none. Students need to be aware of these situations so that they can program defensively and now draw misleading conclusions.

SPECIAL RESOURCES:

Student questions can be a good source for exercises of this kind. The instructor can take a student question and turn it into a very short term (overnight) exercise. If a laboratory is available, students can immediately test out hypotheses about how things operate.

RELATED PATTERNS:

  • This can be used in conjunction with Fixer Upper.
  • If the purpose of the exercise is to generate errors, then this is an instance of Mistake. This pattern is more general than Mistake, however.
  • This can be used effectively to make cycles around Spiral move quickly without getting bogged down in too much detail.

    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:

    The meaning of for loops in C++ can be explored in a sequence of exercises in which the initialization, test, and "increment" portions of the loop are varied.

    When a while loop exits (between executions of the body) and when it does not (as soon as the condition becomes true in the middle of the body) can be explored in exercises.

    The difference between value and reference parameters and the meaning of const can be explored.


    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