Phase 2 – Static Analysis of the source code
Source code inspection is (or should be) a integral part of your software development process. Often this requires human beings(!) to perform formal code reviews who possess an understanding of the software requirements and application design. However, we can automate much of this using tooling integrated into the build process. Some examples of inspection that we can perform are
- Adherence to organisational coding standards (e.g. all source files must start with a copyright statement, all functions should be commented)
- Finding duplicated, or copied and pasted code statements.
- Finding garden variety programming mistakes.
- Adherence to architectural design rules.
Phase 3 – Compilation of the source code
If you are writing software using a programming language that needs to be compiled, such as Java or C++, this is obviously a very basic and essential gate to pass through.
Phase 4 – Execution of unit tests and test coverage analysis
We should always seek to execute the unit tests. Indeed, for some build management tools, this is the default setting and we can impose a gate that fails the build if unit tests do not pass.
The ability to write robust unit tests, that can be repeatedly executed in an automated fashion, in different environments, is one of the hallmarks of a good software developer IMHO. Wiring the execution of these tests into the CI process via the build tool, helps us to ensure that the tests do not contain dependencies on a developer’s local environment – a mistake more junior team members often make. However, how can we determine that the tests are actually doing something useful, and exercising appropriate functions or routines within the application code? This is accomplished using a code coverage analysis tool (such as Rcov), which can highlight those areas of the code-base untroubled by testing. Gates can be set as course-grained thresholds, e.g. trigger a build failure if less than 80% of all application code is being tested, or more granular configurations can be applied.
Phase 5 – Packaging the application
Although we normally don’t attribute a quality gate to this phase, it is often useful during the CI process to embed information into the packaged application for the purposes of traceability and provenance. For example, this can help identify the source code origin or ‘tag’ of an application deployed to a testing environment when defects are found.
Quality Gates – Click to Enlarge
Summary
Hopefully, I’ve demonstrated how CI, in addition to continuously integrating the source code developed by your team, can also provide a valuable feedback loop with respect to the quality of the software being created. In the next part, we’ll look into some options for applying ‘functional’ quality gates within the CI process using advanced testing automation.
Adam Leggett has worked as a software consultant to UK FTSE 500 companies for over 10 years at UPCO. He specializes in enterprise technologies and agile Application Lifecycle Management (ALM) tooling. He is Chief Architect for Mike CI, providers of a simple to use, on-demand, hosted Continuous Integration service.
Mike – Smart Services for Smart Developers.
Pages: 1 2

May 8th, 2010
Certified Guide 
Posted in 

I enjoyed reading the quite content rich entry you had to talk about.