Programming by Example

Programming by example is a way of programming a software system in its own user interface. The user of the system writes a program by giving an example of what the program should do. The system records the sequence of actions, and can perform it again. Programming by example allows a user to create programs without doing conventional programming. Programming by example was incorporated into a simulation of an office information system. As the system evolved, it became clear that the basic concept of programming by example needed to be extended: certain aspects of program creation are better done by program modification than by using the programming-by-example mechanism. The final system includes a static program representation that is easy to understand, a mechanism for describing data, and a method of adding control structure. A user operates on certain data while creating a program by example, but does not necessarily tell the system why that data was selected. The user can supply this missing information by using data descriptions, which are program operands that specify how to choose the data to be used when the program is run. The system automatically supplies reasonable default data descriptions while recording a program; if necessary the user can modify the descriptions later to reflect his or her true intentions. Since programming by example is best at recording sequential user actions, rather than branching or iteration, control structure that alters program flow is specified by program editing. The operands in iterations and the predicates in conditional control structures are built from data descriptions. Real users have learned to use the system quickly and with little difficulty. The techniques used in this system can be applied to other systems as well. This research has demonstrated that programming by example is a practical method for creating programs. This document is a slightly corrected version of a dissertation submitted to the Department of Electrical Engineering and Computer Sciences, Computer Science Division, University of California, Berkeley, in partial satisfaction of the requirements for the degree of Doctor of Philosophy in Computer Science. A nearly identical version of this document was also published by the Office Systems Division, Systems Development Department, Xerox Corporation, as technical report OSD-T8402, December, 1984. An online version of this document was recreated by the author in March, 1999. For more information, contact the author at halbert@world.std.com halbert@halwitz.org. Copyright © 1984 by Daniel Conrad Halbert. All rights reserved.

[1]  Rodney N. Cuff On casual users , 1980 .

[2]  Alan W. Biermann,et al.  Constructing Programs from Example Computations , 1976, IEEE Transactions on Software Engineering.

[3]  Ian H. Witten PROGRAMMING BY EXAMPLE FOR THE CASUAL USER: A CASE STUDY , 1981 .

[4]  TWO-WEEK Loan COpy,et al.  University of California , 1886, The American journal of dental science.

[5]  Gael A. Curry,et al.  Programming by abstract demonstration. , 1978 .

[6]  Richard M. Stallman EMACS Manual for ITS Users , 1981 .

[7]  Peter J. Brown Dynamic program building , 1981, Softw. Pract. Exp..

[8]  Donald A. Waterman,et al.  Exemplary programming in RITA , 1977, SGAR.

[9]  Bruce Anderson,et al.  Programming in the home of the future , 1980 .

[10]  Henry Lieberman,et al.  A Session with Tinker: Interleaving Program Testing with Program Writing , 1980, LISP Conference.

[11]  Moshé M. Zloof QBE/OBE: A Language for Office and Business Automation , 1981, Computer.

[12]  Ben Shneiderman,et al.  Direct Manipulation: A Step Beyond Programming Languages , 1983, Computer.

[13]  Eric Harslem,et al.  The star user interface: an overview , 1899, AFIPS '82.

[14]  David Canfield Smith,et al.  Pygmalion: A COMPUTER PROGRAM TO Model and Stimulate Creative Thought , 1975 .

[15]  Maria Simi,et al.  Extending the power of programming by examples , 1982, COCS.

[16]  Maria Simi,et al.  Extending the power of programming by examples , 1982 .

[17]  S. Peter de Jong,et al.  The System for Business Automation (SBA): Programming language , 1976, Commun. ACM.

[18]  Philip Klahr,et al.  EP-2, A prototype Exemplary Programming system , 1979, ACM '79.

[19]  Moshé M. Zloof Query-by-Example: A Data Base Language , 1977, IBM Syst. J..

[20]  I. G. BONNER CLAPPISON Editor , 1960, The Electric Power Engineering Handbook - Five Volume Set.

[21]  Henry Lieberman,et al.  A session with Tinker: Interleaving program testing with program design , 1980, LISP Conference.

[22]  Henry Lieberman Seeing What Your Programs are Doing , 1984, Int. J. Man Mach. Stud..

[23]  David Robson,et al.  Smalltalk-80: The Language and Its Implementation , 1983 .

[24]  W. Bowen,et al.  Philadelphia , 1892 .

[25]  William S. Faught Applications of exemplary programming , 1980, AFIPS '80.