The basic reality is that it will be prohibitively expensive, take too long and be ineffective trying to change mindsets when one can implement a gated checkin pipeline that ensures compliance right from the first checkin.
As per Martin Fowler's description1) Continuous Integration (CI) is the practice of merging development work with a shared mainline branch frequently – at least daily – in order for each integration to be verified by an automated build and automated tests to ensure changes work and work with other changes.
A core concept of IT:AD:Continuous Integration is that only a small fraction of new code is added – specific to a single work item – so the cause of a test failure is easier to find. In older build systems, faulty code is already merged with the primary trunk before the build server can test and fail the new work (leading to “Breaking the Build” scenarios). Current build servers can mitigate (see IT:AD:VSTS:VCS:Git:HowTo:Branch Policy).
The primary function is to test the changes, and report back to the developer. It is not to deploy the code to a target environment. A more mature paradigm is the concept of IT:AD:Continuous Delivery system.
* Static analysis for code maintainability, logical errors, security recommendations:
### Tool Comparison ^Tool^Notes^ |IT:AD:StyleCop|| |:::|Advantages:| |:::|* Free| |:::|* Open Source| |:::|* Can run on Hosted Build Agents.| |:::|Considerations:| |:::|* Surpassed by flexibility of IT:AD:CodeIt.Right| |:::|* Buggy in IT:AD:Visual Studio 14.| |:::|* May not be able to create custom rules.| |:::|* Pretty dated. May not be able to understand latest C# syntax.| |:::|Disadvantages:| |:::|* Rigidly adheres to Microsoft Standards, defined over a decade ago.| |IT:AD:CodeIt.Right|| |:::|Advantages:| |:::|* Greater flexibility than IT:AD:StyleCop| |:::|* Already has the same rules as IT:AD:StyleCop.| |:::|* Can be used to define custom rules.| |:::|Considerations:| |:::|* Enterprise licensing might be an issue.| |:::|Disadvantages:| |:::|* Not free.| |:::|* Not Open Source.| |IT:AD:Resharper|| |:::|Advantages:| |:::|* Very trusted by developer community.| |:::|* Focuses on what's needed.| |:::|* Free if using just the CLI in the Build Server| |:::|Considerations:| |:::|* Does not have as many rules as IT:AD:StyleCop.| |:::|Disadvantages:| |:::|* Not Open Source.| ## Resources ##