How many times I have heard the statement "Code should be maintainable" from clients, Delivery Managers or Project Managers. I always ask them, how you quantify maintainability. I am listing down some of the factors that can be measured and help make the code maintainability quantifiable.
Code Coverage- describes the degree to which the source code of a program has been (unit) tested. Popular tools to measure code coverage in Java is Emma.
Code Complexity - is another measure that can used to identify and quantify the code maintainability. Factors like Cylometric Complexity, Halstead's software science metrics and Lines of code metrics are some of the factors. Infact, there is a measure called Maintainability Index that can be calculated by using the factors. Check out tools to calculate MI here.
Documentation - is another factor that be used to quantify code maintainability. Documentation can be your normal JavaDocs or the inline source code commenting. You have tools like JavaNCSS where NCSS ( non commeting source statements) that can be applied at class, method/function level
Code Format - is not really a measure but is an indicator of the readability of the code.Tools like CheckStyle can help identify the code formatting problems (from non standard class headers, indentation issues to spacing, variable naming convention and so on). Any issues reported by the tool can be used an indicator of the maintainability of the code
""It is an ingenious solution for a problem that never should have existed in the first place." People will make mistakes and we will need tools to identify and correct them.
No comments:
Post a Comment