    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: Professionalism in programming Part 3</title>
        <link>https://members.accu.org/index.php/articles/1033</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>




<div class="xar-mod-head"><span class="xar-mod-title">Professionalism in Programming, from CVu journal + CVu Journal Vol 12, #4 - Jul 2000</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c184/">Journal Columns</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c182/">Professionalism</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c77/">CVu</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c125/">124</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/c182-125/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/articles/c182+125/">All of these categories</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;Professionalism in programming Part 3</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 06 July 2000 13:15:38 +01:00 or Thu, 06 July 2000 13:15:38 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e22" id=
"d0e22"></a>Introduction</h2>
</div>
<p>Software needs documentation. Just how much documentation is a
moot point. The user of a Windows office suite certainly thinks
there should be more than the supplier does. As software producers
by not writing documentation, we forego the chance to shout RTFM to
the thick users who ask banal questions about our product. I don't
think that anyone will argue with the usefulness (or necessity) of
this sort of documentation.</p>
<p>But just as the final software product needs documentation, so
do the intermediate steps in the process. This is the sort of
documentation that the user will (usually) never see. These are the
definitions of how the program will be designed and built. These
are the software specifications.</p>
<p>Writing and working to specifications is a big part of Doing
Things Properly. In this article we're going to investigate what
sorts of specification we need, what should be in them, and why
reality differs so greatly from the ideal.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e31" id="d0e31"></a>What are
they?</h2>
</div>
<p>Specifications are system and process documentation. There are
many different types of specification that are related to the
software construction process. Their scope ranges from the
conception of the project to the final deliverable. They include
specifications detailing exactly what the user requires (or exactly
what they are going to get, if the two differ - they usually do),
specifications detailing the architecture of the software solution,
the interface a particular module of code has to conform to, of the
design decisions relating to a particular piece of code, and
more.</p>
<p>Specifications are formal documents that are visible to all
relevant parties.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e38" id="d0e38"></a>Why do we need
them?</h2>
</div>
<p>So what do specifications give us that means that we need to
write them? Hopefully this is obvious, but that does not mean it is
not worth cataloguing.</p>
<p>Specifications are a form of inter- and intra-team
communication. We said in the last column that projects really do
die of a lack of communication. Therefore we should use
specifications as a communications medium as much as we can - but
only where appropriate. Projects can just as easily die because too
much time is spent writing documents, and not enough time is spent
actually delivering product.</p>
<p>Specifications are often the intermediate 'gates' of a software
development process. They form a kind of contract between two
stages of the process. For example, a specification for the
interface of a particular software component is written by the
group of people who are scoping the functionality and environment
the component should exist in - this is the analysis/design phase.
In the implementation phrase the implementor of the component need
only see this specification; it should be complete enough for them
to write the component. In this sense the specification is a
contract detailing what the systems integrator expects from the
component and what the implementor needs to create. If either party
deviates from the specification then they are in error.</p>
<p>Since errors such as these are measurable against the
specification, it makes the software development process less hard,
safer, accessible, and more repeatable.</p>
<div class="variablelist">
<dl>
<dt><span class="term">Less hard</span></dt>
<dd>
<p>You can be assured a component or product has a specification,
and you know where you can find it. Tedium, legwork and confusion
are reduced.</p>
</dd>
<dt><span class="term">Safer</span></dt>
<dd>
<p>If all decisions and interfaces are documented, then when people
leave the company it will suffer less - the amount of information
loss will be minimised, and there will be a solid base for the
team's replacement member to get up to speed from. There is less
information dangerously stored away in people's heads.</p>
<p>Specification users should make no assumptions - if something
isn't documented in the specification then it should be altered to
clarify the problem. Then there is no risk of two people making
different assumptions - the classic reason why two separately
created modules do not work together when first integrated.</p>
</dd>
<dt><span class="term">Accessible</span></dt>
<dd>
<p>New people come to the project and can understand what parts of
the product do or how they work thanks to the documentation. They
don't have to search for the information in a hundred different
people's heads before they can get into the swing of their
work.</p>
</dd>
<dt><span class="term">Repeatable</span></dt>
<dd>
<p>It has been seen time and time again that well specified
projects succeed and badly specified projects fail. Companies with
well defined processes that include specification are more
successful. The increased communication oils the development
process and makes it more reliable, reducing the risks and
therefore increasing team performance.</p>
</dd>
</dl>
</div>
<p>I would (perhaps contentiously) argue that specifications become
increasingly important as the size of a project increases. This is
not because specifications are not important in smaller projects,
but because in the larger projects there is more to loose - there
is a greater number of people whose lack of co-ordination will have
a greater impact of the outcome of the software development
process.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e78" id="d0e78"></a>Specific
enough?</h2>
</div>
<p>As a student I remember being annoyed at being set an exercise
which was practically impossible because the question was vague and
could be interpreted in one of two ways, The specification for the
piece of work I was set was not suitable. Very recently (as a
professional) I've been annoyed because the specification of part
of an embedded operating system[<a href="#Bradner">Bradner</a>] was
too vague, and I was not sure how to use it.</p>
<p>Good specifications and documentation are generally taken for
granted, whereas poor specifications and documentation rapidly
become loathed.</p>
<p>But is a poor spec better than no spec? If it's factually
incorrect it definitely is not. If it's ambiguous then it's a
borderline case, depending on whether the engineers are experienced
enough recognise so. But a specification should really stand on its
own and not be defined by its readership. If its too verbose and
hides information then it may be better (in the long run) to
rewrite.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e90" id="d0e90"></a>What are the
different sorts of specification?</h2>
</div>
<p>There are in reality many different types of specifications.
Below I list the most common ones. Naturally since we live in the
real world, no one calls them by the same name. For example, a
'requirements specification' is variously called 'user requirements
specification' and 'functional constraints specification' by
different companies.</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p><span class="bold"><b>Requirements specification</b></span></p>
<p>The requirements are never clear. Customers can never tell you
exactly what they want. There needs to be a single document that
describes exactly what the item being built (be it a consumer
product, a software library, or a smaller software component of a
larger product) has to do.</p>
<p>This is the job the requirements specification. It should list
in great (or at least 'appropriate', which will usually be 'great')
detail exactly what the item will do and how it is expected to
behave.</p>
<p>These requirements are usually written as a series of numbered
sentences each containing a single factual piece of information.
For example,</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>1.3.5 The user interface shall consist of a black rectangle
containing the words 'Don't Panic' in a red san-serif typeface at
13pt.</p>
</blockquote>
</div>
<p>Uniquely numbering each requirement allows easy referencing in
subsequent documents and aids tracing a particular decision back to
a single requirement.</p>
<p>The process by which this document is created will differ from
company to company (and often from product to product).</p>
<p>Usually either the customer, or a representative of the customer
is involved in the creation of this document. It will form part of
the actual contract between the supplier and the customer (this
time in the literal sense of the word). The supplier agrees to ship
a product whose functionality meets that described in this
specification.</p>
<p>This is really very necessary, otherwise when the product is
shipped who will be to say whether it's of an acceptable quality?
Without an agreed specification to work with the customer can just
refuse to accept the product and the supplier will have spent a lot
of effort to no avail<sup>[<a name="d0e117" href="#ftn.d0e117" id=
"d0e117">1</a>]</sup>.</p>
</li>
<li>
<p><span class="bold"><b>Systems architecture
specification</b></span></p>
<p>This often bandied about term describes the shape of the
software. It encompasses things such as physical computer layout
(is it distributed client/server software or a single user desktop
application), software componentisation (how is it split up, which
parts do we need to write, which can we buy in), concurrency issues
(how many threads run at the same time), data storage (database
design), and other aspects of the system's architecture.</p>
<p>It is important to get this right and specify it in detail
before too much other work goes on, since the architecture will
affect the later stages of development, both in design and
implementation.</p>
</li>
<li>
<p><span class="bold"><b>Functional specification</b></span></p>
<p>Perhaps the most relevant specification to us (as 'professional
programmers'), the functional specification describes the exact
functionality of a particular item. For a software component this
includes an exact and unambiguous description of the public
interface of the component. For us this will equate to a list of
every public C, C++ or Java interface, method or function in the
module's API, together with a description of how to use them.</p>
<p>It contains details of all external data structures and formats,
and all dependencies that the component has on other components,
work packages, or specifications.</p>
<p>This is more than a user guide to an item or piece of software.
The detail implicitly describes how you can build the item. Two
separate teams could read the document and go away to implement it.
Although the internal implementations may differ the products they
would each supply should behave identically.</p>
<p>This is actually exploited in practice. For example some NASA
space craft employ five computers to do the job of one; four
computers implement the specification for a particular calculation,
running independently developed implementations. The fifth computer
is used to average the results of the four calculations (or to
decide whether or not one computer wildly disagrees with the
others).</p>
</li>
<li>
<p><span class="bold"><b>Design specification</b></span></p>
<p>A design specification documents the internal design of a
component. It describes how a functional specification is to be
implemented. The user of a component need never read this, however,
the implementor will write it and a maintainer will require it. The
document should be written prior to implementation (and reviewed to
prevent too much possibly incorrect coding being performed).
However, in practice this document is often written alongside
coding.</p>
<p>Whenever the design specification is written, it should be kept
up to date with the code.</p>
<p>The document contains descriptions of all internal APIs, data
structures and formats.</p>
</li>
<li>
<p><span class="bold"><b>Test specification</b></span></p>
<p>This kind of specification describes the test strategy for a
particular piece of work (software component, consumer product, or
whatever). It will contain a list of every test that must be
performed together with their acceptance criteria and how the test
will be run.</p>
<p>The test specification is usually derived from the item's
functional specification and can be used by a test implementor to
create any test code that may need writing.</p>
</li>
</ul>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e159" id="d0e159"></a>What should
they contain?</h2>
</div>
<p>Obviously each of these different types of specification contain
different material. However, there are characteristics applicable
to all types of specification.</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p><span class="bold"><b>Correct</b></span></p>
<p>This might seem an obvious characteristic, but it is also the
most important. An incorrect specification can cause man-days (or
more) of wasted effort. The number of factual inaccuracies in the
specifications in your company will probably frighten you!</p>
<p>In order to ensure correctness, specifications should undergo a
defined review process prior to release.</p>
<p>This also implies that the document should be kept up to date
(see <span class="emphasis"><em>modifiable</em></span>).</p>
</li>
<li>
<p><span class="bold"><b>Unambiguous</b></span></p>
<p>If a part of a specification can be interpreted in more than one
way then the 'specification' isn't (i.e. it is not being specific
so it is not a specification!). This will cause the problem
described above when two readers make different interpretations of
the ambiguous information.</p>
</li>
<li>
<p><span class="bold"><b>Complete</b></span></p>
<p>A specification should be self contained and complete,
describing both itself and the item that it specifies. Note that
this does not necessarily mean that it should itself contain all
the information, it is perfectly acceptable to reference other
relevant documents, as long as the reference is specific and will
allow the reader to <span class="emphasis"><em>easily</em></span>
locate the document.</p>
</li>
<li>
<p><span class="bold"><b>Verifiable</b></span></p>
<p>A specification for a software component, for example, will lead
to the production of two things: (i) the software implementation
(ii) the test harness that will be used to test the software.
Therefore the specification must be verifiable. In practice, this
largely equates to being <span class=
"emphasis"><em>correct</em></span>, <span class=
"emphasis"><em>unambiguous</em></span> and <span class=
"emphasis"><em>complete</em></span>.</p>
</li>
<li>
<p><span class="bold"><b>Consistent</b></span></p>
<p>Similar to <span class="emphasis"><em>unambiguous</em></span>,
the specification should not contradict itself. Again, this sounds
obvious, but when a specification gets to a certain size it becomes
difficult to ensure consistency holds. This becomes a particular
problem when a maintainer (different from the original author)
comes back to the specification to perform certain modifications -
it can be very easy to alter information in one place, and not
change any subsequent sections that allude to the same
information.</p>
</li>
<li>
<p><span class="bold"><b>Modifiable</b></span></p>
<p>If the specification needs updating due to factual error this
should be possible. Having specification set in stone certainly
prevents the problem of goalposts changing underneath you as you
are programming. However, its of no use if the specification is
factually incorrect.</p>
</li>
<li>
<p><span class="bold"><b>Traceable</b></span></p>
<p>A company should have a document control procedure (akin to a
source management system) in which all documents (including
specifications) reside. Each revision of the specification should
be logged in the repository and should be accessible (so you can
discover which version of the spec you were working to a year ago,
since a customer is asking you a question about a software
installation a year old).</p>
<p>Each document should contain control information that allows you
to find it in the document repository so you can check that you
have the most up to date copy.</p>
</li>
<li>
<p><span class="bold"><b>Useable during maintenance phrase of a
project</b></span></p>
<p>The specification does not only stand as the contract that the
implementor must honour, but also acts as documentation for the
item - a maintainer should be able to read the specification for a
particular piece of software, for example, and be able to
immediately understand how it works or how it is used.</p>
<p>This also implies that the document should be kept up to
date.</p>
</li>
<li>
<p><span class="bold"><b>Standards compliant</b></span></p>
<p>A specification should be carefully written to comply with all
relevant standards (for example, language definitions and company
coding standards). As the document is reviewed it should be checked
against this criterion.</p>
</li>
</ul>
</div>
<p>A specification should contain at least: an introduction, a
scope and purpose section, any relevant definitions and a set of
references. This ensures that the document is self describing and
that a reader will be able to access the information contained
within easily (e.g. they will know what knowledge is prerequisite
to reading).</p>
<p>Where appropriate a specification includes any constraints,
assumptions and dependencies that are relevant to ensure that there
is no ambiguity.</p>
<p>When writing a specification the use of language should be
carefully made. Specifications are formal documents, and so must
not be chatty or verbose (this tends to hide the important facts
behind a wall of words). Formal documents are written in the third
person, in present tense (i.e. you write must/should not will)
[<a href="#Bradner">Bradner</a>].</p>
<p>Ultimately, the specification should follow the document
standards/conventions of the company. If the company does not have
a standard (or some form of skeleton document) then you should
worry!</p>
<p>Technical writing skills do not always come for free with an
engineer. Some engineers are better at it than others. However, if
a software engineer is not capable of documenting work that they
have produced then they are a liability. Practice (followed by
review) makes perfect.</p>
<p>The best specifications are written from the perspective of the
reader, not the writer. The information is organised in such a way
as to make it more comprehensible to someone new to the item,
rather than in a convenient form for the writer. Writing
specifications in this manner does require more work and take more
time, but it's worth it if the result is simpler to understand.
Blaise Pascal once wrote &quot;I have made this letter a rather long
one, only because I didn't have the leisure to make it
shorter.&quot;</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e260" id="d0e260"></a>Why don't we
write specifications?</h2>
</div>
<p>In the real world, decent specifications often get overlooked.
Why is this?</p>
<p>Engineers do not write specifications for two reasons:</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>They do not know they should (or forget)</p>
</li>
<li>
<p>They consciously decide not to</p>
</li>
</ol>
</div>
<p>If an engineer forgets to write a specification or does not know
that they should be writing one then they are quite likely
inexperienced. They need to be told to do so by their manager.</p>
<p>Programmers like to program, not write. Many programmers do not
have good writing skills. Kent Beck will argue that it is not their
job and the documentation is in the code and its set of tests
[<a href="#Beck">Beck</a>]. Many programmers try to avoid writing
specs since their technical writing skills are not that good, or
they just do not like doing it.</p>
<p>The main reason an engineer chooses not to write a
specification, though, is that they do not appreciate the value of
the specification. Too often it's seen as a time wasting activity
that is really not necessary. Or they think 'I'll code first, then
come back to the documentation later'. Bitter experience has told
us time and time again that this does not happen.</p>
<p>Experience has also told us that code written without any
forethought (the kind of forethought writing a specification makes
you perform) is worse code. It is code that is badly designed. It
is code that is hard to understand. It is code that doesn't fit
into the overall system properly. It is code that is hard to
maintain. It is code that costs more to create and maintain than if
it had been properly specified in the first place.</p>
<p>Having said that I can cite a recent occasion that I did not
start by writing a specification for a particularly important piece
of code, an interrupt service routine. I started to write the
routine on Monday, the code was due to ship on Thursday. You would
like to think that this kind of thing does not happen in the real
world but it does. Why did this situation occur in the first place?
An inadequate specification elsewhere!<sup>[<a name="d0e287" href=
"#ftn.d0e287" id="d0e287">2</a>]</sup></p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e290" id=
"d0e290"></a>Conclusions</h2>
</div>
<p>We have seen what specifications are, some of the different
sorts of specifications that exist in the programming world, why we
write them, why we do not write them, and why our wrist should be
slapped because of this.</p>
<p>If any readers would like to describe why projects they have
been on have got stuck for lack of decent specification work then
it would be a valuable cautionary tale to the rest of the C Vu
readership.</p>
<div class="bibliography">
<div class="titlepage">
<h2><a name="d0e297" id="d0e297"></a>References</h2>
</div>
<div class="bibliomixed"><a name="Bradner" id="Bradner"></a>
<p class="bibliomixed">[Bradner] S Bradner. <span class=
"citetitle"><i class="citetitle">Key words for use in RFCs to
Indicate Requirement Levels</i></span>. RFC 2119. From:
<span class="bibliomisc"><a href=
"ftp://ftp.isi.edu/in-notes/rfc2119.txt" target=
"_top">ftp://ftp.isi.edu/in-notes/rfc2119.txt</a></span>.</p>
</div>
<div class="bibliomixed"><a name="Beck" id="Beck"></a>
<p class="bibliomixed">[Beck] Kent Beck. <span class=
"citetitle"><i class="citetitle">Extreme Programming
Explained</i></span>. Reading, Massachusetts: Addison-Wesley, 2000.
ISBN: 201-61641-6.</p>
</div>
</div>
</div>
<div class="footnotes"><br>
<hr class="c3" width="100">
<div class="footnote">
<p><sup>[<a name="ftn.d0e117" href="#d0e117" id=
"ftn.d0e117">1</a>]</sup> Yes, I have seen this happen. It is a
good example of the reason you do not want a specification to be
ambiguous. In this kind of situation every term (for example
'alpha' and 'beta' release) need careful definition.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e287" href="#d0e287" id=
"ftn.d0e287">2</a>]</sup> In fairness, since I didn't have time to
write a decent specification I spent a lot of time and effort
designing a public API file with a great deal of documentation in
the comments. When I came back to write the specification most of
the work had been done already in the code documentation. This is
not an ideal way to approach the problem, but it helped.</p>
</div>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
