Seven Steps To Quality Code – Introduction

Do you want to reduce the cost of producing your software? Do you want to reduce the number of defects, improve your customer satisfaction and make your developers (or yourself) happier? What about shorten your time to market and improve the speed at which you respond to feature requests? Of course you do! Well, I’m going to outline seven steps that you can take to enable you to achieve all these things.

My view is that software and the software development process can be massively improved by raising the quality of the written code.  What I mean by that, is that I will focus, at least initially, on the code that you see, not necessarily on its functionality.

Now, I’m not claiming that this is an original idea; improving quality is one of the core tenets of most, if not all, of the Agile methodologies, but if you haven’t yet embraced Agile, are struggling with some of the techniques or aren’t seeing the results you expected then the steps I’m going to outline will reap plenty of rewards. The approach could be particularly useful if you are suffering from poor quality code provided by a third party such as contractors or offshore teams.

The Benefits

Going a little further into the benefits of taking the effort to improve your code quality, you can fully expect to see:

    • Reduced costs
    • More reliable software
    • Higher customer satisfaction
    • Quicker response to change requests
    • Quicker response to defects
    • A happier development team

These benefits arise because of:

  • Quite simply – fewer bugs make it into builds
  • Bugs are caught earlier in the development lifecycle (when they are cheaper and easier to fix)
  • Reduced bug counts in system test, acceptance test and in production
  • Reduced time in test – potentially being able to drop a test cycle or two
  • Reduced fix times for any bugs that do occur – but more time to do them in
  • Easier refactoring for improving existing code or adding new features
  • More productive code reviews

The Approach

The approach is based on improving the quality of .Net code. The ideas will be applicable to other languages and environments, but the specific tools that I mention will target .Net and Visual Studio.

The aim is to take small highly practical steps, one at a time, until the end result is a powerful arsenal of tools and techniques that have become an integral part of the way the development team works. Each individual step should not involve any direct costs, the tools I will introduce are free. The only investment required will be a little time, effort and discipline.

The Steps

  1. Compiler Warnings
  2. XML Comments and GhostDoc
  3. Code Analysis – Minimum Rules
  4. StyleCop
  5. Code Analysis – Further Rules
  6. Peer Reviews
  7. Unit Tests

Let’s get started with step 1 – Compiler Warnings