To produce consistent high quality deliverables it is necessary to consider quality at each stage of the software development process.
When designing the application:
Follow a ‘separation of concerns’ strategy to ensure application logic is correctly partitioned into presentation, business and data access layers. This promotes the production of loosely coupled and highly cohesive components. In turn this leads to a flexible and adaptive codebase that is better able to cope with code changes due to having fewer dependencies. Fewer dependencies minimise the impact of future changes reducing the amount of testing required.
Reduce the ‘boilerplate code’ that developers must write in order so that they can focus on producing business logic. There is a direct correlation between the amount of code and the number of tests that need to be written to test the code. In my current role I used aspect-orientated programming (AOP) techniques and the .Net ContextObject class to move transaction handling, auditing, authentication, authorisation and logging functionality into a separate ‘component services’ layer. Developers could then utilise these ‘services’ in a declarative programming style by simply adding .Net attributes to appropriate business methods.
Utilise well established design patterns, such as the model-view-controller (MVC) to promote good coding practices. One of the chief benefits of MVC is that it enforces a clear separation between the business and presentation logic making the application far easier to test than with the traditional web form pattern.
When designing the development process:
Ensure developers have extensive business knowledge gained through regular contact with business sponsors. A good appreciation of the business requirements can avoid costly bugs. If a bug is found during analysis it is an order of magnitude cheaper to correct then if it is found by a user once the code has been deployed.
Provide developers with good unit testing techniques to make it faster for them to write tests. Techniques such as unit testing frameworks, mocking, inversion of control and dependency injection can all speed up the development and execution of tests.
Automate testing as part of regularly rebuilding the codebase. This should be done as part of a daily build or continuous integration strategy.
Promote best practices by enforcing adherence to coding standards and objective metrics within the build process using such tools as NCover, FxCop, StyleCop etc
Use code generation tools to quickly produce CRUD code that complies with agreed coding standards. This reduces the amount of handwritten code that needs to be tested explicitly.
You must log in to post a comment.