The Code Whisperer

Practical, on the ground advice for efficient software development

Blog Posting

I lost my father to prostate cancer in September 2007, but was fortunate to have him cared for by The Greenwich & Bexley Cottage Hospice. With my sister, Karen, I’ve organised a kayak trip along the River Thames to raise money for this essential community service, which is taking place on August 10th 2008. Organisation is taking up a lot of my time, so blog postings will be a bit haphazard for the next 6 weeks.

If you would like to find out more please look at the dedicated website, www.thameschallenge.org.uk

If you've enjoyed this post, please share with others:
About Social Bookmarks

36 Common Software Development Mistakes
20. Insufficient Management Controls

For project development knowing where you are in (in terms of the plan) and when you are going to finish are the two key indicators and also the two questions the project manager will be asked the most.

In order to answer the second question you have to be able to answer the first, and that’s where the problems start.

The project plan must track the time take on a task as well as the actual progress. Having spent 5 hours on a 10 hour task implies it’s 50% complete, but is it? Assumption can be a bad thing, and assuming the allocated time is always going to be correct is a mistake. Personally I like to have tasks broken down so each one is scheduled to take a day or less, two days at the most. By scheduling  this way, the impact of inaccuracies with collecting actual progress are minimised.

In order to say where you are with a task it’s important to define complete. This is much easier earlier on when producing specifications and coding, but when the various stages of testing are under way this becomes harder. Note that whilst defining “done”, knowing how far away from “done” a developer is harder to determine, hence the one day scheduled tasks. Depending on the application you may have a zero defect target before releasing the software, or it may be no severity 1 or 2 defects and a maximum of 20 severity 3. Defining this early on means that the customer (whether it’s an external customer or an internal department) knows what will be delivered.

Once testing outside the development team commences, a defect tracking tool is essential. We’ll cover this topic in more detail in a few posts time, but metrics from this tool, particularly the active defect count will give a useful insight into the status of testing. The active defect count tends to rise very quickly when testing starts and then tail off slowly. Another useful metric is the number of new defects raised. Again this will initially be quite high, but as the quality of the application improves this metric will reduce.

Formula 1 teams capture a massive amount of data from their cars to establish how they are running and the effect of changes. There is a saying “if you can’t measure it you can’t improve it”, which I don’t entirely agree with as it should be “if you can’t measure it you can’t measure the effect of change” that applies here. Software development should have a number of metrics that are constantly being collected, as automatically as possible, for the same reasons as the Formula 1 team. The metrics may indicate changes required to the schedule or more attention is required in these areas. The effect is the same, total control of the project.

If you've enjoyed this post, please share with others:
About Social Bookmarks

36 Common Software Development Mistakes
19. Inadequate Testing

Let me say straight away that, outside of unit and system testing, I’m not an experienced tester. I believe you have to have a certain mindset to be really good at it and, although this may seem harsh, a passion for breaking things rather than building things, albeit all for the greater good. I met a number of exceptionally good testers in the past and they all share similar approaches, plus a slightly mistrusting look in their eyes.

The amount and quality of testing developers will carry out varies greatly. Putting aside any lack of enthusiasm for breaking their own code, other factors such as the architecture of the system, the quality of the test plan, if produced, and whether automated tools can be applied will influence the number of bugs remaining after system testing.

Many years ago I went to a short seminar about testing. It sounds boring but the managing director of the company leading the seminar was so enthusiastic about testing I came out enthused. He spoke in depth about a concept called the engineering V, where you have business requirements at the top of the V and development almost at the bottom. The design and development part of the project runs along the left side of the V, top to bottom and the testing part on the right hand side from the bottom to the top of the V. The idea was that you tested against the opposing specification, so unit and system testing would be against the technical design, user acceptance test against the business requirements and so on. The odd thing is that this concept is so clear in my mind over 15 years later but I can find no reference to it anywhere.

This concept does rely on top quality requirements and design documents being produced and test plans directly from these documents.

Personally I like the idea of being able to automatically test applications, so that the same tests can be easily applied against each build and release. Sometimes this consists of bespoke test harnesses testing software components, sometimes automated test tools attacking the entire application. I also favour having test plans for unit and system testing written as part of the technical design, with an indication of the plan’s successful completion forming part of the code
review.

Above all I value a user acceptance testing team that lives and breathes testing, but it’s important not to allow an “us and them” environment to exist between the development and test teams. I did hear a story about one company that attempted to improve the quality of its software by paying the test team a bonus for each bug found and the development team a bonus for each bug fixed. Needless to say the number of bugs found by the test team and fixed shot up dramatically helped by an “agreement” between the two departments, and the scheme was quickly dropped.

If you've enjoyed this post, please share with others:
About Social Bookmarks

A Warning About Multiple Code Streams

Source control systems such as Rational’s ClearCase and the open source products CVS and Subversion, make it relatively easy to branch an application’s source code to produce, say, different versions for different customers or maybe work is taking place that can be carried out by two developers independently. Merging the branch back into the main code stream can be achieved using a variety of tools, for example TortoiseSVN, for Subversion, or the brilliant Beyond Compare, which compares files and directories rather than working on the source control system directly.

Notice the last sentence doesn’t include the word “easily”. That’s because it isn’t, particularly when both streams have had changes applied and/or someone other than the original developer is carrying out the merge.

The pain of merging can be eased by applying a few simple rules.

  • Make sure your coding standards have a comment block defined that goes at the start and end of every change. The comment block should show the developer, date of change, reference to the bug or business requirement/technical design associated with the change and a concise but informative description of the change
  • Coding standards should also advise on whether unwanted code is commented out or removed. Whichever technique is adopted it should be consistently applied and the same comment block header and footer format used as if making changes to the code
  • When checking code back into the source control system a sensible and detailed description of the change, including reference to the bug or business requirement/technical design associated with the change must be entered. It’s not acceptable to put nothing or a banal statement such as “Changed made”
  • Code reviews must be carried out and should include a check of the source control descriptions and possibly also review the changes made between the two version in source control to verify that each change has the correct comment blocks
  • When complete build the application and test it. Don’t leave this until the next formal build as any knowledge gained during the merge may be forgotten
If you've enjoyed this post, please share with others:
About Social Bookmarks

36 Common Software Development Mistakes
18. Inadequate Requirements

If you look at the collection and documentation of requirements for a software application as the foundations of a building, it’s easy to see why any weakness here has a major effect in the delivered item, whether functionality that can’t be implemented fully or delayed time to deliver.

Requirements gathering and documentation fail for many reasons, and each company and application will be different, however simply put you need to have business analysts doing this work that understand the business and know how to document business requirements and processes to people who don’t. It’s imperative that the business analysts write in a clear manner, clarifying complicated areas. In my view it’s better for the business analyst to spend more time producing a more understandable document than the developer thinking her or she understands it but wasting time developing in the wrong direction.

In all documents, not just business requirements and processes, I like to apply Rudyard Kipling’s epigraph from his short story The Elephant’s Child, which has become known as Kipling’s Six Honest Serving Men.

I keep six honest serving-men
(They taught me all I knew);
Their names are What and Why and When
And How and Where and Who.

This on its own isn’t going to produce fantastic specifications, but I find it useful particularly when I know the subject matter well and need to provide documentation to people that don’t, whether it’s business requirements, technical design, user manual or operations manual.

Use of peer reviews on business requirements will improve their quality particularly if it includes reviewers that aren’t familiar with that part of the business or industry.

In my experience a significant amount of the difficulties caused by business requirements (and technical design) is that the author assumes that the reader has a higher level of understanding than they actually do. In a small company with a low turnover of staff you can get away with this, but in any other case it’s a recipe for disaster. If you are outsourcing work then business requirements and, particularly, technical designs must be of the highest quality to prevent a large number of test/correct cycles.

One last point is to do with testing, in particular user acceptance testing (UAT). I would expect UAT to concentrate on testing the application against the business requirements. In a sensible development the customer would have sight of the business requirements documentation and signed them off, or provided their own “list”. Issues found in the testing should reference the business requirements and some form of reference number. If that reference number hasn’t been followed through into the technical design and actual coding, then the ability to quickly identify the location of the problem, based on the business requirement, is lost. In additional any ability to measure the time and/or cost of developing different parts of the business requirements are just about impossible. I highly recommend that some form of reference to the business requirements is carried through technical design, coding and testing.

If you've enjoyed this post, please share with others:
About Social Bookmarks

36 Common Software Development Mistakes
17. Wasted Time During Fuzzy Front End

The front end in this context is not the GUI but the period between the project’s conception and the point it actually starts. This period, which can last from days to years, can include activities such as feasibility studies, budgeting and gaining sponsors. These are all important tasks, but can take too long, resulting in a shortened development plan.

It’s obviously better to reduce time in the front end processes and spend it during development, but really this needs to identified as early as possible. Look at the tasks being carried out and plan them, taking into account events such as financial year ends, stakeholder’s holidays and make sure these don’t coincide with decisions that require these people. Also try to carry out the task that is most likely to halt the project as early as possible so that the minimum of time and effort is wasted. If possible identify bottlenecks in the process, for example sign off by senior management, and try to bring those forward in the process, and also smooth the way for the activity.

It’s not only large projects that suffer from this problem. I’ve had many small web projects that I’ve invested a fair bit of time researching and scoping only for the client to go very quiet, then suddenly phoning up some time later, all fired up and wanting it done immediately. This is fine if you have the capacity to do it, but more often than not this isn’t the case, which is a difficult message to relay to the enthusiastic client.

If you've enjoyed this post, please share with others:
About Social Bookmarks

36 Common Software Development Mistakes
16. Planning Failures

There are books and books about planning projects, and I’m not going to attempt to replace them in one short posting!

I have a few observations over the years I would like to share.

Planning not taken seriously. For a plan to be of any use it has to be thought out, realistic, published and have tracking of time spent and progress of the task. In my opinion task need to be split down to a daily level for the plan to be worthwhile, otherwise it’s harder to know if the progress is behind the plan. If any of these don’t apply, and normally it’s most of them not just one, the planning process isn’t being taken seriously enough for it to be a worthwhile exercise.

Tasks missing. It’s easy to omit tasks from a plan and often they are common run of the mill activities that would take place as a matter of course. However omitting them from the plan has an effect - it’s time spent not allocated, which could cause the project to slip. I look at a plan as any other project document and have it peer reviewed and/or reviewed by the project team. If tasks are identified later in the project it’s crucial to add them in for three reasons. 1, you are more likely to remember them next time; 2, it allows you to adjust the plan and, if required, delivery dates; and 3, there’s an indication the task has been carried out.

Not revising estimates. Often estimates are carried out by the wrong people - sales staff, senior managers or customers. Estimates produced by developers sometimes are under the actual time required. We all know this, but revising estimates and the plan is very rare. Why?

Abandoning the plan. I’ve seen this time and time again. A project is late or chaotic, so any attempts to maintain the plan or any measured progress of the project are abandoned. The project then goes out of control, with any delivery dates a stab in the dark. It is possible to regain control of a project in this state, but take a special project manager. I have met a project manager that recovered what appeared to be a hopeless project. Possibly the most irritating chap I’ve met, but at the same time was interested in one thing - delivery of the project in the shortest possible time. He wasn’t afraid to tell the customer it would be a week late, and he delivered it when he said it would be delivered. Pure genius.

I’m sure there are more. If you have any observations on planning failure, I would like to hear them, so drop me a line at nigel(at)code-whisperer.com.

If you've enjoyed this post, please share with others:
About Social Bookmarks

36 Common Software Development Mistakes
15. Third Party Failure Part 2

Following the previous blog on third party failure, I had an email from a friend of mine who has a lot of experience with outsourcing work, some good but more bad. Here are some of his observations:

  • Specify up front the experience of the people you want working on the project, particularly if they are working in-house. There have been cases where providers have given us project leaders with no experience in leading a development, and from a group of eight people, six were recently out of university, but we were still paying full price for. I’m not suggesting that recent university graduates aren’t worth employing, but experience is critical and for a software consultancy to send a development team where 75% has very little commercial experience is at best misguided. Having highly paid (if only to the consultancy) external consultants working alongside your team can always cause some friction and resentment, which is made considerably worse if they have limited experience and appear less knowledgeable than the permanent members of staff around them.
  • Beware a glossy veneer when using a third party product (as opposed to a bespoke development) as sometimes whilst the functionality you need is there, but the implementation is well below that expected of a professional system. An example would be poorly named database fields, inefficient coding, etc. Unfortunately these problems tend to arise when the product has been chosen and your team is integrating it with your existing systems. The task isn’t impossible, just harder than it should be and may not provide the most efficient solution.
  • Multiple vendors can be a nightmare when things go wrong and there isn’t a clear issue or resolution. Lots of finger pointing and arguing and you just want it working.
  • Design choices can be influenced by vendors of products you are using trying to sell accompanying products. I have no problem with this, but you make have picked the first product because it was the best available, but that doesn’t mean that the additional product being offered is also the best available. Having said that, we’ve just spoken about how different vendors on a project can cause a problem so it’s not necessarily a straightforward decision.
  • It’s important that third parties agree to your company policy, sign non disclosure agreements and stick to them. There’s no point investing money in a competitive advantage and having the consultants take your trade secrets to a competitor.
If you've enjoyed this post, please share with others:
About Social Bookmarks

36 Common Software Development Mistakes
15. Third Party Failure

Outsourcing any part of a project to a third party is a risk, but one that can be minimised. By careful planning and management. for example having good quality technical design documents and continual communication with the third party, it’s possible to benefit from the use of a third party software, whether bespoke or readily available software.

Outsourcing allows projects to have more personnel working on it than the company has. Outsourcing is sometimes used as a way of reducing the cost of a project, although, for a variety of reasons some of which are outlined below, the lower cost of development staff doesn’t always result in a lower overall cost. Generally outsourcing is carried out away from your office, so you need to plan for more time spent communicating that you would if the development team were in your office, simply because you will probably have one point of contact and your request for information may require a return call.

Personally I think it’s vital that outsourcing isn’t used as a scapegoat for a high risk project. I have seen this happen or more than one occasion and whilst a large consultancy firm was brought in that could absorb any financial penalties, the consultancy’s staff were under immense stress to deliver the undeliverable.

Managing third party development isn’t an area I’ve had a great deal of experience of, so I’ve dug out a few tips from various books as well as my own.

  • Top quality design documents are key. The documents need to be well written, detailed and correct. Peer review all documents sent out and make sure the outsourcing company understand the work required sufficiently to estimate and plan the work. One major point of failure is the outsourcing company not appreciating the complexity of the work required. This can be the fault of either party. This is of particular importance if the work is carried out away from your office as the ability to communicate face to face over small items is greatly reduced. If you are receiving the source code and planning to maintain it yourself then you must supply your coding standards and consider performing a code review on the delivered code.
  • Constant communication. Make sure you are aware of real progress against your plan, not just the time taken, and have clarification that the stated progress is correct.
  • Risk assessment. You will need to include the outsourcing in your risk assessment, and possibly have a backup plan
  • Frequent code drops. By having points in the development where code can be delivered and tested, you will have a measurable sense of progress, or slippage. Sometimes the code drop is combined with payment to the third party an incentive for working code to be delivered on the agreed dates.

I don’t want to give the impression that outsourcing is a bad thing, it’s not, provided it’s approached sensibly and managed correctly. Having said that a number of high profile public projects, for example the NHS patient record system, have been delayed due to contractual issues with the third party developers. The same issues that cause delays and problems with an internal project seem to be magnified when a third party is involved.

If you've enjoyed this post, please share with others:
About Social Bookmarks

36 Common Software Development Mistakes
6. Poor Office Environment Part 3

Since 1981, aside from my own office at Operations Support, I’ve seen a very few outstanding offices and some some OK offices, but most have been very bad from a productivity point of view. As the office environment is an important aspect of developing high quality software, I was very interested in a recent article by Joel Spolsky in Inc magazine

You can read the entire article called How Hard Could it Be?: Adventures in Office Space, but this bit really caught my eye:

“There will be a reception area with a dry creek of stones and pebbles and plants that will make a great first impression on our guests. There will be a big lunchroom, because we all eat together, as well as a coffee bar, a lounge, a 180-gallon saltwater aquarium, the aforementioned shower, a library with reclining chairs for naps, two private meeting rooms, 20 private offices for programmers, 23 adjustable-height workstations for everyone else, Wi-Fi, a big screen for movies and video games, and enough glass to build the world’s largest ant farm. We will have some room to grow, finally. And in two years, if all goes well, it will be too small for us.”

Joel explains that he needs developers of the caliber that could choose to work at Google or Microsoft so needs an office environment that is as good as, or better, that these two software giants. Sounds like he’s done it.

If you've enjoyed this post, please share with others:
About Social Bookmarks