    <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 #13</title>
        <link>https://members.accu.org/index.php/articles/1163</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 14, #2 - Apr 2002</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/c115/">142</a>
<br />

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

                    -                        <a href="https://members.accu.org/index.php/articles/c182+115/">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 #13</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 06 April 2002 13:15:50 +01:00 or Sat, 06 April 2002 13:15:50 +01:00</p>
<p><strong>Summary:</strong>&nbsp;<p>How long is a piece of string?</p></p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e22" id="d0e22"></a></h2>
</div>
<div class="blockquote">
<blockquote class="blockquote">
<p><img src="/var/uploads/journals/resources/Pete%20Goodliffe%2013.png" align=
"right">never guess. It is a shocking habit - destructive to the
logical faculty. (Sherlock Holmes [<a href="#Doyle">Doyle</a>])</p>
</blockquote>
</div>
<p>How long <span class="emphasis"><em>is</em></span> a piece of
string? Or for our purposes, how long does a piece of string take?
It's probably about as simple a question to answer, and it makes
about as much sense.</p>
<p>This article is about <span class="emphasis"><em>software
timescale estimation</em></span>. It is an important skill of the
'professional' programmer. It is also one of the mystical black
arts of development, based more on hunches than science, with
frequently inaccurate results.</p>
<p>Last time we looked at software development lifecycles. In order
to plan the duration of each stage of the development process we
need to have an understanding of how long each task will take. This
is where and why we estimate. Essentially, estimation is part of
the project planning processes - but that doesn't mean that it's
entirely done by the project planners!</p>
<p>There are many reasons why we are asked to estimate how long it
will take to complete a programming task. At the initiation of a
project, for example, during the feasibility study the length of
each task needs to be estimated to calculate how long the entire
project will take. This indicates if the project is possible, and
if it is economical. From this point on the estimates should be
revisited and revised throughout the life cycle of development.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e45" id="d0e45"></a>Stab in the
dark</h2>
</div>
<p>All along our software timescale estimates are just educated
guesses (otherwise they wouldn't be estimates). We don't really
know how long a task will take until it's been completed, when it's
generally too late for the information to be useful<sup>[<a name=
"d0e50" href="#ftn.d0e50" id="d0e50">1</a>]</sup>. Whilst good
estimates are reasoned and justified, bad estimates are little more
than a stab in the dark. This is a standard engineering issue,
requiring perceptive and flexible management. It's been an
engineering issue for centuries<sup>[<a name="d0e54" href=
"#ftn.d0e54" id="d0e54">2</a>]</sup>. Managers and planners deal
with the estimations for the whole project and that's <span class=
"emphasis"><em>exceptionally</em></span> hard. We'll just attempt
to look at estimating single programming jobs. Thankfully that's
not exceptionally hard, just <span class=
"emphasis"><em>really</em></span> hard.</p>
<p>Timing estimates are important since the bulk of the cost of
software development is in the manpower. Development environments
and hardware costs pale into insignificance. Don't underestimate
how important this estimation skill is. To get maximal team
productivity the responsibility is on each member of the team to
work at their best. Estimation becomes an essential skill in this
context. With accurate estimates, scheduling can take place and
best use of each engineer can be made. However, if an estimate is
wrong and an individual slips, say by a week, every other developer
that relies on that task's completion is also set back by a week.
The project slips. We'll talk more about slippage later.</p>
<p>We see timescale estimates, taken at different times,
establishing different things. The up-front estimates determine
project feasibility and tend not to drill too far down to
individual programming sub-tasks. Later we see detailed sub-task
estimates needed for project planning. Then the actual day-to-day
timing information allows managers to allocate resource effectively
and ensure timely progress. Often new tasks are discovered during
development which need accounting for and slotting into the
schedule.</p>
<p>It all seems quite dull, but it is part of the commercial
reality of software development.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e70" id="d0e70"></a>Why is
estimation hard?</h2>
</div>
<p>Because if it was easy people wouldn't be paid to do it! But
there's probably a better reason than that&hellip;</p>
<p>I live in Cambridge, my family lives in Bristol. Software
timescale estimation is akin to estimating how long it will take me
to visit them. Given a strong prevailing tailwind and no traffic I
can pretty much tell you how long it will take me to drive there.
But if there are road works, traffic jams, my car breaks down, I
leave late, or I travel at rush hour this estimate becomes a lot
less reliable. We can get quite some mileage out of this is an
analogy.</p>
<p>Foreseeing some of these problems I will commit to a likely
arrival &quot;window&quot;. I know the best case journey time. I have an idea
of the worst case (I've had some nightmare trips). I can judge an
expected time somewhere in the middle of the two. However, I can't
really account for the unforeseen - if my car breaks down I'm
stuck. Mobile phones are helpful in this situation - if I'm going
to be late, I can ring ahead and let my folks know to keep the
dinner heated (and preferably out of the dog).</p>
<p>Developing a software system does have many correlations with
this - potential problems to plan for, coping with the unforeseen
and dependency on third parties<sup>[<a name="d0e81" href=
"#ftn.d0e81" id="d0e81">3</a>]</sup>. This begins to show us why
estimating the length of a development task is so hard. In more
detail:</p>
<p>There are lots of variables to consider.</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Some of those variables may change day-to-day.</p>
</li>
<li>
<p>Requirements may change under your feet, leading to scope
increases.</p>
</li>
<li>
<p>Often you only discover specification problems once work is
underway, this will affect the amount of work required, and
therefore the estimate.</p>
</li>
<li>
<p>There are always unforeseen problems (for example, recently my
linker couldn't cope with the size of image I was generating and I
needed to go off and fix the linker)</p>
</li>
<li>
<p>You can't give an &quot;accurate&quot; guess without knowing what work is
involved, and you rarely know in advance exactly what work is
involved (for example, reworking existing libraries that don't
provide enough functionality, or refactoring to enable safe
extension of existing code).</p>
</li>
<li>
<p>If the task is something that has not been attempted before it
is harder to figure how long it will take.</p>
</li>
<li>
<p>Estimates become contractual, therefore concrete, hard to move,
and costly to get wrong.</p>
</li>
<li>
<p>It is hard to work to someone else's estimate - were you not up
to the task if you miss it?</p>
</li>
<li>
<p>There is a lot of responsibility implied when working to your
own estimate - you are honour-bound to meet it!</p>
</li>
<li>
<p>Projects tend to have components reliant on third parties, and
that is a nightmare. This may be as large a component as the
operating system, or a small but significant library.</p>
</li>
<li>
<p>The estimate is just another responsibility: not only are you
accountable for creating the code, and for it to be good,
well-designed, maintainable code. You also have to deliver it to a
timescale that you have promised.</p>
</li>
</ul>
</div>
<p>It is simply impossible to see the unforeseen, and this makes
estimation hard. We still have to account for the things that we
are genuinely able to foresee. Some of the items in the above list
we can reasonably expect.</p>
<p>The temptation to give optimistic estimates is strong. There is
pressure from above to promise short schedules, so that we can win
contracts, announce market releases, maintain internal political
stability, and so on. This is a sad reality of the commercial
world. Pressure also comes from personal pride - engineers want to
promise an optimistic timescale, they are motivated people who are
proud of what they deliver and how fast they can do it. However,
our timescales must be grounded in reality, not in ideals.</p>
<p>We need to balance this with the danger of the extreme opposite.
It is easy to imagine a task taking a long time, and compensating
by coming up with a very large duration estimate. The danger with
over estimating is that a project will always expand to fit
available time! Project management involves a large amount of risk
management. Our estimates can't legislate for everything - the
scheduler has to be prepared to take these estimates and work them
into a suitable plan, but must still be prepared to maintain
flexibility.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e127" id="d0e127"></a>Practical
ways to estimate</h2>
</div>
<p>Given that estimating how long it takes to write some software
is a difficult job, how do we approach the task? At the end of the
day, it's largely about experience. That's not to say it's an old
man's game, but if you don't work against a backdrop of schedules,
and set yourself targets to work towards then you won't grow in the
skill.</p>
<p>Like with so much else, practise makes perfect.</p>
<p>However, in the Real World we rarely have the luxury of practice
projects, or a sandbox to experiment with such estimation.
Somewhere along the road from junior programmer to guru you have to
pick this up!</p>
<p>Different people will work on a particular task at different
rates. This is natural, everyone has a different set of skills,
level of experience, confidence, and relative number of
distractions (as in older projects vying for attention, or home
commitments). You need to gauge how fast you work, and have a good
understanding of the task you're embarking on. Estimation is
personal.</p>
<p>We can identify a number of dangers with estimation that we can
guard against when producing an estimate:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>The more functionality requested, the harder the estimate is to
make. Try to shave off as much unnecessary functionality as
possible. If this means staging the delivery of the piece of
software then that's for the best.</p>
</li>
<li>
<p>If the task depends on third party input then it is harder to
estimate. Who is responsible for chasing the third party for
delivery? You may need to factor this into your estimate.</p>
</li>
<li>
<p>Don't bow down to the pressure &quot;from above&quot; to be optimistic.
Don't promise unrealistic timescales thinking you can make it up if
you work overtime. Have an appropriate response to managers who say
&quot;it just has to be done quicker.&quot;</p>
</li>
<li>
<p>Never plan up front on working overtime.</p>
</li>
<li>
<p>Not fully comprehending the problem will lead to very bad
estimates.</p>
</li>
<li>
<p>Make sure you include all the tasks involved in the time
estimate (see below).</p>
</li>
<li>
<p>If the schedule is poorly monitored, the estimate becomes a
worthless statistic anyway.</p>
</li>
<li>
<p>The more concrete and specified a project is, the easier it is
to estimate. Have you been given a good spec?</p>
</li>
<li>
<p>It must be clear whether the estimate for actual 'job time'
(work effort) or the expected duration of the task (elapsed time).
The two will be very different.</p>
</li>
</ul>
</div>
<p>When you make the estimate it is vital to consider every
activity that will be required to deliver the software. This means
including:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>performing adequate thoughtful design,</p>
</li>
<li>
<p>any exploratory work or prototyping required,</p>
</li>
<li>
<p>the actual implementation work,</p>
</li>
<li>
<p>debugging,</p>
</li>
<li>
<p>unit testing,</p>
</li>
<li>
<p>integration testing,</p>
</li>
<li>
<p>writing the documentation,</p>
</li>
<li>
<p>any research or training you'll be undertaking in the period,
and</p>
</li>
<li>
<p>all the other stuff you do in the day (read email, browse the
web, drink coffee).</p>
</li>
</ul>
</div>
<p>Looking at this we understand that much less time is spent
coding than initially perceived. Above all, don't forget to include
testing and documentation in an estimate. They are essential, yet
so many estimates given consider coding alone. With no time given
to testing and documentation code is delivered that doesn't work
and can't be fixed later on because no one knows how it fits
together. Remember holidays and normal interruptions (meetings,
training, sickness, and so on). On average around half a day a week
is holiday, probably another half a day taken up on
'interruptions'. From personal experience, on one project I made an
appropriate estimation for a task, but didn't contend with being
pulled off to look at other issues from older projects. The
consequence of this was to push back my delivery time.</p>
<p>A standard estimation metric is to figure out how long you think
the work will take. Double that and add a week for luck. It's
surprisingly accurate! When estimating several tasks that run
back-to-back, watch out since more has to be done between tasks
than usually anticipated.</p>
<p>Don't over estimate just to cover tracks. It is better to commit
to doing less stuff, but better and within the projected/allotted
time than to implement loads of unnecessary functionality and slip
badly.</p>
<p>Be prepared to justify a timescale that you give - if you can't
describe how you intend to approach the problem and the internal
milestones you need to look at it more. If you really can't
estimate a time for a task, it shows that you don't understand it
fully. Perhaps you need to break it up into smaller tasks, and
provide estimates for them. Spending more time on
design/specification and thinking through the sub-task list will
make sure you're not a factor of ten out in an estimate.</p>
<p>The PERT estimation technique can be helpful. It is like my
arrival 'window' calculation when driving to Bristol. You estimate
three times corresponding to different likelihoods of meeting
delivery dates: a best case, worst case and likely case. This ties
up with scheduling procedures allowing a calculation of best/worst
case project time. The bigger the gap between each estimate, the
bigger the risk associated with the task. Perhaps it will need more
careful management, or giving to a more experienced member of
staff. There are other formal estimation techniques, for example
Boehm's COCOMO, which dates from 1981. Many such models are just
more formal educated guesses, based on a relatively small set of
empirical results. The models are often complex and rely heavily on
size analysis.</p>
<p>Above all else, don't assume that <span class="emphasis"><em>all
will go well</em></span>. Invariably, it won't.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e213" id="d0e213"></a>Keep up!</h2>
</div>
<div class="blockquote">
<blockquote class="blockquote">
<p>&quot;How does a project get to be a year late? &hellip; One day at a
time&quot; (Frederick P. Brooks, Jr. [<a href="#Brooks">Brooks</a>])</p>
</blockquote>
</div>
<p>When deadlines slip engineers work very hard and get little
credit. Bad estimates foster managers' incorrect assumptions about
the difficulty of a task since it isn't understood how incorrect
the schedule was in the first place. When it is our place to make
an estimate it is therefore essential to get it right.</p>
<p>With this increasing pressure to be prophets as much as
programmers how do we respond? The estimation neophyte sees an
impractical, if not impossible task. Given a realistic estimate
here are a few key ways to keep to schedules:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>We don't always have the luxury of making own estimate. When
given new task, ask is the timescale really practical? Even if you
made the estimate - start by criticising it. A little sanity
checking up front can save you from a world of pain.</p>
</li>
<li>
<p>Keep a constant eye on how long you're taking against the
scheduled time. Refer to schedule - it matters.</p>
</li>
<li>
<p>Write your timescales down, including personal estimates for
intermediate tasks, and run yourself as a 'mini-project'.
Repeatedly review your list (once a week/day).</p>
</li>
<li>
<p>Provide yourself a personal task 'soft deadline' you want to
work to, within the external timescale. It's not contractual, but
can be a great help, adding urgency without too much stress!</p>
</li>
<li>
<p>Do as much as necessary and no more. It might be fun to refactor
now, but ask for it to be scheduled later if isn't really needed
now. An ill-chosen detour on my route to Bristol will really set
back my arrival time.</p>
</li>
<li>
<p>Write good code (keeps later maintenance time down
radically).</p>
</li>
<li>
<p>Careful design encouraging modularity tends to reduce dependency
and so reduce the ill affects of slippage and the 'bunching' of
tasks on the schedule.</p>
</li>
<li>
<p>Maintain a positive and optimistic approach. As soon as you
believe a project is doomed, the project's probably doomed!</p>
</li>
<li>
<p>Be aware of the estimation pitfalls mentioned above, and how
they could be affecting this task.</p>
</li>
<li>
<p>If there is no written specification, get one and get it
approved by the task stakeholders. Delivering the wrong system can
be just as damaging as not delivering right one on time.</p>
</li>
<li>
<p>Don't forget to aim to finish with time to document/test - don't
have a final coding sprint in the last few days of the
schedule.</p>
</li>
<li>
<p>Watch out for changing requirements/specifications and track how
this will affect your timescales. If it's an adverse change, report
so immediately.</p>
</li>
<li>
<p>Be strict with distractions. If you work on other tasks
accounted for them.</p>
</li>
</ul>
</div>
<p>If you find a task taking longer than planned, it is essential
to let people know. Like phoning ahead when I'm travelling to
Bristol, it is better to have this fact out in the open as soon as
possible. If the possibility of overrun is foreseen different
scheduling decisions can be made to minimise the impact of the
overrun. As the number of tasks and people increases this becomes
ever more important.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e268" id=
"d0e268"></a>Conclusion</h2>
</div>
<div class="blockquote">
<blockquote class="blockquote">
<p>Good luck is a lazy man's estimate of a worker's success.
(Anonymous)</p>
</blockquote>
</div>
<p>There is no rigorous method to accurately perform this kind of
timescale estimation. That's why it's estimation. We should be
developing our estimation techniques, and become more aware and
wary of potential problems. We also need to develop the ability to
work to a schedule and identify when schedules are impractical.</p>
<p>We can draw up a plan that allows us to manage the development
schedule. It is based on estimation, but in practice all we will
see is how long each job really takes compared to how long we
thought. Invariably, we watch the ship date slip further and
further back.</p>
<p>Does this mean plans are useless? Absolutely not!</p>
<p><span class="emphasis"><em>What do you think? Now
reply.</em></span></p>
</div>
<div class="bibliography">
<div class="titlepage">
<h2><a name="d0e283" id="d0e283"></a>References</h2>
</div>
<div class="bibliomixed"><a name="Doyle" id="Doyle"></a>
<p class="bibliomixed">[Doyle] Arthur Conan Doyle (1859 - 1930).
<span class="citetitle"><i class="citetitle">The Sign of
Four</i></span>. <span class="bibliomisc"><a href=
"http://www.literature.org/authors/doyle-arthur-conan/sign-of-four/"
target=
"_top">http://www.literature.org/authors/doyle-arthur-conan/sign-of-four/</a></span></p>
</div>
<div class="bibliomixed"><a name="Brooks" id="Brooks"></a>
<p class="bibliomixed">[Brooks] Frederick P. Brooks, Jr.
<span class="citetitle"><i class="citetitle">The Mythical Man
Month</i></span>. Addison Wesley.</p>
</div>
</div>
<div class="footnotes"><br>
<hr class="c3" width="100">
<div class="footnote">
<p><sup>[<a name="ftn.d0e50" href="#d0e50" id=
"ftn.d0e50">1</a>]</sup> Except, of course, as experiences to base
future estimates on.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e54" href="#d0e54" id=
"ftn.d0e54">2</a>]</sup> For a Biblical example, see Luke
14v28!</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e81" href="#d0e81" id=
"ftn.d0e81">3</a>]</sup> Which makes me wonder: perhaps as
developers we need 'third party insurance' for our libraries? Not
sure what we'd do with the fire and theft&hellip;</p>
</div>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
