Program Structure and Design

Abstract Most models of computer programming explain the programmer's behaviour by a single design strategy. This article presents a cognitive architecture that uses cue-based search to model multiple design strategies including procedural, functional, means-end or focal, and opportunistic design. The model has been implemented in an artificial intelligence (AI) system that generates Pascal programs from English specifications. Knowledge is represented as nodes that reside in internal or external memory, where a node encodes an action that may range from a line of code to a routine in size. A program is built by linking nodes through a search cue of the form . The cue is broadcast to memory, and any matching node is returned; the cue provides a question to ask, and the return provides the answer. A cue on the newly linked node is then selected as a new focus, and the search process repeated. Each design strategy defines a specific node visiting order that traverses the program structure through its links.

[1]  Richard C. Waters,et al.  The programmer's apprentice , 1990, ACM Press frontier series.

[2]  Jawed I. A. Siddiqi,et al.  An Empirical Investigation into Problem Decomposition Strategies Used in Program Design , 1985, Int. J. Man Mach. Stud..

[3]  Martin S. Feather,et al.  A System for Assisting Program Transformation , 1982, TOPL.

[4]  Thomas W. Reps,et al.  Integrating noninterfering versions of programs , 1989, TOPL.

[5]  Earl David Sacerdoti,et al.  A Structure for Plans and Behavior , 1977 .

[6]  Willemien Visser Strategies in programming programmable controllers: a field study on a professional programmer , 1987 .

[7]  Niklaus Wirth,et al.  Program development by stepwise refinement , 1971, CACM.

[8]  Edsger W. Dijkstra,et al.  A constructive approach to the problem of program correctness , 1968 .

[9]  Robert S. Rist Search Through Multiple Representations , 1994 .

[10]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[11]  Allen Newell,et al.  Protocol Analysis as a Task for Artificial Intelligence , 1971, IJCAI.

[12]  Scott P. Robertson,et al.  Expert problem solving strategies for program comprehension , 1991, CHI.

[13]  Jean Scholtz,et al.  An analysis of novice programmers learning a second language , 1992, PPIG.

[14]  Ruven E. Brooks,et al.  Towards a Theory of the Comprehension of Computer Programs , 1983, Int. J. Man Mach. Stud..

[15]  Allen Newell,et al.  Problem solving techniques for the design of algorithms , 1984, Inf. Process. Manag..

[16]  Niklaus Wirth,et al.  Program development by step-wise refinement , 1971 .

[17]  Lucy Suchman Plans and situated actions: the problem of human-machine communication , 1987 .

[18]  John Edwin Hartman,et al.  Automatic Control Understanding for Natural Programs , 1991 .

[19]  Daniel G. Bobrow,et al.  Descriptions: An intermediate stage in memory retrieval , 1979, Cognitive Psychology.

[20]  Bertrand Meyer,et al.  Eiffel: The Language , 1991 .

[21]  Keith Duncan,et al.  Cognitive Engineering , 2017, Encyclopedia of GIS.

[22]  D. L. Parnas,et al.  On the criteria to be used in decomposing systems into modules , 1972, Software Pioneers.

[23]  Thomas R. G. Green,et al.  Cognitive dimensions of notations , 1990 .

[24]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[25]  John R. Anderson,et al.  Learning to Program in LISP , 1984, Cogn. Sci..

[26]  Peter Naur,et al.  An experiment on program development , 1972 .

[27]  D. Norman Categorization of action slips. , 1981 .

[28]  Elliot Soloway,et al.  Delocalized Plans and Program Comprehension , 1986, IEEE Software.

[29]  Simon P. Davies The role of notation and knowledge representation in the determination of programming strategy: A framework for integrating models of programming behavior , 1991 .

[30]  David Lorge Parnas,et al.  A Rational Design Process: How and Why to Fake It , 1985, TAPSOFT, Vol.2.

[31]  Herbert A. Simon,et al.  The Sciences of the Artificial , 1970 .

[32]  Simon P. Davies,et al.  The Nature and Development of Programming Plans , 1990, Int. J. Man Mach. Stud..

[33]  Robert Balzer,et al.  On the inevitable intertwining of specification and implementation , 1982, CACM.

[34]  Bill Curtis,et al.  Breakdowns and processes during the early activities of software design by professionals , 1987 .

[35]  Willemien Visser,et al.  More or Less Following a Plan During Design: Opportunistic Deviations in Specification , 1990, Int. J. Man Mach. Stud..

[36]  M. Manosevitz High-Speed Scanning in Human Memory , .

[37]  Robert B. Terwilliger,et al.  Object-oriented programming in Eiffel , 1995 .

[38]  John R. Anderson,et al.  Novice LISP Errors: Undetected Losses of Information from Working Memory , 1985, Hum. Comput. Interact..

[39]  Jim Q. Ning,et al.  Knowledge-based program analysis , 1990, IEEE Software.

[40]  Linden J. Ball Cognitive processes in engineering design , 1990 .

[41]  James D. Hollan,et al.  The Process of Retrieval from Very Long-Term Memory , 1978, Cogn. Sci..

[42]  Françoise Détienne Design strategies and knowledge in object-oriented programming: effects of experience , 1995 .

[43]  C Bron,et al.  COGNITIVE STRATEGIES AND LOOPING CONSTRUCTS - AN EMPIRICAL-STUDY , 1984 .

[44]  R. Schank,et al.  Inside Computer Understanding , 1981 .

[45]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[46]  Roger C. Schank,et al.  SCRIPTS, PLANS, GOALS, AND UNDERSTANDING , 1988 .

[47]  Rachel K. E. Bellamy,et al.  Parsing and Gnisrap: a model of device use , 1987 .

[48]  Roger C. Schank,et al.  Explanation Patterns: Understanding Mechanically and Creatively , 1986 .

[49]  Robert Simon Rist Knowledge creation and retrieval in program design: a comparison of novice and experienced programmers , 1989 .

[50]  B. Adelson,et al.  The Role of Domain Expenence in Software Design , 1985, IEEE Transactions on Software Engineering.

[51]  Charles Eugene Martin,et al.  Direct memory access parsing , 1992 .

[52]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[53]  Mark Stefik,et al.  Planning with Constraints (MOLGEN: Part 1) , 1981, Artif. Intell..

[54]  Robert S. Rist Plans in programming: definition, demonstration, and development , 1986 .

[55]  Simon P. Davies,et al.  The Role of Notation and Knowledge Representation in the Determination of Programming Strategy: A Framework for Integrating Models of Programming Behavior , 1991, Cogn. Sci..

[56]  Allen Newell,et al.  Human Problem Solving. , 1973 .

[57]  B. Adelson When Novices Surpass Experts: The Difficulty of a Task May Increase With Expertise , 1984 .

[58]  Robert S. Rist Knowledge Creation and Retrieval in Program Design: A Comparison of Novice and intermediate Student Programmers , 1991, Hum. Comput. Interact..

[59]  Robert S. Rist Schema Creation in Programming , 1989, Cogn. Sci..

[60]  Robert S. Rist Variability in Program Design: The Interaction of Process with Knowledge , 1990, Int. J. Man Mach. Stud..

[61]  Lucy A. Suchman,et al.  Response to Vera and Simon's Situated Action: A Symbolic Interpretation , 1993, Cogn. Sci..

[62]  Elaine Kant,et al.  Understanding and Automating Algorithm Design , 1985, IEEE Transactions on Software Engineering.

[63]  Robin Jeffries,et al.  The Processes Involved in Designing Software. , 1980 .

[64]  Elliot Soloway,et al.  A Goal/Plan Analysis of Buggy Pascal Programs , 1985, Hum. Comput. Interact..

[65]  John R. Anderson,et al.  Learning Flow of Control: Recursive and Iterative Procedures , 1986, Hum. Comput. Interact..

[66]  Mark Weiser,et al.  Programmers use slices when debugging , 1982, CACM.

[67]  Susan Weidenbeck,et al.  Processes in computer program comprehension , 1986 .

[68]  Barbara Hayes-Roth,et al.  A Cognitive Model of Planning , 1979, Cogn. Sci..

[69]  Mark Weiser,et al.  Experiments on slicing-based debugging aids , 1986 .

[70]  Michael David Williams,et al.  What Makes RABBIT Run? , 1984, Int. J. Man Mach. Stud..

[71]  John Darlington,et al.  Some transformations for developing recursive programs , 1975 .

[72]  Janet L. Kolodner,et al.  Retrieval and organizational strategies in conceptual memory: a computer model , 1980 .