Land of Po Homepage CAITLIN project homepage Sitemap Search the web Feedback School of Informatics homepage Eat the word homepage Staff List Northumbria University Homepage Page banner with picture hotspots to: Feedback, Guest book, Site Map, Search, Caitlin, Eat the Word, School of Informatics, Northumbria University, & Dilbert

 

Go to

Dilbert link icon

 

The Use of Literate Program Development Tools

Paul Vickers, John Pardoe & Stu Wade.

horizontal rule

Contents

  1. Introduction
  2. The Philosophy of SWR Pascal
    bulletBackground
    bulletWhy SWR Pascal?
  3. Experiences of Using SWR Pascal
  4. Future Trends and Other Tools
  5. References
  6. The SDG

horizontal rule

1. Introduction

The Software Development Group (SDG) has for several years been using literate programming techniques and tools for teaching program design to its students at the Liverpool Polytechnic. Literate Programming, as described by Knuth, is considered by the group to be an excellent method for the production of well-documented, more maintainable and well-designed software. The SDG has developed a literate programming support environment called SWRPAS. It utilises many of the ideas put forth by Knuth in a Pascal-based environment using techniques of structured programming by step-wise refinement.

2. The Philosophy of SWR Pascal

2.1 Background

bulletProblems of separation of source code from documentation and the recognised benefits of self-documenting programs;
bulletThe need to perform good program design;
bulletThe maintenance problem and its exacerbation by 'hacking existing code' and thinking at the terminal;
bulletPrograms are more easily comprehensible if they are legible and pleasing to look at;
bulletLiterate programming, as espoused by Knuth [KNU84], was recognised as being a worthy technique [PAR87].

2.2 Why SWR Pascal?

"The beginning of wisdom for a computer programmer is to recognise the difference between getting a program to work and getting it right" M.A. Jackson [JAC75a].

bulletNeed for a straightforward, easy to use, design method:
bulletThe SDG liked the idea of Step Wise Refinement, as espoused by Wirth [WIR71];
bulletAlso recognised Jackson's criticisms of the technique "design by direct onslaught" [JAC75b];
bulletDevised a method of SWR using analysis of sample data to derive a program structure which can then be translated into SWR Pascal.
bulletSWR Pascal uses structured techniques to enforce design and thus to eliminate 'thinking at the terminal';
bulletIt marries code to design forcing the programmer to consider the program in light of the design at all times. There is only a single source document from which both the technical documentation and executable code are derived, thus, code and documentation are inextricably linked and updated together.

3. Experiences of Using SWR Pascal

bulletUsed successfully since 1985;
bulletBrings students face to face with design at an early stage by use of ready-designed skeleton programs;
bulletDiscourages thinking in terms of pure code as it interweaves code with documentation/design. This leads to students having to examine programs in the light of their design;
bulletThe group has insisted upon presentation of sample data and structure diagrams in coursework assignments. Actual code counts for relatively little;
bulletSWR Pascal discourages the student who is inclined to go straight to the coding phase. Because SWR Pascal forces the student to design his program and to think in terms of program structure and the structure of sample data, it has been a useful stumbling block to the unrepentant 'hacker'. The program code is broken up into small sections and is interspersed with design statements. This makes direct 'hacking' of the code very difficult;
bulletSWRPAS possesses a monitoring facility which enables the staff members involved to review student performance in terms of the number of attempts to compile and run a program. Coupled with the continual assessment of the students' initial progress [SDG91] this facilitates a fast system of feed-back and quickly identifies early problem cases;
bulletThe tool is used by its authors for all software development carried out in the VAX environment. Early versions of SWR Pascal were used to provide the development platform for later versions;
bulletIt works! Experience has shown that the programmer who spends a few hours sketching the sample data, producing a program structure and from that deriving SWR Pascal code will be more likely to achieve first time compilation and execution.

4. Future Trends and Other Tools

bulletIt is intended to implement SWR Pascal in a PC-based environment, although this is expected to be superseded quickly by-
bulletA folding editor. The group is currently developing a folding editor environment as a replacement for the Borland Turbo Pascal IDE. This will combine all of the features of SWR Pascal (design statements being replaced by folds) with the advantages of a more user-friendly development environment.
bulletThere is a stand-alone structure diagrammer for the VAX which, it is anticipated, will migrate to a PC.
bulletMembers of the group have written a JSP pre-processor to support the group's teaching of Jackson Structured Programming. This is a COBOL-based tool for the VAX. There are no plans to implement this in MS-DOS for the use of VAX/VMS gives the student valuable experience of a mainframe environment.

5. References

[JAC75a]Principles of Program Design; M.A. Jackson; Academic Press, 1975.

[JAC75b] Data Structure as a Basis for Program Design: Fundamentals; M.A. Jackson; Proc. Infotech State of the Art Conference on Structured Programming, 1975.

[KNU84] Literate Programming; D.E. Knuth; Computer Journal, May, 1984.

[PAR87] Knuth With Knobs On - Literate Program Development; J.P. Pardoe and S.J. Wade; in Automating Systems Development, ed. D. Benyon, S. Skidmore, Plenum, 1988.

[SDG91] Lecture notes and teaching scheme for an introductory program design course; J.P. Pardoe; Liverpool Polytechnic, 1991.

[WIR71] Program Development by Stepwise Refinement; N. Wirth; CACM Volume 14, Number 4, April, 1971.

6. The SDG

The Software Development Group in the School of Computing and Mathematical Sciences is a research and development grouping. Its members are responsible for the teaching of program design and software engineering to the students in the School. The principal research area is commercial software maintenance to which the concepts of literate programming are particularly applicable. Other areas of interest include software estimation, quality and the provision of CASE tools.