SlideShare a Scribd company logo
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 1@CoverosGene
Agility. Security. Delivered.
Which Development Metrics
Should I Watch?
Gene Gotimer
@CoverosGene
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 2@CoverosGene
About Coveros
• Coveros builds security-critical applications using agile methods.
• Coveros Services
• Agile transformations
• Agile development and testing
• DevOps and continuous integration
• Application security analysis
• Agile & Security training
• Government qualifications
• DCAA approved rates and accounting
• TS facility clearance
Areas of Expertise
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 3@CoverosGene
Select Clients
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 4@CoverosGene
Why Metrics?
“Without data you’re just
another person with an
opinion.”
– W. Edwards Deming
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 5@CoverosGene
Metrics as Targets
“People with targets and
jobs dependent upon
meeting them will probably
meet the targets –
even if they have to destroy
the enterprise to do it.”
– W. Edwards Deming
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 6@CoverosGene
Goodhart’s Law
“When a measure becomes
a target, it ceases to be a
good measure.”
– Charles Goodhart
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 7@CoverosGene
Managing to Metrics
“Managers who don't know
how to measure what they want
settle for wanting what they can
measure.”
– Russell Ackoff
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 8@CoverosGene
What Makes a Good Metric?
S Specific
M Measurable
A Achievable
R Relevant
T Timely
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 9@CoverosGene
How Many Metrics?
to
at least to actively pay attention to
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 10@CoverosGene
SonarQube
• Software quality dashboard
• Gives visibility into results of
• Unit tests
• Static analysis
• Duplicate code
• Quality problems
SMARTSM T
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 11@CoverosGene
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 12@CoverosGene
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 13@CoverosGene
SMARTA
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 14@CoverosGene
Which metrics?
Get on with it already…
SMARTR
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 15@CoverosGene
WTFs per Minute
SMARTXXX
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 16@CoverosGene
Lines of Code
• Used for estimating costs, for example COCOMO
• Measures developer productivity
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 17@CoverosGene
Lines of Code
“Measuring programming progress
by lines of code is like
measuring aircraft building
progress by weight.”
– Bill Gates
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 18@CoverosGene
Lines of Code
• Used for estimating costs, for example COCOMO
• Measures Doesn’t measure developer productivity
• Rewards build-it-yourself instead of using existing solutions
• What if I’m deleting code?
• Using lambdas?
SMARTX
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 19@CoverosGene
Spell It All Out
1 boolean boolResult = false;
2 if (hashResult > 0)
3 boolResult = true;
4 else
5 boolResult = false;
6 assertEquals("HashCode returned was not returned",
true, boolResult);
as opposed to
1 assertTrue("HashCode should be a positive integer",
hashResult > 0);
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 20@CoverosGene
Number of Bugs Fixed
• Fixing bugs is good
• When does it become a bug?
• What if you write bug-free code to start with?
SMART/ / X
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 21@CoverosGene
Code Complexity
public List<Double> getAngles() {
return Collections.unmodifiableList(angles);
}
public double getPerimeter() {
double perimeter = 0.0d;
for (double length : lengths) {
perimeter += length;
}
return perimeter;
}
1.0
2.0
SMARTRTAMS
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 22@CoverosGene
Number of Unit Tests
• Unit tests document the developer’s intent
• We need enough
• One test per path
• Can use code complexity as guide
• But don’t usually have it per method
• Leads to guessing
SMARTXX
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 23@CoverosGene
Testivus on Code Coverage
One morning, a programmer asked the master
“I am ready to write some unit tests.
What code coverage should I aim for?”
The master replied,
“Don’t worry about coverage, just write some good tests.”
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 24@CoverosGene
Testivus on Code Coverage
Later, a second programmer asked the master the same question.
The master pointed to a pot of boiling water and asked
“How many grains of rice should I put in that pot?”
The programmer replied,
“How can I possibly tell you? It depends on how many people you
need to feed, how hungry they are, what other food you are serving,
how much rice you have available, and so on.”
“Exactly,” replied the master.
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 25@CoverosGene
Testivus on Code Coverage
Towards the end of the day, a third programmer asked
the same question about code coverage.
The master said sternly
“Eighty percent and no less!”
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 26@CoverosGene
Testivus on Code Coverage
The apprentice asked the master why he gave the programmers
three different answers to the same question.
The master began to answer.
“The first programmer is new and just getting started with testing.
Right now he has a lot of code and no tests.
He has a long way to go; focusing on code coverage at this time would
be depressing and quite useless.
He’s better off just getting used to writing and running some tests.
He can worry about coverage later.”
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 27@CoverosGene
Testivus on Code Coverage
“The second programmer, on the other hand, is quite
experienced both at programming and testing.
When I replied by asking her how many grains of rice
I should put in a pot, I helped her realize that the amount of testing
necessary depends on a number of factors, and she knows those
factors better than I do – it’s her code after all.
There is no single, simple, answer, and she’s smart enough to handle
the truth and work with that.”
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 28@CoverosGene
Testivus on Code Coverage
“I see,” said the apprentice.
“But if there is no single simple answer, why did you tell
the third programmer Eighty percent and no less?”
The master laughed.
“The third programmer wants only simple answers –
even when there are no simple answers…
and then does not follow them anyway.”
Alberto Savoia
http://www.artima.com/forums/flat.jsp?forum=106&thread=204677
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 29@CoverosGene
Code Coverage
• Measures code executed when unit tests run
• NOT amount of code tested
• Good tool to find untested code
• Not covered == not tested
• Covered == possibly tested
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 30@CoverosGene
Test All The Things, Literally
for (Method method : object.getClass().getMethods()) {
if (method.getName.startsWith("set")) {
if (method.getParameterTypes().length > 0) {
Class paramClass = method.getParameterTypes()[0];
if (paramClass.getName.equals("java.lang.String")) {
method.invoke(object, "JUNIT TEST");
} else if (paramClass.getName.equals("java.lang.Object")) {
method.invoke(object, new Object());
} else if (paramClass.getName.equals("java.util.Date")) {
method.invoke(object, new java.util.Date());
} else if (paramClass.getName.equals("java.math.BigDecimal")) {
method.invoke(object, new BigDecimal(100));
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 31@CoverosGene
Code Coverage
• Measures code executed when unit tests run
• NOT amount of code tested
• Good tool to find untested code
• Not covered == not tested
• Covered == possibly tested
SMARTX
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 32@CoverosGene
Mutation Testing
• Reruns unit tests against modified versions of your code
• If tests still pass, code isn’t tested
• Tests quality of tests
public int foo(int i) {
i--;
return i;
}
public int foo(int i) {
i++;
return i;
}
SMARTRTAMS
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 33@CoverosGene
Number of Failing Unit Tests
• Unit tests document the developer’s intent
• What is an acceptable number of failing tests?
SMARTRTAMS
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 34@CoverosGene
Legacy Code
• Greenfield code = your mess
• Legacy code = someone else’s mess that
you have inherited
• Consider applying
• Quality gates to new code
• Watch trends on existing code
• As you modify existing code
• Leave the code cleaner than it was
when you found it
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 35@CoverosGene
Technical Debt
“You can have things early in a development and
gain experience and that’s a good strategy, as
long as you have a plan to pay it back.
If you don’t pay it back then you
get a compounding – learning that
you’ve consciously avoided comes
back to hurt you. ”
– Ward Cunningham
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 36@CoverosGene
Qualities of Good Code
Cohesive
non-Redundant
Encapsulated
Assertive
Testable
Explicit
David Bernstein
@ToBeAgile
https://tobeagile.com/
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 37@CoverosGene
Technical Debt
• Bugs and potential bugs
• Coding standards violations
• Duplications
• Lack of unit tests
• Bad distribution of complexity
• Not enough or too many comments
• Spaghetti design
← redundant
← not testable
← not cohesive
← not cohesive
← not explicit
not assertive
not encapsulated
SonarQube measures technical debt as:
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 38@CoverosGene
Technical Debt
• Bugs and potential bugs
• Coding standards violations
• Duplications
• Lack of unit tests
• Bad distribution of complexity
• Not enough or too many comments
• Spaghetti design
SonarQube measures technical debt as:
SMARTRTAMS
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 39@CoverosGene
Normalization of Deviance
“The gradual process through
which unacceptable practice or
standards become acceptable.
As the deviant behavior is
repeated without catastrophic
results, it becomes the social
norm for the organization.”
– Diane Vaughn
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 40@CoverosGene
Continuous Integration
• The act of frequently integrating different developer’s
code, building, and testing each commit to find any
problems quickly
• The goal is that software is always
in a working state
• The developer codes, commits, and then
waits for the automated build, unit tests,
and static analysis to run
• If anything fails, the developer is on hand
to fix it before anyone else is disrupted
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 41@CoverosGene
Build Time
• Time to complete cycle
• Automated build
• Unit tests
• Static analysis
• CI cycle should be no more than 10 minutes
• Keep it short to encourage more frequent exercise
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 42@CoverosGene
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 43@CoverosGene
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 44@CoverosGene
Build Time
• Time to complete cycle
• Automated build
• Unit tests
• Static analysis
• CI cycle should be no more than 10 minutes
• Keep it short to encourage more frequent exercise
SMARTRTAMS
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 45@CoverosGene
Escaped Defects
• Defects that are found after “done”
• Could be
• Bugs
• Functional defects
• Security issues
• Usability problems
• Unacceptable performance
• What is an acceptable number of escaped defects?
SMARTX
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 46@CoverosGene
Escaped Defects
• Zero isn’t realistic
• Zero may not be desirable
• Watch the trend
• Hold even or decrease
• Adjust process and definition of done
• As you improve
• In order to improve
• Best measure of team quality
SMARTRTAMS
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 47@CoverosGene
Retrospectives
• Regularly reevaluate
• Metrics
• Are they still relevant?
• Are we missing metrics we should be watching?
• Quality gates
• Are they achievable?
• Could we be stricter? Would that add value?
• Use escaped defects as a guide
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 48@CoverosGene
Wrap Up
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 49@CoverosGene
#Coveros5
• Metrics should be SMART
Specific, Measurable, Achievable, Relevant, and Timely
• Use metrics to set quality gates
If you can't commit to the metric, don't bother tracking it
• Code coverage doesn't tell the whole story
use mutation testing too
• Trends are usually more important than absolute values
except for 0 failing unit tests
• Escaped defects is the most important metric
no matter where your boundary of “escape” is
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 50@CoverosGene
Development Metrics
Good
Escaped defects
0 failing unit tests
Technical debt
Mutation testing coverage
Build time
BAD
Lines of code
Number of bugs fixed
Number of unit tests
Code coverage (alone)
© COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 51@CoverosGene
Questions?
Gene Gotimer
gene.gotimer@coveros.com
@CoverosGene
Come see my Lightning Talk
Thursday at 3:45pm in Wekiwa 3&4 for
Creative Solutions to Already Solved Problems

More Related Content

PPTX
DevOps State of the Union 2015
PDF
Microservices, Events, and Breaking the Data Monolith with Kafka
PPTX
2019 12 Clojure/conj: Love Letter To Clojure, and A Datomic Experience Report
PPTX
GitHub Universe: 2019: Exemplars, Laggards, and Hoarders A Data-driven Look a...
PPTX
What if you could eliminate the hidden costs of development?
PDF
Continuous Delivery e-book
PPTX
The Unicorn Project and The Five Ideals (older: see notes for newer version)
PPTX
How Can We Better Sell DevOps?
DevOps State of the Union 2015
Microservices, Events, and Breaking the Data Monolith with Kafka
2019 12 Clojure/conj: Love Letter To Clojure, and A Datomic Experience Report
GitHub Universe: 2019: Exemplars, Laggards, and Hoarders A Data-driven Look a...
What if you could eliminate the hidden costs of development?
Continuous Delivery e-book
The Unicorn Project and The Five Ideals (older: see notes for newer version)
How Can We Better Sell DevOps?

What's hot (20)

PPTX
Leading A DevOps Transformation: Lessons Learned
PDF
Devops: A History
PPTX
The Devops Handbook
PPTX
Lies Enterprise Architects Tell - Data Day Texas 2018 Keynote
PPTX
The Unicorn Project and The Five Ideals (Updated Dec 2019)
PPTX
Keeping The Auditor Away: DevOps Audit Compliance Case Studies
PPTX
KEYNOTE | WHAT'S COMING IN THE NEXT 10 YEARS OF DEVOPS? // ELLEN CHISA, bolds...
PPTX
DevOpsGuys - How to get started with DevOps - Redgate Webinar April 2017
PDF
Application Security Epistemology in a Continuous Delivery World
PDF
DevOps Beyond the Buzzwords: What it Means to Embrace the DevOps Lifestyle
PPTX
Top Lessons Learned From The DevOps Handbook
PDF
Tutorial on Using Amazon Mechanical Turk (MTurk) for HCI Research
PPTX
2014 State Of DevOps Findings! Velocity Conference
PPTX
DevOps 101
PPTX
2011 06 15 velocity conf from visible ops to dev ops final
PDF
The History of DevOps (and what you need to do about it)
PPTX
How We Do DevOps at Walmart: OneOps OSS Application Lifecycle Management Plat...
PPTX
How Do We Better Sell DevOps? - PuppetConf 2013
PPTX
Why Everyone Needs DevOps Now: 15 Year Study Of High Performing Technology Orgs
PPTX
DevOps: Who Will Create $2.6 Trillion In Business Value Per Year?
Leading A DevOps Transformation: Lessons Learned
Devops: A History
The Devops Handbook
Lies Enterprise Architects Tell - Data Day Texas 2018 Keynote
The Unicorn Project and The Five Ideals (Updated Dec 2019)
Keeping The Auditor Away: DevOps Audit Compliance Case Studies
KEYNOTE | WHAT'S COMING IN THE NEXT 10 YEARS OF DEVOPS? // ELLEN CHISA, bolds...
DevOpsGuys - How to get started with DevOps - Redgate Webinar April 2017
Application Security Epistemology in a Continuous Delivery World
DevOps Beyond the Buzzwords: What it Means to Embrace the DevOps Lifestyle
Top Lessons Learned From The DevOps Handbook
Tutorial on Using Amazon Mechanical Turk (MTurk) for HCI Research
2014 State Of DevOps Findings! Velocity Conference
DevOps 101
2011 06 15 velocity conf from visible ops to dev ops final
The History of DevOps (and what you need to do about it)
How We Do DevOps at Walmart: OneOps OSS Application Lifecycle Management Plat...
How Do We Better Sell DevOps? - PuppetConf 2013
Why Everyone Needs DevOps Now: 15 Year Study Of High Performing Technology Orgs
DevOps: Who Will Create $2.6 Trillion In Business Value Per Year?
Ad

Similar to Which Development Metrics Should I Watch? (20)

PDF
A Better, Faster Pipeline for Software Delivery
PDF
DevOpsDays Baltimore 2018: A Definition of Done for DevSecOps - Gene Gotimer
PPTX
DevOps: Security's Big Opportunity
PDF
Tests Your Pipeline Might Be Missing
PPTX
Code Coverage
PDF
Shifting Security Left - The Innovation of DevSecOps - AgileDC
PPTX
Shifting security all day dev ops
PPTX
A Definition of Done for DevSecOps
PPTX
A better faster pipeline for software delivery, even in the government
PDF
Get to Green: How to Safely Refactor Legacy Code
PPTX
Add Security Testing Tools to Your Delivery Pipeline
PPTX
Shifting Security Left from the Lean+Agile 2019 Conference
PDF
DevOps for Leadership
PPTX
How to achieve security, reliability, and productivity in less time
PDF
DevSecCon Singapore 2018 - Maginot Line – 6 Common AppSec Anti-Patterns Preve...
PPTX
Journey to Establish an Open Source Policy in a Fortune 20 Health Care Company
PDF
Top Agile Metrics
PDF
BSides Leeds - Performing JavaScript Static Analysis
PPTX
Software Quality
PDF
Jennifer Scandariato: Transform Your Team from QA to Test Engineering
A Better, Faster Pipeline for Software Delivery
DevOpsDays Baltimore 2018: A Definition of Done for DevSecOps - Gene Gotimer
DevOps: Security's Big Opportunity
Tests Your Pipeline Might Be Missing
Code Coverage
Shifting Security Left - The Innovation of DevSecOps - AgileDC
Shifting security all day dev ops
A Definition of Done for DevSecOps
A better faster pipeline for software delivery, even in the government
Get to Green: How to Safely Refactor Legacy Code
Add Security Testing Tools to Your Delivery Pipeline
Shifting Security Left from the Lean+Agile 2019 Conference
DevOps for Leadership
How to achieve security, reliability, and productivity in less time
DevSecCon Singapore 2018 - Maginot Line – 6 Common AppSec Anti-Patterns Preve...
Journey to Establish an Open Source Policy in a Fortune 20 Health Care Company
Top Agile Metrics
BSides Leeds - Performing JavaScript Static Analysis
Software Quality
Jennifer Scandariato: Transform Your Team from QA to Test Engineering
Ad

More from Gene Gotimer (20)

PDF
Let's Do Bad Things to Unsecured Containers
PDF
Clean Your Cloud with Cloud Custodian slides
PDF
A Hands-on Intro to Containers- Nebraska.Code()
PDF
A Developer's Guide to Kubernetes Security
PDF
Fixing Git Catastrophes - Nebraska.Code()
PDF
KCDC- Keeping Secrets Out of Your Pipeline
PDF
How Fast Is My App? Performance Testing 101
PDF
A Developer’s Guide to Kubernetes Security
PDF
How I Learned to Stop Worrying and Love Legacy Code
PDF
Ten Ways To Doom Your DevOps
PPTX
Keeping Your Kubernetes Cluster Secure
PDF
Keeping your Kubernetes Cluster Secure
PDF
Explain DevOps To Me Like I’m Five: DevOps for Managers
PPTX
Keeping your Kubernetes Cluster Secure
PPTX
Creative Solutions to Already Solved Problems II
PPTX
Creative Solutions to Already Solved Problems
PDF
Pyramid Discussion: DevOps Adoption in Large, Slow Organizations
PDF
Building the Pipeline of My Dreams
PPTX
Open Source Security Tools for the Pipeline
PPTX
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper
Let's Do Bad Things to Unsecured Containers
Clean Your Cloud with Cloud Custodian slides
A Hands-on Intro to Containers- Nebraska.Code()
A Developer's Guide to Kubernetes Security
Fixing Git Catastrophes - Nebraska.Code()
KCDC- Keeping Secrets Out of Your Pipeline
How Fast Is My App? Performance Testing 101
A Developer’s Guide to Kubernetes Security
How I Learned to Stop Worrying and Love Legacy Code
Ten Ways To Doom Your DevOps
Keeping Your Kubernetes Cluster Secure
Keeping your Kubernetes Cluster Secure
Explain DevOps To Me Like I’m Five: DevOps for Managers
Keeping your Kubernetes Cluster Secure
Creative Solutions to Already Solved Problems II
Creative Solutions to Already Solved Problems
Pyramid Discussion: DevOps Adoption in Large, Slow Organizations
Building the Pipeline of My Dreams
Open Source Security Tools for the Pipeline
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper

Recently uploaded (20)

PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
assetexplorer- product-overview - presentation
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Designing Intelligence for the Shop Floor.pdf
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
wealthsignaloriginal-com-DS-text-... (1).pdf
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Design an Analysis of Algorithms II-SECS-1021-03
Adobe Illustrator 28.6 Crack My Vision of Vector Design
L1 - Introduction to python Backend.pptx
Oracle Fusion HCM Cloud Demo for Beginners
Internet Downloader Manager (IDM) Crack 6.42 Build 41
assetexplorer- product-overview - presentation
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Designing Intelligence for the Shop Floor.pdf
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Complete Guide to Website Development in Malaysia for SMEs
Odoo Companies in India – Driving Business Transformation.pdf
Digital Systems & Binary Numbers (comprehensive )
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx

Which Development Metrics Should I Watch?

  • 1. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 1@CoverosGene Agility. Security. Delivered. Which Development Metrics Should I Watch? Gene Gotimer @CoverosGene
  • 2. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 2@CoverosGene About Coveros • Coveros builds security-critical applications using agile methods. • Coveros Services • Agile transformations • Agile development and testing • DevOps and continuous integration • Application security analysis • Agile & Security training • Government qualifications • DCAA approved rates and accounting • TS facility clearance Areas of Expertise
  • 3. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 3@CoverosGene Select Clients
  • 4. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 4@CoverosGene Why Metrics? “Without data you’re just another person with an opinion.” – W. Edwards Deming
  • 5. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 5@CoverosGene Metrics as Targets “People with targets and jobs dependent upon meeting them will probably meet the targets – even if they have to destroy the enterprise to do it.” – W. Edwards Deming
  • 6. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 6@CoverosGene Goodhart’s Law “When a measure becomes a target, it ceases to be a good measure.” – Charles Goodhart
  • 7. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 7@CoverosGene Managing to Metrics “Managers who don't know how to measure what they want settle for wanting what they can measure.” – Russell Ackoff
  • 8. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 8@CoverosGene What Makes a Good Metric? S Specific M Measurable A Achievable R Relevant T Timely
  • 9. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 9@CoverosGene How Many Metrics? to at least to actively pay attention to
  • 10. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 10@CoverosGene SonarQube • Software quality dashboard • Gives visibility into results of • Unit tests • Static analysis • Duplicate code • Quality problems SMARTSM T
  • 11. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 11@CoverosGene
  • 12. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 12@CoverosGene
  • 13. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 13@CoverosGene SMARTA
  • 14. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 14@CoverosGene Which metrics? Get on with it already… SMARTR
  • 15. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 15@CoverosGene WTFs per Minute SMARTXXX
  • 16. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 16@CoverosGene Lines of Code • Used for estimating costs, for example COCOMO • Measures developer productivity
  • 17. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 17@CoverosGene Lines of Code “Measuring programming progress by lines of code is like measuring aircraft building progress by weight.” – Bill Gates
  • 18. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 18@CoverosGene Lines of Code • Used for estimating costs, for example COCOMO • Measures Doesn’t measure developer productivity • Rewards build-it-yourself instead of using existing solutions • What if I’m deleting code? • Using lambdas? SMARTX
  • 19. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 19@CoverosGene Spell It All Out 1 boolean boolResult = false; 2 if (hashResult > 0) 3 boolResult = true; 4 else 5 boolResult = false; 6 assertEquals("HashCode returned was not returned", true, boolResult); as opposed to 1 assertTrue("HashCode should be a positive integer", hashResult > 0);
  • 20. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 20@CoverosGene Number of Bugs Fixed • Fixing bugs is good • When does it become a bug? • What if you write bug-free code to start with? SMART/ / X
  • 21. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 21@CoverosGene Code Complexity public List<Double> getAngles() { return Collections.unmodifiableList(angles); } public double getPerimeter() { double perimeter = 0.0d; for (double length : lengths) { perimeter += length; } return perimeter; } 1.0 2.0 SMARTRTAMS
  • 22. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 22@CoverosGene Number of Unit Tests • Unit tests document the developer’s intent • We need enough • One test per path • Can use code complexity as guide • But don’t usually have it per method • Leads to guessing SMARTXX
  • 23. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 23@CoverosGene Testivus on Code Coverage One morning, a programmer asked the master “I am ready to write some unit tests. What code coverage should I aim for?” The master replied, “Don’t worry about coverage, just write some good tests.”
  • 24. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 24@CoverosGene Testivus on Code Coverage Later, a second programmer asked the master the same question. The master pointed to a pot of boiling water and asked “How many grains of rice should I put in that pot?” The programmer replied, “How can I possibly tell you? It depends on how many people you need to feed, how hungry they are, what other food you are serving, how much rice you have available, and so on.” “Exactly,” replied the master.
  • 25. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 25@CoverosGene Testivus on Code Coverage Towards the end of the day, a third programmer asked the same question about code coverage. The master said sternly “Eighty percent and no less!”
  • 26. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 26@CoverosGene Testivus on Code Coverage The apprentice asked the master why he gave the programmers three different answers to the same question. The master began to answer. “The first programmer is new and just getting started with testing. Right now he has a lot of code and no tests. He has a long way to go; focusing on code coverage at this time would be depressing and quite useless. He’s better off just getting used to writing and running some tests. He can worry about coverage later.”
  • 27. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 27@CoverosGene Testivus on Code Coverage “The second programmer, on the other hand, is quite experienced both at programming and testing. When I replied by asking her how many grains of rice I should put in a pot, I helped her realize that the amount of testing necessary depends on a number of factors, and she knows those factors better than I do – it’s her code after all. There is no single, simple, answer, and she’s smart enough to handle the truth and work with that.”
  • 28. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 28@CoverosGene Testivus on Code Coverage “I see,” said the apprentice. “But if there is no single simple answer, why did you tell the third programmer Eighty percent and no less?” The master laughed. “The third programmer wants only simple answers – even when there are no simple answers… and then does not follow them anyway.” Alberto Savoia http://www.artima.com/forums/flat.jsp?forum=106&thread=204677
  • 29. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 29@CoverosGene Code Coverage • Measures code executed when unit tests run • NOT amount of code tested • Good tool to find untested code • Not covered == not tested • Covered == possibly tested
  • 30. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 30@CoverosGene Test All The Things, Literally for (Method method : object.getClass().getMethods()) { if (method.getName.startsWith("set")) { if (method.getParameterTypes().length > 0) { Class paramClass = method.getParameterTypes()[0]; if (paramClass.getName.equals("java.lang.String")) { method.invoke(object, "JUNIT TEST"); } else if (paramClass.getName.equals("java.lang.Object")) { method.invoke(object, new Object()); } else if (paramClass.getName.equals("java.util.Date")) { method.invoke(object, new java.util.Date()); } else if (paramClass.getName.equals("java.math.BigDecimal")) { method.invoke(object, new BigDecimal(100));
  • 31. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 31@CoverosGene Code Coverage • Measures code executed when unit tests run • NOT amount of code tested • Good tool to find untested code • Not covered == not tested • Covered == possibly tested SMARTX
  • 32. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 32@CoverosGene Mutation Testing • Reruns unit tests against modified versions of your code • If tests still pass, code isn’t tested • Tests quality of tests public int foo(int i) { i--; return i; } public int foo(int i) { i++; return i; } SMARTRTAMS
  • 33. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 33@CoverosGene Number of Failing Unit Tests • Unit tests document the developer’s intent • What is an acceptable number of failing tests? SMARTRTAMS
  • 34. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 34@CoverosGene Legacy Code • Greenfield code = your mess • Legacy code = someone else’s mess that you have inherited • Consider applying • Quality gates to new code • Watch trends on existing code • As you modify existing code • Leave the code cleaner than it was when you found it
  • 35. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 35@CoverosGene Technical Debt “You can have things early in a development and gain experience and that’s a good strategy, as long as you have a plan to pay it back. If you don’t pay it back then you get a compounding – learning that you’ve consciously avoided comes back to hurt you. ” – Ward Cunningham
  • 36. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 36@CoverosGene Qualities of Good Code Cohesive non-Redundant Encapsulated Assertive Testable Explicit David Bernstein @ToBeAgile https://tobeagile.com/
  • 37. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 37@CoverosGene Technical Debt • Bugs and potential bugs • Coding standards violations • Duplications • Lack of unit tests • Bad distribution of complexity • Not enough or too many comments • Spaghetti design ← redundant ← not testable ← not cohesive ← not cohesive ← not explicit not assertive not encapsulated SonarQube measures technical debt as:
  • 38. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 38@CoverosGene Technical Debt • Bugs and potential bugs • Coding standards violations • Duplications • Lack of unit tests • Bad distribution of complexity • Not enough or too many comments • Spaghetti design SonarQube measures technical debt as: SMARTRTAMS
  • 39. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 39@CoverosGene Normalization of Deviance “The gradual process through which unacceptable practice or standards become acceptable. As the deviant behavior is repeated without catastrophic results, it becomes the social norm for the organization.” – Diane Vaughn
  • 40. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 40@CoverosGene Continuous Integration • The act of frequently integrating different developer’s code, building, and testing each commit to find any problems quickly • The goal is that software is always in a working state • The developer codes, commits, and then waits for the automated build, unit tests, and static analysis to run • If anything fails, the developer is on hand to fix it before anyone else is disrupted
  • 41. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 41@CoverosGene Build Time • Time to complete cycle • Automated build • Unit tests • Static analysis • CI cycle should be no more than 10 minutes • Keep it short to encourage more frequent exercise
  • 42. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 42@CoverosGene
  • 43. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 43@CoverosGene
  • 44. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 44@CoverosGene Build Time • Time to complete cycle • Automated build • Unit tests • Static analysis • CI cycle should be no more than 10 minutes • Keep it short to encourage more frequent exercise SMARTRTAMS
  • 45. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 45@CoverosGene Escaped Defects • Defects that are found after “done” • Could be • Bugs • Functional defects • Security issues • Usability problems • Unacceptable performance • What is an acceptable number of escaped defects? SMARTX
  • 46. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 46@CoverosGene Escaped Defects • Zero isn’t realistic • Zero may not be desirable • Watch the trend • Hold even or decrease • Adjust process and definition of done • As you improve • In order to improve • Best measure of team quality SMARTRTAMS
  • 47. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 47@CoverosGene Retrospectives • Regularly reevaluate • Metrics • Are they still relevant? • Are we missing metrics we should be watching? • Quality gates • Are they achievable? • Could we be stricter? Would that add value? • Use escaped defects as a guide
  • 48. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 48@CoverosGene Wrap Up
  • 49. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 49@CoverosGene #Coveros5 • Metrics should be SMART Specific, Measurable, Achievable, Relevant, and Timely • Use metrics to set quality gates If you can't commit to the metric, don't bother tracking it • Code coverage doesn't tell the whole story use mutation testing too • Trends are usually more important than absolute values except for 0 failing unit tests • Escaped defects is the most important metric no matter where your boundary of “escape” is
  • 50. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 50@CoverosGene Development Metrics Good Escaped defects 0 failing unit tests Technical debt Mutation testing coverage Build time BAD Lines of code Number of bugs fixed Number of unit tests Code coverage (alone)
  • 51. © COPYRIGHT 2017 COVEROS, INC. ALL RIGHTS RESERVED. 51@CoverosGene Questions? Gene Gotimer gene.gotimer@coveros.com @CoverosGene Come see my Lightning Talk Thursday at 3:45pm in Wekiwa 3&4 for Creative Solutions to Already Solved Problems