During the implementation process, building applications with consistent code is considered one of the main objectives, which the development team aims to, because it affects the final product quality. Consistent code is the term that means writing code that follows the coding best practices and conforms to rules and standards. Peer review can be considered the method by which we can guarantee that the development team really writes consistent code. The automation took part of the job when static code analysis tools came into the picture. This article tries to explain the concept of static code analysis and tools that can be used to realize this concept. I will focus in this article on managed code analysis, so native or unmanaged code is out of article's scope.
Code analysis is nothing except inspecting code to find common mistakes, provide suggestions for code improvements and re-factoring, and detect violations of coding standards and rules. Code analysis can be considered one of the main quality metrics or KPIs in the implementation process.
There are many managed code analysis tools such as FxCop which is a standalone utility that can be used to analyze managed code against a library of predefined rules. Now this tool is fully integrated with the Visual Studio Team System IDE.
For managed code, Microsoft defines groups of rules related to the implementation process, which cover various aspects such as naming conventions, performance issues, security considerations, globalization, maintainability etc. All of these rules are about two hundreds and compose the library that the VSTS code analysis tool uses to check code consistency.
We will explore the most important rules in the guideline as the following:
Naming Conventions:
These rules enforce naming standards as described in the Design Guidelines. Using these rules verifies that names of items such as assemblies, classes, members, and variables conform to standards. Some rules will even help to detect misspellings in your assigned names.
Santhakumar MunuswamyPosted Dec 1, 2015, 3:15 AM
Good One