My Digital Garden

Tornhill Code Quality Advantage

Tornhill - Code Quality Advantage

Source

The Code Quality Advantage: How Empirical Data Shatters the Speed vs Quality Myth by Adam Tornhill

Overview

Core message - investing in quality gives fewer bugs, faster development of features and less uncertainty

Summary

0:53

  • Only 5% of dev time spent writing code
  • 70% spent in understanding the problem and the existing system
  • Minelli et al 2015

1:27

Industry costs of bad code and technical debt

  • 23-42% of work week spent dealing with consequences of tech debt and bad code
  • correlation between code smells and vulnerabilities
  • Besker, Martini, Bosch 2019 "Software Developer Productivity Loss Due to Technical Debt"
  • Stripe 2018 "The Developer Coefficient"
  • Sultana, Codabux, Williams 2020 - Examining the relationship of code and architectural smells with software vulnerabilities

4:53

Lehman Laws of Software Evolution:

  • Continuing Change - a system must be continually adapted or it becomes progressively less satisfactory
  • Increasing complexity - as a system evolves its complexity increases unless work is done to maintain or reduce it

6:05

Software decision in business often suffer from Hyperbolic discounting:

  • decision-making bias
  • prioritise short-term gains

How to counteract?

  • visualise tech debt and code complexity

8:34

Code quality is a very subjective concept so can't be measured with a simple number.

Identify and measure separate areas of complexity

Software Measurement : A Necessary Scientific Basis N.Fenton 1994

9:21

Codescene - aggregated measure based on 25 factors

17:27

Quantify the impact of code quality

Implementing a feature in healthy code is twice as fast on average but can take up to 9 times longer

23:29

Red code contains 15 times more defects

25:06

Happy developers are more productive

Key causes of unhappiness:

  • stuck in problem-solving
  • time pressure
  • work with bad code

See book Rethinking Productivity in Software Engineering

26:52

How to use the data?

  • situational awareness
  • counter hyperbolic discounting
  • business case for making improvements

29:08

Value creation as a combination of velocity and defect reduction:

  • Plot against code health is very s-shaped
  • Minor drop in quality from the top leads to very large drop in value delivery

31:27

Behavioural Code analysis - Software Design X-Rays 2018

33:15

Focus on technical debt in areas of the system that are frequently touched

35:15

Core message - investing in quality gives fewer bugs, faster development of features and less uncertainty

Look at "Your Code as Crime Scene Second Edition"

See also