This document discusses using equations to understand software development. It covers topics like:
- How complexity increases quadratically with connections between code elements
- How to reduce complexity through design that decreases dependencies
- Applying concepts from traffic flow theory like maximizing flow by balancing speed and density of vehicles
- How continuous small improvements can significantly improve or degrade performance over time through exponential growth/decay
- Different equations that can provide insight into software like those relating to entropy, Bayesian inference, and the "software engineering equation".
31. How does this apply to software?
β’ πΉπππ€ = πππππ. π·πππ ππ‘π¦
β’ Velocity = Throughput = Flow (avg # features delivered per week)
β’ WIP = Density (avg # features started but not completed)
β’ πΆπ¦πππ π‘πππ =
1
πππππ
(avg time it takes to complete a feature)
β’ πβππ’πβππ’π‘ =
ππΌπ
πΆπ¦πππ ππππ
(aka Littleβs Law)
π½πππππππ =
π¨ππ ππππππππ ππ ππππππππ
π¨ππ ππππ ππ ππππππππ π πππππππ
36. β’ r = -1% per week (decay rate)
β’ t = 104 weeks/2 years (time in weeks)
This gives us
β’ 34% of original
β’ Degraded 66% over 2 years!
Is this how technical debt behaves?
π ππ
37. β’ r = 1% per week (improvement rate)
β’ t = 104 weeks/2 years (time in weeks)
This gives us
β’ 294% improvement over 2 years!
π°ππππππππππ = π ππ
Β Big O notation: the algorithm hasΒ order of n2Β time complexity
Code change complexity/speed
The way we work determines the difficulty in changes over time
Donβt just optimise for short term
Common trap: the way we work slows us down in the long term
O(n2) - difficulty in building new feature safely if no test - O(logn) - the speed you can add new features if you donβt test or refactor. O(n) - can it scale? - apply to process, code, structure - SELF TEST GIVES O(n) - not test gives O(n2)
We donβt have time to write tests.
We need to get this out quickly! We can worry about quality later.
Inspired by (but a different take on it):
https://michaelfeathers.silvrback.com/code-change-complexity
Credit : www.improvetraffic.org
Worldβs largest traffic jam in Chine β 100km, 11 days
Fundamental Relations of Traffic Flow
https://www.civil.iitb.ac.in/tvm/1111_nptel/512_FundRel/plain/plain.html
https://en.wikipedia.org/wiki/Fundamental_diagram_of_traffic_flow
When density goes up β speed goes down
When density goes up β speed goes down
Also known as little's law
Are we appreciating or depreciating
Letβs start improving
Common trap: we are too busy to improve
https://www.youtube.com/watch?v=o5QRdHH8aeQ
htps:/t/en.wikipedia.org/wiki/Compound_interest#Mathematics_of_interest_rates