Good metrics for quality in code

As more and more code goes to production it is important to establish right set of metrics for measuring quality in code. With excerpts from Mesauring Software Quality: A Guide to Employing Metrics in Software Development Processese Copyright © 2020 by IT Revolution





Quality covers lots of aspects such as - reliability, maintainability, scalability, agility (related to software architecture monolithic of microservices and serviceability

State of DevOps Report published by DORA says that high-performing organizations have lower lead times and increased frequency of software deployments

What are are two leading indicators categories for measuring quality?

  1. Measure against the code: for e.g. static code analysis tools, usage of feature flags etc.

  2. Measure against development and operations processes: For e.g. different types of testing which happen, time taken in integration testing, progressive delivery such as A/B Testing, Canary Deployment

What are key elements when measuring software quality?

  1. Run Experiments

  2. Establish Targets

  3. Establish Guardrails

  4. Update Goals and Metrics

  5. Continuous focus and improvement

  6. User Satisfaction and Experience

What are leading indicators for category 1 - measure against the code?


Code can be measured in a variety of ways - bugs, compute, structural complexity, dependencies, crashes, compute test coverage, responsiveness

  1. Testing: Three most common metrics are: static-coverage metrics, performance information, failure rates

  2. Need to ensure that test coverage is done right and new tests are capturing new bugs

  3. Some of the issues in test-coverage are: measuring the wrong things, wrong approach, wrong type of testing, not maintaining testing

  4. Code complexity metrics check if code is using deeply nested control-flow constructs

  5. Need to have architecture level metrics - whether recommended coding patterns such as use of feature flags or dependency injection. Is codebase is realizing full benefits enabled by its chosen architecture

  6. Also check brittleness of code using say chaos engineering


What are leading indicators for category 2 - measure against the process?


Measuring the process or parts of the process can help in improving the quality

  1. How long testing is taking to provide the feedback?

  2. What percentage of tests are automated tests?

  3. What different types of testing is used and what is the fault tolerance of different systems?

  4. How customer expectation testing is being done?

  5. Is code review done as a part of merge and pull requests?

  6. Are overall measurements such as SLAs or adherence to Agile mis-used?


Ref: Mesauring Software Quality: A Guide to Employing Metrics in Software Development Processese Copyright © 2020 by IT Revolution


8 views0 comments

Recent Posts

See All