Next: Structures Up: A Simple Example Previous: Command formats

A simple example

The example used below is based upon a simple technical article or paper. Figure 2.1 shows the resulting formatted output that will be generated from when this is processed. For brevity, the bodies of some of the paragraphs have been abbreviated in the source text listing that follows:


% comment lines begin with the percent symbol and are ignored by
% LaTeX and TeX.  LaTeX commands begin with a back-slash.

\documentstyle[11pt,a4]{article}

\author{David Budgen \\  University of Stirling \\  Scotland}
\title{On A Use of Metrics for the Assessment of Software Designs}

\begin{document}     % this begins the actual document body
\maketitle           % this actually creates the title block

\begin{abstract}
The following description was an outline of a paper being submitted
for a conference.  It summarises an item of work, and gives the
supporting technical references.
\end{abstract}

\section{Introduction}

The work described here was performed as part of an Alvey-funded research
project (MDSE -- MASCOT Design Support Environment).  The project is
investigating ways of enabling a designer to produce and assess a design
using the MASCOT representation \cite{mascot}.

\section{Metrics for Design}

The lack of metrics that can be used to quantify the features of software
designs can be attributed partly to the lack of any standard design
representation.
   ......
This therefore makes MASCOT a widely-available `standard' that
can be used to provide the basis for the work of this project.

The use of metrics for assessing the quality of code is quite
well-established \cite{conte}, and the value of many of the better-known
   ......
common design representation.

\section{Experimental Work}

The work described in this paper has taken a rather different approach,
similar to the `top-down' approach used by Troy and Zweben \cite{troy};
   ......
that is more suited to a quantitative assessment.

We begin by selecting a set of {\em design principles}, which are global
descriptions of the properties of a design that are believed important.
We then derive a set of {\em general attributes} that reflect these
principles, and further decompose these into {\em specific attributes}.
Figure 1 shows the proposed hierarchy of principles and attributes.

The next step is MASCOT-specific, and involves identifying the
MASCOT design entities that will be expected to exhibit the
specific attributes, and from this, the measurable features that will
provide quantitative assessments of these attributes.

We are currently conducting a series of `design experiments' within the
    ......
of the {\em design principles}.  The preliminary results from these will
be presented in this paper.

\begin{thebibliography}{6}

\bibitem{mascot} H R Simpson and K Jackson, {\em Process Synchronisation
in MASCOT}, The Computer Journal, {\bf 22}, 332, 1979

\bibitem{conte} S D Conte, H E Dunsmore and V Y Shen, {\em Software
Engineering metrics and models}, Benjamin/Cummings, 1986

\bibitem{troy}  D A Troy and S H Zweben, {\em Measuring the Quality of
Structured Designs}, Journal of Systems and Software, {\bf 2}, 1981, 113--120

\end{thebibliography}
\end{document}

This example contains a number of additional forms, most of which should be self-evident. In particular the combination \\ forces a line break at that particular point in the text.

You might note that cannot always produce perfect line breaks, although it does its very best using strict hyphenation rules. The first line of the second paragraph of is slightly longer than the other lines, and the following extract from the run-time output produced by shows how this is reported.


This is TeX, C Version 2.9 (preloaded format=lplain 89.3.20)  25 OCT 1990 09:48
**&/usr/lib/tex/fmt/lplain dbexample
(dbexample.tex
LaTeX Version 2.09 <25 Jan 1988>
(/usr/lib/tex/inputs/article.sty
Document Style `article' <5 Feb 88>.
(/usr/lib/tex/inputs/art11.sty)
) (/usr/lib/tex/inputs/a4.sty) (dbexample.aux)
Overfull \hbox (4.05452pt too wide) in paragraph at lines 38--47
[]\elvrm The use of met-rics for as-sess-ing the qual-ity of code is quite well
-established
] [2] (dbexample.aux) 
Output written on dbexample.dvi (2 pages, 5532 bytes).

This is a relatively infrequent problem, although it becomes a more severe one if you use narrow page widths (using two columns leads to a significant increase in such lines). It is rarely significant in terms of the usefulness of the output!

1.3


webweaver@cs.stir.ac.uk