What is Programming by Example?

Programming by Example encompasses a number of approaches to creating programs by giving examples of their behavior or effect. All approaches emphasize working on concrete examples rather than describing a procedure in the abstract.

The earliest approach, historically called Automatic Programming but now often referred to as Programming by Input/Output Examples, relies on the system's ability to generalize from examples. The programmer presents examples of data before and after processing; the computer must find a method of transforming the input to the output.

A more recent approach that has proven quite successful is Programming by Demonstration: the programmer (often the end-user) demonstrates actions on example data, and the computer records and possibly generalizes these actions.

Another recent approach is Programming by Teaching (sometimes called Instructible Systems or Agents), which extends the demonstrational approach by enabling users to give verbal or gestural hints. These focus the system's attention on relevant generalizations.

For more information on the background and terminology of Programming by Example, see the book, Watch What I Do: Programming by Demonstration, edited by Allen Cypher and published by MIT Press.

David Maulsby