Monday, October 15, 2012

What make Quality of Code/ How to measure?



What make Quality of Code/ How to measure?

To make sure that your code is well running together with the other, you might need to have standard or tools that you and your team could work

Code Metrics

Code metrics is a set of software measures that provide developers better insight into the code they are developing. By taking advantage of code metrics, developer can understand which types or methods should be rework or have more tests.
There are some common measures that we could use;

  •           Total line of code
  •           Line of duplicate code
  •           Unit test coverage
  •           Coding standard violation
  •           Program execution time
  •           Program load time
  •           Ratio of comment and code

Code Standard

MISRA-C is software development standards for C programming language develop by MISRA (Motor Industry Software Reliability Association). Many developers from embedded systems specification always refer to MISRA C Standard for the work that needs high reliability.
MISRA also has more users outside the original specification. They realized that in many areas of an automobile design, safety, portability and reliability is importance. They has evolved as a widely accepted model for best practices by leading developers in sectors including aerospace, telecom, medical devices, defense, railway and others.
The result was a set of “Guidelines for the use of the C language in Vehicle-Based Software” or “MISRA C”. The first published guideline comprises a 70-page document that describes a workable subset of C to avoid many of well-known problems. The MISRA C document contains 8 chapters and 2 appendices and was obviously written by experienced embedded programmers. Chapters 1 through 6 contain important information about the rationale for MISRA C and how to interpret the rules. These Chapters should be read prior to diving in to the actual rules, which are found in Chapter 7. MISRA C document is available at www.misra.org.uk for about $50.

No comments: