0:03
and welcome everyone to this session on
0:05
and welcome everyone to this session on
0:05
and welcome everyone to this session on the code quality Advantage so the reason
0:08
the code quality Advantage so the reason
0:08
the code quality Advantage so the reason I want to do this session is because
0:10
I want to do this session is because
0:10
I want to do this session is because I've been spending 30 years in the
0:13
I've been spending 30 years in the
0:13
I've been spending 30 years in the software industry been writing a lot of
0:15
software industry been writing a lot of
0:15
software industry been writing a lot of code work with lots of different
0:16
code work with lots of different
0:16
code work with lots of different companies and
0:17
companies and stakeholders and one common theme that I
0:20
stakeholders and one common theme that I
0:20
stakeholders and one common theme that I noticed is that people during these 30
0:22
noticed is that people during these 30
0:22
noticed is that people during these 30 years have been telling me no no we
0:26
years have been telling me no no we
0:26
years have been telling me no no we don't have time to refactor no we don't
0:28
don't have time to refactor no we don't
0:28
don't have time to refactor no we don't have time to automate tests no we don't
0:30
have time to automate tests no we don't
0:30
have time to automate tests no we don't have time to rethink our architecture so
0:34
have time to rethink our architecture so
0:34
have time to rethink our architecture so we have this misconception in the
0:36
we have this misconception in the
0:36
we have this misconception in the industry that there is some kind of
0:37
industry that there is some kind of
0:37
industry that there is some kind of tradeoff between speed and quality right
0:41
tradeoff between speed and quality right
0:41
tradeoff between speed and quality right that we need to sacrifice one to get the
0:43
that we need to sacrifice one to get the
0:43
that we need to sacrifice one to get the other and what I want to show you today
0:45
other and what I want to show you today
0:45
other and what I want to show you today is that this is a myth there is no such
0:47
is that this is a myth there is no such
0:47
is that this is a myth there is no such tradeoff in fact we need both to go
0:50
tradeoff in fact we need both to go
0:50
tradeoff in fact we need both to go really really quick and we're going to
0:52
really really quick and we're going to
0:53
really really quick and we're going to cover a lot of ground over the next 40
0:55
cover a lot of ground over the next 40
0:55
cover a lot of ground over the next 40 minutes and I like to approach this from
0:58
minutes and I like to approach this from
0:58
minutes and I like to approach this from the perspective of technical that
1:01
the perspective of technical that
1:01
the perspective of technical that so technical left is something that you
1:03
so technical left is something that you
1:04
so technical left is something that you probably are all familiar with you have
1:05
probably are all familiar with you have
1:05
probably are all familiar with you have probably heard the term before what I
1:08
probably heard the term before what I
1:08
probably heard the term before what I think is so interesting is that
1:09
think is so interesting is that
1:10
think is so interesting is that technical depth has multiple root causes
1:12
technical depth has multiple root causes
1:12
technical depth has multiple root causes we take it on for multiple reasons and
1:15
we take it on for multiple reasons and
1:15
we take it on for multiple reasons and the typical case is that we try to
1:19
the typical case is that we try to
1:19
the typical case is that we try to sacrifice quality in order to move a
1:21
sacrifice quality in order to move a
1:21
sacrifice quality in order to move a little bit faster with a feature right
1:24
little bit faster with a feature right
1:24
little bit faster with a feature right so we cut some Corners we get a feature
1:26
so we cut some Corners we get a feature
1:26
so we cut some Corners we get a feature out in production and everyone is happy
1:28
out in production and everyone is happy
1:28
out in production and everyone is happy in the short term
1:30
in the short term however there are other reasons too that
1:32
however there are other reasons too that
1:32
however there are other reasons too that we take on technical that and one of the
1:34
we take on technical that and one of the
1:35
we take on technical that and one of the reasons might be that we actually do the
1:37
reasons might be that we actually do the
1:37
reasons might be that we actually do the right thing we design our software
1:39
right thing we design our software
1:39
right thing we design our software properly but then our understanding of
1:42
properly but then our understanding of
1:42
properly but then our understanding of the problem we're trying to solve
1:43
the problem we're trying to solve
1:43
the problem we're trying to solve changes perhaps due to user feedback of
1:46
changes perhaps due to user feedback of
1:46
changes perhaps due to user feedback of our own experience and this is what we
1:48
our own experience and this is what we
1:48
our own experience and this is what we typically call requirements change
1:51
typically call requirements change
1:51
typically call requirements change right and now our design is no longer
1:53
right and now our design is no longer
1:53
right and now our design is no longer good fit or maybe and of course highly
1:57
good fit or maybe and of course highly
1:57
good fit or maybe and of course highly hypothetical in your case maybe our
1:59
hypothetical in your case maybe our
1:59
hypothetical in your case maybe our design just wasn't a good fit to start
2:01
design just wasn't a good fit to start
2:01
design just wasn't a good fit to start with right no matter the root cause the
2:05
with right no matter the root cause the
2:05
with right no matter the root cause the outcome is the same we end up with code
2:07
outcome is the same we end up with code
2:07
outcome is the same we end up with code that is more expensive to maintain than
2:09
that is more expensive to maintain than
2:09
that is more expensive to maintain than it should be and this is the definition
2:12
it should be and this is the definition
2:12
it should be and this is the definition of technical depth that I'm going to run
2:14
of technical depth that I'm going to run
2:14
of technical depth that I'm going to run with throughout this
2:16
with throughout this presentation now during the past four to
2:19
presentation now during the past four to
2:19
presentation now during the past four to five years we have learned a lot about
2:21
five years we have learned a lot about
2:21
five years we have learned a lot about the industry cost of bad code and
2:23
the industry cost of bad code and
2:23
the industry cost of bad code and Technical depth in general and there are
2:26
Technical depth in general and there are
2:26
Technical depth in general and there are multiple papers you can look at I'm
2:28
multiple papers you can look at I'm
2:28
multiple papers you can look at I'm going to reference a few of them here
2:30
going to reference a few of them here
2:30
going to reference a few of them here but at the end of the day it doesn't
2:32
but at the end of the day it doesn't
2:32
but at the end of the day it doesn't matter which paper you read because they
2:34
matter which paper you read because they
2:34
matter which paper you read because they have one thing in common they all paint
2:36
have one thing in common they all paint
2:36
have one thing in common they all paint a pretty depressing view of our
2:38
a pretty depressing view of our
2:38
a pretty depressing view of our industry did you know that as developers
2:41
industry did you know that as developers
2:41
industry did you know that as developers we waste somewhere between 23 to
2:45
we waste somewhere between 23 to
2:45
we waste somewhere between 23 to 42% of our work week dealing with the
2:47
42% of our work week dealing with the
2:47
42% of our work week dealing with the consequences of technical depth and bad
2:49
consequences of technical depth and bad
2:49
consequences of technical depth and bad code in
2:51
code in general 42% waste what does that even
2:55
general 42% waste what does that even
2:55
general 42% waste what does that even mean let's do a small F experiment
2:58
mean let's do a small F experiment
2:58
mean let's do a small F experiment together so let's pretend that you have
3:01
together so let's pretend that you have
3:01
together so let's pretend that you have a company with 100 Engineers that means
3:04
a company with 100 Engineers that means
3:04
a company with 100 Engineers that means you need to pay the salaries for 100
3:06
you need to pay the salaries for 100
3:06
you need to pay the salaries for 100 people with a 42% waste it means you pay
3:10
people with a 42% waste it means you pay
3:10
people with a 42% waste it means you pay the salaries for 100 people but you get
3:12
the salaries for 100 people but you get
3:12
the salaries for 100 people but you get the equivalent output of just 58 people
3:15
the equivalent output of just 58 people
3:15
the equivalent output of just 58 people does that sound like a good deal to you
3:18
does that sound like a good deal to you
3:18
does that sound like a good deal to you no of course not it's
3:20
no of course not it's
3:20
no of course not it's horrible and of course there are other
3:23
horrible and of course there are other
3:23
horrible and of course there are other factors too because I like to claim that
3:25
factors too because I like to claim that
3:26
factors too because I like to claim that if you could actually build something
3:27
if you could actually build something
3:27
if you could actually build something with 58 people as opposed to 100
3:30
with 58 people as opposed to 100
3:30
with 58 people as opposed to 100 then doing it with the smaller team is
3:32
then doing it with the smaller team is
3:32
then doing it with the smaller team is always always going to be more efficient
3:34
always always going to be more efficient
3:35
always always going to be more efficient because with a larger team you have
3:36
because with a larger team you have
3:36
because with a larger team you have additional coordination costs
3:38
additional coordination costs
3:38
additional coordination costs communication costs and management
3:40
communication costs and management
3:40
communication costs and management overhead so I actually think that the
3:42
overhead so I actually think that the
3:43
overhead so I actually think that the real waste from technical debt is
3:44
real waste from technical debt is
3:44
real waste from technical debt is significantly larger I think these
3:47
significantly larger I think these
3:47
significantly larger I think these numbers are overly
3:49
numbers are overly optimistic of course technical depth and
3:52
optimistic of course technical depth and
3:52
optimistic of course technical depth and bad code is not only about financial
3:54
bad code is not only about financial
3:55
bad code is not only about financial impact it's also about vulnerabilities
3:58
impact it's also about vulnerabilities
3:58
impact it's also about vulnerabilities so another line of research has
3:59
so another line of research has
3:59
so another line of research has established that there is a strong
4:02
established that there is a strong
4:02
established that there is a strong correlation between software
4:04
correlation between software
4:04
correlation between software vulnerabilities and Technical depth in
4:07
vulnerabilities and Technical depth in
4:07
vulnerabilities and Technical depth in the shape of various codes Mells that
4:08
the shape of various codes Mells that
4:09
the shape of various codes Mells that we're going to see throughout this
4:11
we're going to see throughout this
4:11
we're going to see throughout this presentation so now where does this
4:13
presentation so now where does this
4:13
presentation so now where does this leave us
4:15
leave us well if we have something technical
4:17
well if we have something technical
4:17
well if we have something technical depth bad code that uh has a massive
4:20
depth bad code that uh has a massive
4:20
depth bad code that uh has a massive Financial impact waste for the 2% of our
4:22
Financial impact waste for the 2% of our
4:22
Financial impact waste for the 2% of our time and causes secured
4:24
time and causes secured
4:24
time and causes secured vulnerabilities we would expect
4:26
vulnerabilities we would expect
4:26
vulnerabilities we would expect technical dep to be at the very top of
4:28
technical dep to be at the very top of
4:28
technical dep to be at the very top of any decision maker
4:30
any decision maker agenda is that what's
4:34
agenda is that what's
4:34
agenda is that what's happening well probably not because what
4:37
happening well probably not because what
4:37
happening well probably not because what again what we see in the research field
4:39
again what we see in the research field
4:39
again what we see in the research field is that we do a horrible job as an
4:41
is that we do a horrible job as an
4:42
is that we do a horrible job as an industry in fact what researchers find
4:45
industry in fact what researchers find
4:45
industry in fact what researchers find is that we developers are frequently
4:47
is that we developers are frequently
4:47
is that we developers are frequently forced to introduce even more technical
4:49
forced to introduce even more technical
4:49
forced to introduce even more technical depth because companies just keep
4:51
depth because companies just keep
4:51
depth because companies just keep trading code quality for short-term
4:53
trading code quality for short-term
4:53
trading code quality for short-term gains like the next big
4:56
gains like the next big
4:56
gains like the next big feature now i' I've been thinking about
4:58
feature now i' I've been thinking about
4:58
feature now i' I've been thinking about this for a long time for at least the
5:00
this for a long time for at least the
5:00
this for a long time for at least the past 10 years why do we do this tradeoff
5:03
past 10 years why do we do this tradeoff
5:03
past 10 years why do we do this tradeoff why do we sacrifice code quality over
5:05
why do we sacrifice code quality over
5:05
why do we sacrifice code quality over and over again to ship
5:07
and over again to ship
5:07
and over again to ship features and I think I have an IDE on
5:10
features and I think I have an IDE on
5:11
features and I think I have an IDE on one of the root
5:12
one of the root causes so let me show an example to
5:15
causes so let me show an example to
5:15
causes so let me show an example to you I didn't bring any c code in this
5:18
you I didn't bring any c code in this
5:18
you I didn't bring any c code in this slide I decided to go a little bit more
5:22
slide I decided to go a little bit more
5:22
slide I decided to go a little bit more old school and present a piece of
5:24
old school and present a piece of
5:24
old school and present a piece of C++ but it doesn't really matter right
5:27
C++ but it doesn't really matter right
5:27
C++ but it doesn't really matter right because I think as C Developers familiar
5:30
because I think as C Developers familiar
5:30
because I think as C Developers familiar with that
5:31
with that structure and I'd like to ask you a
5:33
structure and I'd like to ask you a
5:33
structure and I'd like to ask you a question looking at that code can anyone
5:37
question looking at that code can anyone
5:37
question looking at that code can anyone tell me if this code is correct can
5:40
tell me if this code is correct can
5:40
tell me if this code is correct can anyone tell me what this code does I
5:43
anyone tell me what this code does I
5:43
anyone tell me what this code does I have to admit that after all these years
5:45
have to admit that after all these years
5:45
have to admit that after all these years coding and I even spent 10 years doing
5:47
coding and I even spent 10 years doing
5:47
coding and I even spent 10 years doing C++ I have absolutely no idea what this
5:50
C++ I have absolutely no idea what this
5:50
C++ I have absolutely no idea what this piece of code does and I cannot tell if
5:51
piece of code does and I cannot tell if
5:51
piece of code does and I cannot tell if it's correct or not without spending a
5:54
it's correct or not without spending a
5:54
it's correct or not without spending a lot of time on
5:55
lot of time on it now what I want to point out is that
5:58
it now what I want to point out is that
5:58
it now what I want to point out is that if we as develop velers struggle to
6:00
if we as develop velers struggle to
6:00
if we as develop velers struggle to understand code we have to keep in mind
6:02
understand code we have to keep in mind
6:02
understand code we have to keep in mind that what you see on screen is just 19
6:04
that what you see on screen is just 19
6:04
that what you see on screen is just 19 lines of code a modern system has
6:08
lines of code a modern system has
6:08
lines of code a modern system has hundreds of thousands million lines of
6:10
hundreds of thousands million lines of
6:10
hundreds of thousands million lines of code that looks like just like that and
6:13
code that looks like just like that and
6:13
code that looks like just like that and if we as developers struggle with
6:15
if we as developers struggle with
6:15
if we as developers struggle with understanding small pieces of code
6:17
understanding small pieces of code
6:17
understanding small pieces of code imagine a non-technical stakeholder like
6:19
imagine a non-technical stakeholder like
6:19
imagine a non-technical stakeholder like a product person a technical manager or
6:22
a product person a technical manager or
6:22
a product person a technical manager or vpf engineering a business
6:25
vpf engineering a business
6:25
vpf engineering a business manager how should they understand if
6:27
manager how should they understand if
6:27
manager how should they understand if our code is good or bad if there
6:29
our code is good or bad if there
6:29
our code is good or bad if there technical depth or where ways this
6:32
technical depth or where ways this
6:32
technical depth or where ways this software is lared all blackbox to many
6:34
software is lared all blackbox to many
6:34
software is lared all blackbox to many many people so what I like us to do
6:37
many people so what I like us to do
6:37
many people so what I like us to do today is to see can we shine a light
6:39
today is to see can we shine a light
6:39
today is to see can we shine a light into this black box can we shine a light
6:41
into this black box can we shine a light
6:41
into this black box can we shine a light on technical dep and make it relevant to
6:43
on technical dep and make it relevant to
6:43
on technical dep and make it relevant to the
6:45
business in order to do this I would
6:48
business in order to do this I would
6:48
business in order to do this I would like us to start to visualize technical
6:50
like us to start to visualize technical
6:50
like us to start to visualize technical LA and code quality and to visualize
6:53
LA and code quality and to visualize
6:53
LA and code quality and to visualize something we need to know what to
6:55
something we need to know what to
6:55
something we need to know what to visualize so we need to know how to
6:57
visualize so we need to know how to
6:57
visualize so we need to know how to measure code quality and this has been a
7:00
measure code quality and this has been a
7:00
measure code quality and this has been a notoriously hard problem there have been
7:03
notoriously hard problem there have been
7:03
notoriously hard problem there have been multiple attempts throughout the decades
7:05
multiple attempts throughout the decades
7:05
multiple attempts throughout the decades and you might have heard about
7:06
and you might have heard about
7:06
and you might have heard about approaches like cycl medic complexity
7:08
approaches like cycl medic complexity
7:08
approaches like cycl medic complexity has its volume metrics and so on and
7:11
has its volume metrics and so on and
7:11
has its volume metrics and so on and what all of these metrics have in common
7:12
what all of these metrics have in common
7:12
what all of these metrics have in common is that there are pretty poor predictors
7:14
is that there are pretty poor predictors
7:14
is that there are pretty poor predictors of complexity in fact there's no real
7:17
of complexity in fact there's no real
7:17
of complexity in fact there's no real correlation between what these metrics
7:19
correlation between what these metrics
7:19
correlation between what these metrics find and something that's meaningful to
7:21
find and something that's meaningful to
7:21
find and something that's meaningful to the
7:22
the business so one thing that uh me and my
7:26
business so one thing that uh me and my
7:26
business so one thing that uh me and my team have been working on for the past
7:27
team have been working on for the past
7:27
team have been working on for the past six to seven years is to see can we
7:29
six to seven years is to see can we
7:29
six to seven years is to see can we develop a better proxy for code
7:32
develop a better proxy for code
7:32
develop a better proxy for code quality and we decided to call the
7:34
quality and we decided to call the
7:34
quality and we decided to call the concept code health so code health is
7:36
concept code health so code health is
7:36
concept code health so code health is both a concept and a specific software
7:38
both a concept and a specific software
7:38
both a concept and a specific software metric that you can use and it's a
7:41
metric that you can use and it's a
7:41
metric that you can use and it's a metric that's based on 25 different
7:43
metric that's based on 25 different
7:43
metric that's based on 25 different factors why 25
7:46
factors why 25 factors well the reason is simple it's
7:49
factors well the reason is simple it's
7:49
factors well the reason is simple it's very hard to agree on what makes good
7:52
very hard to agree on what makes good
7:52
very hard to agree on what makes good code good right it's very hard to Define
7:55
code good right it's very hard to Define
7:55
code good right it's very hard to Define quality but it's very easy to Define
7:58
quality but it's very easy to Define
7:58
quality but it's very easy to Define what bad code is so what we did is that
8:00
what bad code is so what we did is that
8:00
what bad code is so what we did is that we simply researched and came up with a
8:02
we simply researched and came up with a
8:02
we simply researched and came up with a list of 25 factors that we know are
8:05
list of 25 factors that we know are
8:05
list of 25 factors that we know are indicators of bad code so the way this
8:08
indicators of bad code so the way this
8:08
indicators of bad code so the way this works is that you have a piece of code
8:10
works is that you have a piece of code
8:10
works is that you have a piece of code might be C might be yava or something
8:13
might be C might be yava or something
8:13
might be C might be yava or something else and you parse that code and then
8:16
else and you parse that code and then
8:16
else and you parse that code and then you Analyze That code for these
8:18
you Analyze That code for these
8:18
you Analyze That code for these different codes smells and I'm not going
8:20
different codes smells and I'm not going
8:20
different codes smells and I'm not going to show you the full list of the 25
8:22
to show you the full list of the 25
8:22
to show you the full list of the 25 factors you free to check it out uh via
8:24
factors you free to check it out uh via
8:25
factors you free to check it out uh via the links but I'm going to show you the
8:26
the links but I'm going to show you the
8:26
the links but I'm going to show you the most important ones so at the top level
8:30
most important ones so at the top level
8:31
most important ones so at the top level we look for um module level smells so
8:34
we look for um module level smells so
8:34
we look for um module level smells so these are like class design issues and
8:36
these are like class design issues and
8:36
these are like class design issues and to give you a typical example of a class
8:38
to give you a typical example of a class
8:38
to give you a typical example of a class design issue or code smell at that level
8:41
design issue or code smell at that level
8:41
design issue or code smell at that level that's low
8:43
that's low cohesion so you might be familiar with
8:45
cohesion so you might be familiar with
8:45
cohesion so you might be familiar with low cohesion it basically means that you
8:47
low cohesion it basically means that you
8:47
low cohesion it basically means that you have stuffed too many business
8:49
have stuffed too many business
8:49
have stuffed too many business responsibilities into the same class so
8:52
responsibilities into the same class so
8:52
responsibilities into the same class so now this class has many many reasons to
8:54
now this class has many many reasons to
8:54
now this class has many many reasons to change and this is problematic because
8:56
change and this is problematic because
8:56
change and this is problematic because as a developer trying to understand that
8:58
as a developer trying to understand that
8:58
as a developer trying to understand that code I now need need to understand all
9:00
code I now need need to understand all
9:00
code I now need need to understand all these different business uh rules in
9:02
these different business uh rules in
9:02
these different business uh rules in order to make sense of the code it also
9:05
order to make sense of the code it also
9:05
order to make sense of the code it also opens up the risk for things like
9:07
opens up the risk for things like
9:07
opens up the risk for things like unexpected feature interactions which
9:09
unexpected feature interactions which
9:09
unexpected feature interactions which are some of the worst bugs you can have
9:11
are some of the worst bugs you can have
9:11
are some of the worst bugs you can have you know you tweak some code over here
9:13
you know you tweak some code over here
9:13
you know you tweak some code over here and a completely unrelated feature
9:15
and a completely unrelated feature
9:15
and a completely unrelated feature breaks that's usually caused by low
9:18
breaks that's usually caused by low
9:18
breaks that's usually caused by low cohesion so low cohesion is a very
9:20
cohesion so low cohesion is a very
9:20
cohesion so low cohesion is a very serious smell it obviously doesn't mean
9:23
serious smell it obviously doesn't mean
9:23
serious smell it obviously doesn't mean that we cannot make it even worse
9:25
that we cannot make it even worse
9:25
that we cannot make it even worse because what we can do is we can take a
9:26
because what we can do is we can take a
9:26
because what we can do is we can take a class with low cohesion and let it grow
9:28
class with low cohesion and let it grow
9:28
class with low cohesion and let it grow really really l and let it include at
9:30
really really l and let it include at
9:30
really really l and let it include at least a brain method I'm going to talk
9:32
least a brain method I'm going to talk
9:32
least a brain method I'm going to talk about that soon what we have done now is
9:34
about that soon what we have done now is
9:34
about that soon what we have done now is that we created a brain class so that's
9:36
that we created a brain class so that's
9:36
that we created a brain class so that's another modu level
9:38
another modu level smell and brain methods are a function
9:41
smell and brain methods are a function
9:41
smell and brain methods are a function level smell it's something you might
9:43
level smell it's something you might
9:43
level smell it's something you might also known under its Alias gut
9:46
also known under its Alias gut
9:46
also known under its Alias gut functions what brain methods and gut
9:48
functions what brain methods and gut
9:48
functions what brain methods and gut functions are are simply large
9:51
functions are are simply large
9:51
functions are are simply large functions they are always large and they
9:54
functions they are always large and they
9:54
functions they are always large and they tend to contain a lot of logic and the
9:56
tend to contain a lot of logic and the
9:56
tend to contain a lot of logic and the reason they contain a lot of logic is
9:57
reason they contain a lot of logic is
9:57
reason they contain a lot of logic is because again they do two to many things
10:00
because again they do two to many things
10:00
because again they do two to many things they are again low on cohesion so what
10:02
they are again low on cohesion so what
10:03
they are again low on cohesion so what this means to me as a developer is that
10:04
this means to me as a developer is that
10:04
this means to me as a developer is that the moment I want to modify anything
10:07
the moment I want to modify anything
10:07
the moment I want to modify anything inside this particular area of the code
10:08
inside this particular area of the code
10:08
inside this particular area of the code end up in the brain method and each time
10:11
end up in the brain method and each time
10:11
end up in the brain method and each time I work on it it becomes more and more
10:13
I work on it it becomes more and more
10:13
I work on it it becomes more and more complicated so brain methods is a pretty
10:16
complicated so brain methods is a pretty
10:16
complicated so brain methods is a pretty severe code
10:17
severe code smell then finally at the implementation
10:20
smell then finally at the implementation
10:20
smell then finally at the implementation level we look for various complexity
10:23
level we look for various complexity
10:23
level we look for various complexity patterns and um to mention a pattern
10:26
patterns and um to mention a pattern
10:26
patterns and um to mention a pattern with really high predictive power I like
10:29
with really high predictive power I like
10:29
with really high predictive power I like to point out deep nested logic so deep
10:32
to point out deep nested logic so deep
10:33
to point out deep nested logic so deep nested logic is something all of you
10:34
nested logic is something all of you
10:34
nested logic is something all of you have seen it's when you have an if
10:36
have seen it's when you have an if
10:36
have seen it's when you have an if statement inside an if statement inside
10:38
statement inside an if statement inside
10:38
statement inside an if statement inside an if statement and maybe a loop for
10:40
an if statement and maybe a loop for
10:40
an if statement and maybe a loop for good
10:41
good measure the reason that code is
10:43
measure the reason that code is
10:43
measure the reason that code is problematic is because there is some
10:45
problematic is because there is some
10:45
problematic is because there is some very good research that shows that
10:47
very good research that shows that
10:47
very good research that shows that roughly 20% of all programming mistakes
10:49
roughly 20% of all programming mistakes
10:49
roughly 20% of all programming mistakes are due to things like deepness and
10:51
are due to things like deepness and
10:51
are due to things like deepness and logic and once we know about this it's
10:54
logic and once we know about this it's
10:54
logic and once we know about this it's it's pretty easy to avoid right so these
10:57
it's pretty easy to avoid right so these
10:57
it's pretty easy to avoid right so these are just some high level examples on um
11:00
are just some high level examples on um
11:00
are just some high level examples on um the 25 factors that you look for in code
11:02
the 25 factors that you look for in code
11:02
the 25 factors that you look for in code health so you basically look for the
11:04
health so you basically look for the
11:04
health so you basically look for the presence of any of these factors in the
11:07
presence of any of these factors in the
11:07
presence of any of these factors in the code and then uh we have algorithms that
11:09
code and then uh we have algorithms that
11:09
code and then uh we have algorithms that can score Aggregate and categorize every
11:12
can score Aggregate and categorize every
11:12
can score Aggregate and categorize every single piece of code as being in one of
11:14
single piece of code as being in one of
11:14
single piece of code as being in one of three
11:16
three categories the code can either be green
11:18
categories the code can either be green
11:18
categories the code can either be green that's healthy code with low risk that's
11:20
that's healthy code with low risk that's
11:20
that's healthy code with low risk that's where you want to be with the majority
11:22
where you want to be with the majority
11:22
where you want to be with the majority of your source
11:24
of your source code and then you have the next uh
11:27
code and then you have the next uh
11:27
code and then you have the next uh category yellow code
11:29
category yellow code
11:30
category yellow code that's problematic code where you have
11:31
that's problematic code where you have
11:31
that's problematic code where you have started to take on technical depth and
11:34
started to take on technical depth and
11:34
started to take on technical depth and unless you're really careful you might
11:36
unless you're really careful you might
11:36
unless you're really careful you might end up in the red category which is
11:38
end up in the red category which is
11:38
end up in the red category which is unhealthy code that's the type of code
11:39
unhealthy code that's the type of code
11:39
unhealthy code that's the type of code you never ever want to work with right
11:42
you never ever want to work with right
11:42
you never ever want to work with right that's what typically call Spaghetti
11:43
that's what typically call Spaghetti
11:43
that's what typically call Spaghetti code it's code that's really hard to
11:45
code it's code that's really hard to
11:45
code it's code that's really hard to understand and very fragile as we will
11:47
understand and very fragile as we will
11:47
understand and very fragile as we will soon
11:48
soon see so now that we know how we can use
11:52
see so now that we know how we can use
11:52
see so now that we know how we can use codal as a proy for code quality we can
11:55
codal as a proy for code quality we can
11:55
codal as a proy for code quality we can start to visualize code quality in large
11:58
start to visualize code quality in large
11:58
start to visualize code quality in large code bases and and I want to show how
12:00
code bases and and I want to show how
12:00
code bases and and I want to show how this can look on a real code
12:02
this can look on a real code
12:02
this can look on a real code base so what you see on screen here is a
12:05
base so what you see on screen here is a
12:05
base so what you see on screen here is a code quality visualization of
12:07
code quality visualization of
12:07
code quality visualization of ephrom and there's really nothing
12:10
ephrom and there's really nothing
12:10
ephrom and there's really nothing special about eom U it's just a good
12:12
special about eom U it's just a good
12:12
special about eom U it's just a good example of a midsized code base and
12:15
example of a midsized code base and
12:15
example of a midsized code base and Ephron for those of you who might not
12:17
Ephron for those of you who might not
12:17
Ephron for those of you who might not know it it's an open source blockchain
12:20
know it it's an open source blockchain
12:20
know it it's an open source blockchain implementation the interesting thing
12:22
implementation the interesting thing
12:22
implementation the interesting thing with this visualization is that it's
12:25
with this visualization is that it's
12:25
with this visualization is that it's based on code written in 50 different
12:28
based on code written in 50 different
12:28
based on code written in 50 different git
12:29
git repositories so it's a multi repo
12:32
repositories so it's a multi repo
12:32
repositories so it's a multi repo project and you see that each one of
12:33
project and you see that each one of
12:34
project and you see that each one of these circles with a name the ones I'm
12:36
these circles with a name the ones I'm
12:36
these circles with a name the ones I'm hovering are right now they correspond
12:38
hovering are right now they correspond
12:38
hovering are right now they correspond to code in a specific git
12:40
to code in a specific git
12:40
to code in a specific git repository if this was a monor repo then
12:44
repository if this was a monor repo then
12:44
repository if this was a monor repo then um the top level circles would
12:45
um the top level circles would
12:45
um the top level circles would correspond to the top level folders in
12:47
correspond to the top level folders in
12:47
correspond to the top level folders in your repositories we're going to see
12:49
your repositories we're going to see
12:49
your repositories we're going to see some examples on that soon as well
12:52
some examples on that soon as well
12:52
some examples on that soon as well anyway uh by using this visualization I
12:54
anyway uh by using this visualization I
12:54
anyway uh by using this visualization I can quickly zoom in on the area I'm
12:55
can quickly zoom in on the area I'm
12:55
can quickly zoom in on the area I'm interested in a typical an area where I
12:57
interested in a typical an area where I
12:57
interested in a typical an area where I do a lot of work or I might an
12:59
do a lot of work or I might an
12:59
do a lot of work or I might an additional technical
13:00
additional technical
13:00
additional technical responsibility so let's zoom in on
13:02
responsibility so let's zoom in on
13:02
responsibility so let's zoom in on Research here so when I zoom in on
13:04
Research here so when I zoom in on
13:04
Research here so when I zoom in on Research what I see is that it's a
13:07
Research what I see is that it's a
13:07
Research what I see is that it's a hierarchical structure so we have the
13:09
hierarchical structure so we have the
13:09
hierarchical structure so we have the various subfolders inside that part of
13:11
various subfolders inside that part of
13:11
various subfolders inside that part of the code and once I get to the lowest
13:13
the code and once I get to the lowest
13:13
the code and once I get to the lowest level of detail I see that each file
13:15
level of detail I see that each file
13:15
level of detail I see that each file with source code is visualized as a
13:18
with source code is visualized as a
13:18
with source code is visualized as a circle and you also see that these
13:20
circle and you also see that these
13:20
circle and you also see that these circles they have different size some
13:22
circles they have different size some
13:22
circles they have different size some are big some are much smaller so the
13:24
are big some are much smaller so the
13:24
are big some are much smaller so the size of a circle just reflects the
13:26
size of a circle just reflects the
13:26
size of a circle just reflects the number of lines of code in that class
13:30
number of lines of code in that class
13:30
number of lines of code in that class the important that's just to know how
13:32
the important that's just to know how
13:32
the important that's just to know how big a potential problem is right the
13:35
big a potential problem is right the
13:35
big a potential problem is right the interesting thing here is the color
13:37
interesting thing here is the color
13:37
interesting thing here is the color which indicates the code ofal so we see
13:39
which indicates the code ofal so we see
13:39
which indicates the code ofal so we see that on the top we have one big red blob
13:41
that on the top we have one big red blob
13:41
that on the top we have one big red blob with red problematic code and below it
13:44
with red problematic code and below it
13:44
with red problematic code and below it we have two healthy pieces of
13:46
we have two healthy pieces of
13:46
we have two healthy pieces of code so this makes it really really easy
13:49
code so this makes it really really easy
13:49
code so this makes it really really easy to pinpoint the unhealthy problematic
13:51
to pinpoint the unhealthy problematic
13:51
to pinpoint the unhealthy problematic parts of your
13:53
parts of your code now I'm going to come back to what
13:55
code now I'm going to come back to what
13:55
code now I'm going to come back to what that means but before I do that I want
13:57
that means but before I do that I want
13:57
that means but before I do that I want to show you a few additional examples
13:59
to show you a few additional examples
13:59
to show you a few additional examples because I'm a big big big fan of
14:03
because I'm a big big big fan of
14:03
because I'm a big big big fan of visualizations because visualizations
14:05
visualizations because visualizations
14:05
visualizations because visualizations they kind of tap into this amazing power
14:07
they kind of tap into this amazing power
14:07
they kind of tap into this amazing power detector that we carry around in our
14:09
detector that we carry around in our
14:09
detector that we carry around in our head our visual brain right so by
14:13
head our visual brain right so by
14:13
head our visual brain right so by visualizing code we can
14:15
visualizing code we can
14:15
visualizing code we can within you know within a few seconds we
14:18
within you know within a few seconds we
14:18
within you know within a few seconds we can start to draw conclusions and
14:19
can start to draw conclusions and
14:19
can start to draw conclusions and compare various code bases and I want to
14:22
compare various code bases and I want to
14:22
compare various code bases and I want to show you an
14:24
show you an example so to the left here let's start
14:26
example so to the left here let's start
14:26
example so to the left here let's start with that one that's a visualization of
14:29
with that one that's a visualization of
14:29
with that one that's a visualization of the code quality in react from Facebook
14:32
the code quality in react from Facebook
14:32
the code quality in react from Facebook and react is a UI Library that's super
14:34
and react is a UI Library that's super
14:34
and react is a UI Library that's super popular these days most of you probably
14:37
popular these days most of you probably
14:37
popular these days most of you probably using it in one capacity or
14:39
using it in one capacity or
14:39
using it in one capacity or another and when I look at react I
14:41
another and when I look at react I
14:41
another and when I look at react I immediately see that the the react
14:43
immediately see that the the react
14:43
immediately see that the the react reconciler the part of the code that
14:45
reconciler the part of the code that
14:45
reconciler the part of the code that I've highlighted seems to have some code
14:48
I've highlighted seems to have some code
14:48
I've highlighted seems to have some code quality problems there's lots of yellow
14:51
quality problems there's lots of yellow
14:51
quality problems there's lots of yellow and red code inside it so if this is a
14:54
and red code inside it so if this is a
14:54
and red code inside it so if this is a code base that I'm responsible for then
14:57
code base that I'm responsible for then
14:57
code base that I'm responsible for then this is super important info to me
14:59
this is super important info to me
14:59
this is super important info to me because as we will soon see red and
15:01
because as we will soon see red and
15:01
because as we will soon see red and yellow code is going to constrain what
15:04
yellow code is going to constrain what
15:04
yellow code is going to constrain what we can do with the codebase and its road
15:06
we can do with the codebase and its road
15:06
we can do with the codebase and its road map going
15:07
map going forward however I can contrast react to
15:10
forward however I can contrast react to
15:10
forward however I can contrast react to the codebase on the right and this is
15:13
the codebase on the right and this is
15:13
the codebase on the right and this is our Microsoft codebase this is Corr this
15:16
our Microsoft codebase this is Corr this
15:16
our Microsoft codebase this is Corr this is the runtime that you all use for net
15:20
is the runtime that you all use for net
15:20
is the runtime that you all use for net and what's interesting with the Corr is
15:22
and what's interesting with the Corr is
15:22
and what's interesting with the Corr is that it's a massive massive code base
15:25
that it's a massive massive code base
15:25
that it's a massive massive code base what you see on screen is more than
15:26
what you see on screen is more than
15:26
what you see on screen is more than eight and a half million lines of code
15:29
eight and a half million lines of code
15:29
eight and a half million lines of code so the reason I like this case study is
15:31
so the reason I like this case study is
15:31
so the reason I like this case study is because it kind of indicates that this
15:32
because it kind of indicates that this
15:32
because it kind of indicates that this visualization approach scales really
15:34
visualization approach scales really
15:34
visualization approach scales really well to large
15:36
well to large systems so what can we say about the
15:38
systems so what can we say about the
15:38
systems so what can we say about the code quality well we can immediately see
15:40
code quality well we can immediately see
15:41
code quality well we can immediately see that yeah all the automated tests in the
15:43
that yeah all the automated tests in the
15:43
that yeah all the automated tests in the bottom left corner seem to be very
15:45
bottom left corner seem to be very
15:45
bottom left corner seem to be very healthy right with very few
15:47
healthy right with very few
15:47
healthy right with very few exceptions but in the actual application
15:49
exceptions but in the actual application
15:49
exceptions but in the actual application code we seem to have some really
15:51
code we seem to have some really
15:51
code we seem to have some really complicated pieces of code you see this
15:53
complicated pieces of code you see this
15:53
complicated pieces of code you see this band of red code right it's like a Petr
15:55
band of red code right it's like a Petr
15:55
band of red code right it's like a Petr Dison mad almost right and the question
15:59
Dison mad almost right and the question
15:59
Dison mad almost right and the question is of course what do I do with this
16:00
is of course what do I do with this
16:00
is of course what do I do with this information how do I act upon this and
16:03
information how do I act upon this and
16:03
information how do I act upon this and that's something I want to cover towards
16:04
that's something I want to cover towards
16:04
that's something I want to cover towards the end of the
16:06
the end of the session but before we do that we need to
16:09
session but before we do that we need to
16:09
session but before we do that we need to connect this to some kind of business
16:12
connect this to some kind of business
16:12
connect this to some kind of business objective because if we use a code
16:14
objective because if we use a code
16:14
objective because if we use a code quality score and we don't connect it to
16:16
quality score and we don't connect it to
16:16
quality score and we don't connect it to something that's meaningful to the
16:18
something that's meaningful to the
16:18
something that's meaningful to the business then code quality is always
16:20
business then code quality is always
16:20
business then code quality is always going to be a second priority right to
16:23
going to be a second priority right to
16:23
going to be a second priority right to really really make it the business
16:25
really really make it the business
16:25
really really make it the business Advantage it deserves to be we need to
16:27
Advantage it deserves to be we need to
16:27
Advantage it deserves to be we need to be able to explain gain and code quality
16:29
be able to explain gain and code quality
16:29
be able to explain gain and code quality to business
16:32
people so two years ago me and my research
16:35
so two years ago me and my research
16:35
so two years ago me and my research colleague Dr Marcus Borg we set out to
16:38
colleague Dr Marcus Borg we set out to
16:38
colleague Dr Marcus Borg we set out to try to quantify the business impact of
16:40
try to quantify the business impact of
16:40
try to quantify the business impact of code
16:42
code quality and we choose to do this on
16:44
quality and we choose to do this on
16:44
quality and we choose to do this on Preparatory code basis because we wanted
16:47
Preparatory code basis because we wanted
16:47
Preparatory code basis because we wanted to make sure that this is data that's
16:48
to make sure that this is data that's
16:48
to make sure that this is data that's representative of what businesses work
16:51
representative of what businesses work
16:51
representative of what businesses work with and we did this by connecting to F
16:55
with and we did this by connecting to F
16:55
with and we did this by connecting to F nine companies that wanted to
16:57
nine companies that wanted to
16:57
nine companies that wanted to participate in the study
17:00
participate in the study
17:00
participate in the study each one of them had many many different
17:02
each one of them had many many different
17:02
each one of them had many many different Co products and code bases these are
17:04
Co products and code bases these are
17:04
Co products and code bases these are large
17:06
large Enterprises and we made sure to include
17:09
Enterprises and we made sure to include
17:09
Enterprises and we made sure to include companies from many different industry
17:11
companies from many different industry
17:11
companies from many different industry segments because we wanted to make sure
17:12
segments because we wanted to make sure
17:12
segments because we wanted to make sure that whatever we find is General to the
17:15
that whatever we find is General to the
17:15
that whatever we find is General to the software industry as a whole it's not
17:16
software industry as a whole it's not
17:17
software industry as a whole it's not something that's specific to one domain
17:19
something that's specific to one domain
17:19
something that's specific to one domain or one type of business and for the same
17:21
or one type of business and for the same
17:21
or one type of business and for the same reason we also made sure to include code
17:23
reason we also made sure to include code
17:23
reason we also made sure to include code in many different program languages
17:25
in many different program languages
17:25
in many different program languages because we wanted to make sure that
17:28
because we wanted to make sure that
17:28
because we wanted to make sure that whatever we find is something that
17:29
whatever we find is something that
17:29
whatever we find is something that applies no matter what program language
17:31
applies no matter what program language
17:31
applies no matter what program language you use because products today are
17:33
you use because products today are
17:33
you use because products today are typically built in a polyot fashion
17:36
typically built in a polyot fashion
17:36
typically built in a polyot fashion right so we had code written in C of
17:39
right so we had code written in C of
17:39
right so we had code written in C of course Java C++ JavaScript Python and so
17:43
course Java C++ JavaScript Python and so
17:43
course Java C++ JavaScript Python and so on and what I want to say before I show
17:46
on and what I want to say before I show
17:46
on and what I want to say before I show you the findings is that everything I
17:48
you the findings is that everything I
17:48
you the findings is that everything I show you is statistically significant
17:51
show you is statistically significant
17:51
show you is statistically significant meaning that it's very unlikely that our
17:53
meaning that it's very unlikely that our
17:53
meaning that it's very unlikely that our results are due to a fluke there's
17:55
results are due to a fluke there's
17:55
results are due to a fluke there's probably a real effect behind it and to
17:57
probably a real effect behind it and to
17:57
probably a real effect behind it and to guarantee that we had um our data
18:00
guarantee that we had um our data
18:00
guarantee that we had um our data published and peer reviewed and
18:02
published and peer reviewed and
18:02
published and peer reviewed and presented at academic
18:05
presented at academic
18:05
presented at academic conferences so what did we find is code
18:08
conferences so what did we find is code
18:08
conferences so what did we find is code quality important to a business well
18:11
quality important to a business well
18:11
quality important to a business well let's see I'm going to talk a bit about
18:13
let's see I'm going to talk a bit about
18:13
let's see I'm going to talk a bit about how we collected the data
18:16
how we collected the data
18:16
how we collected the data first so the first thing we did was to
18:20
first so the first thing we did was to
18:20
first so the first thing we did was to measure the time in development and we
18:22
measure the time in development and we
18:22
measure the time in development and we wanted to compare that across the code
18:25
wanted to compare that across the code
18:25
wanted to compare that across the code of categories so how do we know the time
18:27
of categories so how do we know the time
18:28
of categories so how do we know the time in development
18:29
in development well code quality is easy we simply
18:31
well code quality is easy we simply
18:31
well code quality is easy we simply asked
18:33
asked the companies that participated to run
18:36
the companies that participated to run
18:36
the companies that participated to run the tooling which gave us a code help
18:38
the tooling which gave us a code help
18:38
the tooling which gave us a code help score for every single file in their
18:40
score for every single file in their
18:40
score for every single file in their code bases right so we had a massive
18:41
code bases right so we had a massive
18:41
code bases right so we had a massive table with that but time in developments
18:44
table with that but time in developments
18:44
table with that but time in developments is more
18:45
is more tricky what we didn't want to do was to
18:47
tricky what we didn't want to do was to
18:47
tricky what we didn't want to do was to force developers to self-report via some
18:50
force developers to self-report via some
18:50
force developers to self-report via some time spent field in J or something like
18:52
time spent field in J or something like
18:52
time spent field in J or something like that because if they would do that two
18:54
that because if they would do that two
18:54
that because if they would do that two things would happen first they would
18:56
things would happen first they would
18:56
things would happen first they would hate us for having them do that and that
18:59
hate us for having them do that and that
18:59
hate us for having them do that and that we didn't want second it would be
19:02
we didn't want second it would be
19:02
we didn't want second it would be inaccurate because they would basically
19:04
inaccurate because they would basically
19:04
inaccurate because they would basically just you know at the end of the week we
19:06
just you know at the end of the week we
19:06
just you know at the end of the week we put in whatever we think in those fields
19:08
put in whatever we think in those fields
19:09
put in whatever we think in those fields so we decided to automate it so we
19:11
so we decided to automate it so we
19:11
so we decided to automate it so we connected to tools like aure devops and
19:15
connected to tools like aure devops and
19:15
connected to tools like aure devops and jira and uh fetched information about
19:17
jira and uh fetched information about
19:17
jira and uh fetched information about the tickets when they started to work on
19:19
the tickets when they started to work on
19:19
the tickets when they started to work on them when they were completed and then
19:21
them when they were completed and then
19:21
them when they were completed and then we connected that to Version Control
19:22
we connected that to Version Control
19:22
we connected that to Version Control Data so we can trace it down the time
19:24
Data so we can trace it down the time
19:25
Data so we can trace it down the time spent at the file level so we basically
19:27
spent at the file level so we basically
19:27
spent at the file level so we basically calculated the cycle time for implenting
19:29
calculated the cycle time for implenting
19:29
calculated the cycle time for implenting features of fixing bag at the file level
19:32
features of fixing bag at the file level
19:32
features of fixing bag at the file level so we now had a massive table with
19:33
so we now had a massive table with
19:33
so we now had a massive table with unnown code of score and Unown time in
19:35
unnown code of score and Unown time in
19:35
unnown code of score and Unown time in development and that's what made it
19:37
development and that's what made it
19:37
development and that's what made it possible to calculate these
19:39
possible to calculate these
19:39
possible to calculate these statistics so what do they tell us well
19:42
statistics so what do they tell us well
19:42
statistics so what do they tell us well they tell us that if I have green code I
19:45
they tell us that if I have green code I
19:45
they tell us that if I have green code I can move more than twice as quick
19:47
can move more than twice as quick
19:47
can move more than twice as quick compared to someone that has red
19:49
compared to someone that has red
19:49
compared to someone that has red code is this important to a
19:52
code is this important to a
19:52
code is this important to a business well let's say that my company
19:56
business well let's say that my company
19:56
business well let's say that my company would have red code and uh let's say
19:59
would have red code and uh let's say
19:59
would have red code and uh let's say that we need to implement a new
20:01
that we need to implement a new
20:01
that we need to implement a new capability and it takes us two and a
20:02
capability and it takes us two and a
20:02
capability and it takes us two and a half months to do that a competitor with
20:05
half months to do that a competitor with
20:05
half months to do that a competitor with green code can get the same thing in
20:07
green code can get the same thing in
20:07
green code can get the same thing in less than a month it's going to be
20:08
less than a month it's going to be
20:08
less than a month it's going to be impossible to keep up so green code is
20:12
impossible to keep up so green code is
20:12
impossible to keep up so green code is very clearly a productivity benefit to a
20:14
very clearly a productivity benefit to a
20:14
very clearly a productivity benefit to a business you can get more things done
20:17
business you can get more things done
20:17
business you can get more things done than your competitors with poor
20:19
than your competitors with poor
20:19
than your competitors with poor codal however what we also noticed in
20:22
codal however what we also noticed in
20:22
codal however what we also noticed in that study we are well aware that
20:24
that study we are well aware that
20:24
that study we are well aware that averages can be a little bit misleading
20:26
averages can be a little bit misleading
20:26
averages can be a little bit misleading and the actual impact might be even
20:27
and the actual impact might be even
20:27
and the actual impact might be even larger
20:29
larger so to study that we decided to look at
20:31
so to study that we decided to look at
20:31
so to study that we decided to look at the variation in task completion times
20:35
the variation in task completion times
20:35
the variation in task completion times and what we found here was very
20:38
and what we found here was very
20:38
and what we found here was very dramatic what we found was that the
20:40
dramatic what we found was that the
20:40
dramatic what we found was that the maximum time to implementing a ticket be
20:43
maximum time to implementing a ticket be
20:43
maximum time to implementing a ticket be it a new feature or bug fix could vary
20:47
it a new feature or bug fix could vary
20:47
it a new feature or bug fix could vary up to nine times longer 10 times longer
20:49
up to nine times longer 10 times longer
20:49
up to nine times longer 10 times longer for red code compared to Green code
20:52
for red code compared to Green code
20:52
for red code compared to Green code because when we look at the actual
20:54
because when we look at the actual
20:54
because when we look at the actual numbers behind this we see that the
20:55
numbers behind this we see that the
20:56
numbers behind this we see that the maximum time it takes to implement a
20:57
maximum time it takes to implement a
20:57
maximum time it takes to implement a ticket in green code is very very close
21:00
ticket in green code is very very close
21:00
ticket in green code is very very close to the average and that simply means
21:02
to the average and that simply means
21:02
to the average and that simply means that green code is predictable right it
21:05
that green code is predictable right it
21:05
that green code is predictable right it takes roughly the same time each time I
21:07
takes roughly the same time each time I
21:07
takes roughly the same time each time I work on it there are no nasty surprises
21:09
work on it there are no nasty surprises
21:09
work on it there are no nasty surprises in the
21:10
in the code whereas I can see that for red code
21:13
code whereas I can see that for red code
21:13
code whereas I can see that for red code that relationship no longer holds
21:14
that relationship no longer holds
21:14
that relationship no longer holds through right it can take nine times
21:17
through right it can take nine times
21:17
through right it can take nine times longer is this relevant to a
21:20
longer is this relevant to a
21:20
longer is this relevant to a business I would like to think so
21:22
business I would like to think so
21:22
business I would like to think so because what this represents is
21:24
because what this represents is
21:24
because what this represents is uncertainty and if there's one thing
21:26
uncertainty and if there's one thing
21:26
uncertainty and if there's one thing I've learned through all these years in
21:28
I've learned through all these years in
21:28
I've learned through all these years in software it's that uncertainty is
21:29
software it's that uncertainty is
21:29
software it's that uncertainty is something that no one no one is
21:32
something that no one no one is
21:32
something that no one no one is comfortable with so imagine your
21:35
comfortable with so imagine your
21:35
comfortable with so imagine your business manager promising something to
21:37
business manager promising something to
21:37
business manager promising something to our key stakeholders maybe the company
21:40
our key stakeholders maybe the company
21:40
our key stakeholders maybe the company owners maybe to the board or maybe even
21:41
owners maybe to the board or maybe even
21:41
owners maybe to the board or maybe even to a customer that yeah we are building
21:44
to a customer that yeah we are building
21:44
to a customer that yeah we are building this feature now we're going to launch
21:46
this feature now we're going to launch
21:46
this feature now we're going to launch it in one
21:47
it in one month if they have red code they can
21:49
month if they have red code they can
21:49
month if they have red code they can make no such promises because as we've
21:52
make no such promises because as we've
21:52
make no such promises because as we've seen the data it can equally well take
21:54
seen the data it can equally well take
21:54
seen the data it can equally well take nine or 10 months and they going to look
21:56
nine or 10 months and they going to look
21:56
nine or 10 months and they going to look really really bad
21:58
really really bad also if I put on my developer hat I'm
22:01
also if I put on my developer hat I'm
22:01
also if I put on my developer hat I'm also not a big fan of uncertainty
22:03
also not a big fan of uncertainty
22:03
also not a big fan of uncertainty because uncertainty is what's keeping me
22:05
because uncertainty is what's keeping me
22:05
because uncertainty is what's keeping me up late due to deadlines Mis deadlines
22:10
up late due to deadlines Mis deadlines
22:10
up late due to deadlines Mis deadlines overtime and stress so red code is
22:12
overtime and stress so red code is
22:12
overtime and stress so red code is disastrous on so many
22:15
disastrous on so many
22:15
disastrous on so many levels
22:17
levels finally what we also did in this study
22:19
finally what we also did in this study
22:19
finally what we also did in this study was that we had as we had access to aure
22:22
was that we had as we had access to aure
22:22
was that we had as we had access to aure Dao and JRA data we could also figure
22:24
Dao and JRA data we could also figure
22:24
Dao and JRA data we could also figure out if the code was modified due to a
22:27
out if the code was modified due to a
22:27
out if the code was modified due to a new feature some re work or due to a bug
22:30
new feature some re work or due to a bug
22:30
new feature some re work or due to a bug fix and that made it possible to
22:32
fix and that made it possible to
22:32
fix and that made it possible to calculate defect
22:34
calculate defect densities so how what do you think how
22:37
densities so how what do you think how
22:37
densities so how what do you think how do you think defects uh differ across
22:40
do you think defects uh differ across
22:40
do you think defects uh differ across green yellow and red
22:43
green yellow and red
22:43
green yellow and red code well let's have a
22:46
code well let's have a
22:47
code well let's have a look and this is quite dramatic isn't it
22:49
look and this is quite dramatic isn't it
22:49
look and this is quite dramatic isn't it it turns out that red code has an
22:51
it turns out that red code has an
22:51
it turns out that red code has an average 15 times more defects than green
22:55
average 15 times more defects than green
22:55
average 15 times more defects than green code so let me ask the obvious question
22:58
code so let me ask the obvious question
22:58
code so let me ask the obvious question is this relevant to your
23:00
is this relevant to your
23:00
is this relevant to your business I definitely think so because
23:03
business I definitely think so because
23:03
business I definitely think so because if we having red code would ship 15
23:05
if we having red code would ship 15
23:06
if we having red code would ship 15 times as many defects as someone having
23:07
times as many defects as someone having
23:07
times as many defects as someone having green code then that would definitely
23:09
green code then that would definitely
23:09
green code then that would definitely impact the customer satisfaction and the
23:11
impact the customer satisfaction and the
23:11
impact the customer satisfaction and the product maturity
23:13
product maturity experience and for us as developers red
23:15
experience and for us as developers red
23:15
experience and for us as developers red code is extremely
23:17
code is extremely stressful because all these defects that
23:19
stressful because all these defects that
23:19
stressful because all these defects that we ship into production they're going to
23:21
we ship into production they're going to
23:22
we ship into production they're going to come back in the shape of unplanned work
23:24
come back in the shape of unplanned work
23:24
come back in the shape of unplanned work where we have to contact switch
23:26
where we have to contact switch
23:26
where we have to contact switch right so red code is really really
23:30
right so red code is really really
23:30
right so red code is really really dangerous now if we have this data and
23:34
dangerous now if we have this data and
23:34
dangerous now if we have this data and visualizations like this how can we use
23:36
visualizations like this how can we use
23:36
visualizations like this how can we use them in our daily work well let me share
23:39
them in our daily work well let me share
23:39
them in our daily work well let me share the things I have seen work really
23:41
the things I have seen work really
23:41
the things I have seen work really really well and the things that I tend
23:42
really well and the things that I tend
23:42
really well and the things that I tend to do with this
23:44
to do with this data the first thing that I think is
23:46
data the first thing that I think is
23:46
data the first thing that I think is super useful is that if we have a
23:48
super useful is that if we have a
23:48
super useful is that if we have a visualization like this we can use it to
23:50
visualization like this we can use it to
23:50
visualization like this we can use it to create situational awareness in our
23:52
create situational awareness in our
23:52
create situational awareness in our organization what I mean by that is that
23:54
organization what I mean by that is that
23:54
organization what I mean by that is that we can make sure that all stakeholders
23:57
we can make sure that all stakeholders
23:57
we can make sure that all stakeholders be it engineers developers or product
23:59
be it engineers developers or product
23:59
be it engineers developers or product people or managers we can share the same
24:02
people or managers we can share the same
24:02
people or managers we can share the same understanding the same view of where the
24:04
understanding the same view of where the
24:04
understanding the same view of where the strong and weak parts are in a code
24:06
strong and weak parts are in a code
24:06
strong and weak parts are in a code base and that's a really really good
24:09
base and that's a really really good
24:09
base and that's a really really good foundation because it helps us fight
24:12
foundation because it helps us fight
24:12
foundation because it helps us fight risk right because let's take an example
24:16
risk right because let's take an example
24:16
risk right because let's take an example here let's say that the codebase here to
24:18
here let's say that the codebase here to
24:18
here let's say that the codebase here to the right that I visualized let's say
24:20
the right that I visualized let's say
24:20
the right that I visualized let's say that it's our code base right so maybe
24:23
that it's our code base right so maybe
24:23
that it's our code base right so maybe we sit down in a Sprint planning meeting
24:25
we sit down in a Sprint planning meeting
24:25
we sit down in a Sprint planning meeting our product owner is attending and our
24:29
our product owner is attending and our
24:29
our product owner is attending and our product owner tells us that she has
24:31
product owner tells us that she has
24:31
product owner tells us that she has planned five major features in the react
24:33
planned five major features in the react
24:33
planned five major features in the react reconciler
24:35
reconciler part now given what we know about red
24:38
part now given what we know about red
24:38
part now given what we know about red and yellow code we know that this is a
24:40
and yellow code we know that this is a
24:40
and yellow code we know that this is a massive risk that's a large risk that
24:42
massive risk that's a large risk that
24:42
massive risk that's a large risk that we're going to um need much more time
24:44
we're going to um need much more time
24:44
we're going to um need much more time than we plan for and that we are going
24:46
than we plan for and that we are going
24:46
than we plan for and that we are going to deliver with poor quality many
24:48
to deliver with poor quality many
24:48
to deliver with poor quality many defects so using this data we can have a
24:51
defects so using this data we can have a
24:51
defects so using this data we can have a conversation with it makes sense to
24:53
conversation with it makes sense to
24:53
conversation with it makes sense to First refactor the code so that we can
24:55
First refactor the code so that we can
24:55
First refactor the code so that we can safely Implement all these features and
24:58
safely Implement all these features and
24:58
safely Implement all these features and that brings me to the last use case my
25:00
that brings me to the last use case my
25:00
that brings me to the last use case my personal favorite and perhaps what I
25:02
personal favorite and perhaps what I
25:02
personal favorite and perhaps what I like the most about this type of data is
25:04
like the most about this type of data is
25:04
like the most about this type of data is that it makes it possible to finally
25:06
that it makes it possible to finally
25:06
that it makes it possible to finally build a business case for improvements
25:08
build a business case for improvements
25:08
build a business case for improvements and large scale refactorings because
25:11
and large scale refactorings because
25:11
and large scale refactorings because these can now come with a business
25:13
these can now come with a business
25:13
these can now come with a business expectation So based on the data we can
25:17
expectation So based on the data we can
25:17
expectation So based on the data we can we can give guarantees that if we have
25:19
we can give guarantees that if we have
25:19
we can give guarantees that if we have code like in the react reconciler if we
25:21
code like in the react reconciler if we
25:21
code like in the react reconciler if we take that red code refactor it and make
25:23
take that red code refactor it and make
25:23
take that red code refactor it and make it healthy then everything that we have
25:26
it healthy then everything that we have
25:26
it healthy then everything that we have planned in the road mapap for that part
25:28
planned in the road mapap for that part
25:28
planned in the road mapap for that part particular component we can now say that
25:30
particular component we can now say that
25:30
particular component we can now say that on average we're going to be twice as
25:31
on average we're going to be twice as
25:31
on average we're going to be twice as quick with implementing those features
25:33
quick with implementing those features
25:33
quick with implementing those features and we going significantly reduce the
25:35
and we going significantly reduce the
25:35
and we going significantly reduce the risk we're going to have 15 times fewer
25:37
risk we're going to have 15 times fewer
25:37
risk we're going to have 15 times fewer defects on average and that's a very
25:39
defects on average and that's a very
25:39
defects on average and that's a very very quantifiable
25:43
win now I still have a couple of minutes
25:46
win now I still have a couple of minutes
25:46
win now I still have a couple of minutes before uh taking questions so I wanted
25:49
before uh taking questions so I wanted
25:49
before uh taking questions so I wanted to take on one more related
25:52
to take on one more related
25:52
to take on one more related challenge how do we prioritize
25:55
challenge how do we prioritize
25:55
challenge how do we prioritize remediations to large amounts of red
25:57
remediations to large amounts of red
25:57
remediations to large amounts of red code
25:59
code so let's travel back to coreclr as an
26:03
so let's travel back to coreclr as an
26:03
so let's travel back to coreclr as an example 8.5 million lines of code in
26:06
example 8.5 million lines of code in
26:06
example 8.5 million lines of code in total if we just sum up the red code we
26:08
total if we just sum up the red code we
26:08
total if we just sum up the red code we probably end up with two two and a half
26:10
probably end up with two two and a half
26:10
probably end up with two two and a half million lines of code how long would it
26:13
million lines of code how long would it
26:13
million lines of code how long would it take us to refactor two and a half
26:15
take us to refactor two and a half
26:15
take us to refactor two and a half million lines of
26:16
million lines of code five years 10 years I don't know
26:20
code five years 10 years I don't know
26:21
code five years 10 years I don't know but it's very clear that we would be
26:22
but it's very clear that we would be
26:22
but it's very clear that we would be long out of business before we even get
26:24
long out of business before we even get
26:24
long out of business before we even get there right because as a business we
26:26
there right because as a business we
26:26
there right because as a business we always need to balance improvements to
26:29
always need to balance improvements to
26:29
always need to balance improvements to existing code versus adding new features
26:32
existing code versus adding new features
26:32
existing code versus adding new features right it's a continuously changing
26:35
right it's a continuously changing
26:35
right it's a continuously changing space so how can we do this well this is
26:39
space so how can we do this well this is
26:39
space so how can we do this well this is where our set of techniques known as
26:41
where our set of techniques known as
26:41
where our set of techniques known as behavioral code analysis can
26:44
behavioral code analysis can
26:44
behavioral code analysis can help so for those of you who aren't
26:47
help so for those of you who aren't
26:47
help so for those of you who aren't familiar with behavioral code analysis
26:49
familiar with behavioral code analysis
26:49
familiar with behavioral code analysis the key idea here is that in our
26:51
the key idea here is that in our
26:51
the key idea here is that in our behavioral code analysis the code is
26:54
behavioral code analysis the code is
26:54
behavioral code analysis the code is important it's really really important
26:57
important it's really really important
26:57
important it's really really important to know if the code is healthy or not
26:59
to know if the code is healthy or not
26:59
to know if the code is healthy or not right so that's like the
27:01
right so that's like the
27:01
right so that's like the foundation once we have that it's even
27:04
foundation once we have that it's even
27:04
foundation once we have that it's even more important to understand how we as
27:06
more important to understand how we as
27:06
more important to understand how we as developers interact with the system
27:08
developers interact with the system
27:08
developers interact with the system we're building that's the behavior part
27:11
we're building that's the behavior part
27:11
we're building that's the behavior part of it so it's an
27:13
of it so it's an intersection between code and
27:15
intersection between code and
27:15
intersection between code and people and to do a behavioral code
27:17
people and to do a behavioral code
27:18
people and to do a behavioral code analysis we obviously need some
27:19
analysis we obviously need some
27:19
analysis we obviously need some behavioral data on how we as developers
27:22
behavioral data on how we as developers
27:22
behavioral data on how we as developers work with the code how can we possibly
27:25
work with the code how can we possibly
27:25
work with the code how can we possibly get such a
27:26
get such a thing the good news are you all already
27:30
thing the good news are you all already
27:30
thing the good news are you all already have all the data you need we might just
27:32
have all the data you need we might just
27:32
have all the data you need we might just not be used to think about it that way
27:35
not be used to think about it that way
27:35
not be used to think about it that way what I'm referring to is Version Control
27:38
what I'm referring to is Version Control
27:38
what I'm referring to is Version Control Data Git it turns out that git is
27:42
Data Git it turns out that git is
27:42
Data Git it turns out that git is something we have used for years more or
27:44
something we have used for years more or
27:45
something we have used for years more or less as an overly complicated backup
27:46
less as an overly complicated backup
27:46
less as an overly complicated backup system occasionally maybe as a
27:48
system occasionally maybe as a
27:48
system occasionally maybe as a collaboration tool but when doing so we
27:51
collaboration tool but when doing so we
27:51
collaboration tool but when doing so we have built up this wonderful data source
27:53
have built up this wonderful data source
27:53
have built up this wonderful data source over how we as Engineers have interacted
27:56
over how we as Engineers have interacted
27:56
over how we as Engineers have interacted with the code we're building and there
27:58
with the code we're building and there
27:58
with the code we're building and there are many many analysis we can do from
28:00
are many many analysis we can do from
28:00
are many many analysis we can do from git I write about lots of them in my
28:03
git I write about lots of them in my
28:03
git I write about lots of them in my book but one of my favorites when
28:06
book but one of my favorites when
28:06
book but one of my favorites when particular when it comes to technical de
28:08
particular when it comes to technical de
28:08
particular when it comes to technical de is that git data gives us a Time
28:11
is that git data gives us a Time
28:11
is that git data gives us a Time Dimension into our code we can basically
28:14
Dimension into our code we can basically
28:14
Dimension into our code we can basically tell the story of how the system evolved
28:17
tell the story of how the system evolved
28:17
tell the story of how the system evolved where we worked how frequently we worked
28:19
where we worked how frequently we worked
28:19
where we worked how frequently we worked in various parts and what happened over
28:22
in various parts and what happened over
28:22
in various parts and what happened over time and this is something we can use to
28:25
time and this is something we can use to
28:25
time and this is something we can use to prioritize technical do
28:28
prioritize technical do
28:28
prioritize technical do so instead of showing you a video
28:29
so instead of showing you a video
28:29
so instead of showing you a video recording I wanted to do a quick demo on
28:32
recording I wanted to do a quick demo on
28:32
recording I wanted to do a quick demo on how it can look on a real code base and
28:34
how it can look on a real code base and
28:34
how it can look on a real code base and then I'm going to wrap up the
28:35
then I'm going to wrap up the
28:35
then I'm going to wrap up the presentation and take questions after
28:39
presentation and take questions after
28:39
presentation and take questions after that so let's see it's always
28:41
that so let's see it's always
28:41
that so let's see it's always interesting to do a live
28:43
interesting to do a live
28:43
interesting to do a live demo uh you should be able to see my web
28:46
demo uh you should be able to see my web
28:46
demo uh you should be able to see my web browser
28:47
browser now and the system I'm analyzing is
28:50
now and the system I'm analyzing is
28:50
now and the system I'm analyzing is react from Facebook that we looked at
28:53
react from Facebook that we looked at
28:53
react from Facebook that we looked at before and we can easily see that there
28:55
before and we can easily see that there
28:55
before and we can easily see that there are parts of the code that are unhealthy
28:59
are parts of the code that are unhealthy
28:59
are parts of the code that are unhealthy I see like two modules right there's a
29:01
I see like two modules right there's a
29:01
I see like two modules right there's a pattern here so to the left I have
29:04
pattern here so to the left I have
29:04
pattern here so to the left I have something called benchmarks where there
29:05
something called benchmarks where there
29:05
something called benchmarks where there is plenty of unhealthy code and to the
29:08
is plenty of unhealthy code and to the
29:08
is plenty of unhealthy code and to the right I have the react reconciler with
29:10
right I have the react reconciler with
29:10
right I have the react reconciler with unhealthy code the question is where do
29:13
unhealthy code the question is where do
29:13
unhealthy code the question is where do I start if I want to pay down technical
29:15
I start if I want to pay down technical
29:15
I start if I want to pay down technical debt and
29:17
debt and improve the interesting thing here is
29:19
improve the interesting thing here is
29:19
improve the interesting thing here is that if we look at Version Control Data
29:21
that if we look at Version Control Data
29:21
that if we look at Version Control Data we can visualize that using a concept
29:23
we can visualize that using a concept
29:23
we can visualize that using a concept called hotspots and I'm going to explain
29:25
called hotspots and I'm going to explain
29:25
called hotspots and I'm going to explain what that is so if I click here on
29:27
what that is so if I click here on
29:27
what that is so if I click here on hotspots what I do now is that I go to
29:29
hotspots what I do now is that I go to
29:29
hotspots what I do now is that I go to verse control and I simply calculate how
29:31
verse control and I simply calculate how
29:31
verse control and I simply calculate how many commits have we done to every
29:33
many commits have we done to every
29:33
many commits have we done to every single piece of code here over the past
29:35
single piece of code here over the past
29:35
single piece of code here over the past year and what I see now is that the more
29:38
year and what I see now is that the more
29:38
year and what I see now is that the more red it is the higher the development
29:40
red it is the higher the development
29:40
red it is the higher the development frequency right the more commits we have
29:42
frequency right the more commits we have
29:42
frequency right the more commits we have done in that part of the code the more
29:43
done in that part of the code the more
29:43
done in that part of the code the more relevant the code is and what I see now
29:46
relevant the code is and what I see now
29:46
relevant the code is and what I see now might be surprising I see that this
29:48
might be surprising I see that this
29:48
might be surprising I see that this benchmarks package where I had this red
29:51
benchmarks package where I had this red
29:51
benchmarks package where I had this red code is very stable we haven't worked on
29:54
code is very stable we haven't worked on
29:54
code is very stable we haven't worked on it for years so starting to fix some
29:57
it for years so starting to fix some
29:57
it for years so starting to fix some code down there there won't have any big
29:59
code down there there won't have any big
29:59
code down there there won't have any big payoff right however I see that there's
30:02
payoff right however I see that there's
30:02
payoff right however I see that there's a lot of development activity in the
30:04
a lot of development activity in the
30:04
a lot of development activity in the react reconciler so I would definitely
30:06
react reconciler so I would definitely
30:06
react reconciler so I would definitely zoom in here and see if these hotspots
30:09
zoom in here and see if these hotspots
30:09
zoom in here and see if these hotspots are unhealthy so I let me click on a
30:11
are unhealthy so I let me click on a
30:11
are unhealthy so I let me click on a hotspot and I immediately see that this
30:14
hotspot and I immediately see that this
30:14
hotspot and I immediately see that this is indeed unhealthy code so what I have
30:17
is indeed unhealthy code so what I have
30:17
is indeed unhealthy code so what I have identified now is code that lacks in
30:20
identified now is code that lacks in
30:20
identified now is code that lacks in quality poor quality code that is also
30:22
quality poor quality code that is also
30:22
quality poor quality code that is also worked on all the time and that's like
30:25
worked on all the time and that's like
30:25
worked on all the time and that's like the definition of technical depth with a
30:27
the definition of technical depth with a
30:27
the definition of technical depth with a high interest
30:29
high interest rate so I want to show you how Behavior
30:33
rate so I want to show you how Behavior
30:33
rate so I want to show you how Behavior code analysis techniques like a hotspot
30:35
code analysis techniques like a hotspot
30:35
code analysis techniques like a hotspot can help you separate the technical
30:37
can help you separate the technical
30:37
can help you separate the technical depth that you have to fix from the
30:39
depth that you have to fix from the
30:39
depth that you have to fix from the technical depth you can live with and I
30:41
technical depth you can live with and I
30:41
technical depth you can live with and I want to clarify that with the slide
30:43
want to clarify that with the slide
30:43
want to clarify that with the slide because it's so
30:45
because it's so important so technical depth has two
30:47
important so technical depth has two
30:47
important so technical depth has two components one is the actual loan you
30:50
components one is the actual loan you
30:50
components one is the actual loan you have taken on and this is something you
30:52
have taken on and this is something you
30:52
have taken on and this is something you can measure by uh code quality right red
30:56
can measure by uh code quality right red
30:56
can measure by uh code quality right red or green code but the other is the
30:59
or green code but the other is the
30:59
or green code but the other is the interest and if we look at this
31:01
interest and if we look at this
31:01
interest and if we look at this visualization I have a slightly
31:03
visualization I have a slightly
31:03
visualization I have a slightly different view of this code base so on
31:05
different view of this code base so on
31:05
different view of this code base so on the xaxis you have each file with source
31:08
the xaxis you have each file with source
31:08
the xaxis you have each file with source code and they are sorted according to
31:10
code and they are sorted according to
31:10
code and they are sorted according to the ex change frequency that is how many
31:12
the ex change frequency that is how many
31:12
the ex change frequency that is how many commits have I done to each piece of
31:13
commits have I done to each piece of
31:13
commits have I done to each piece of code that's what I see on the y-axis and
31:16
code that's what I see on the y-axis and
31:16
code that's what I see on the y-axis and if I look at this visualization I see
31:18
if I look at this visualization I see
31:18
if I look at this visualization I see that it forms a power law
31:20
that it forms a power law
31:20
that it forms a power law shape and this is something I've seen in
31:22
shape and this is something I've seen in
31:22
shape and this is something I've seen in every single codebase I've ever analyzed
31:25
every single codebase I've ever analyzed
31:25
every single codebase I've ever analyzed and I probably analyzed three 400
31:27
and I probably analyzed three 400
31:27
and I probably analyzed three 400 codebases by now so this seems to be the
31:29
codebases by now so this seems to be the
31:29
codebases by now so this seems to be the way software evolves and this is
31:32
way software evolves and this is
31:32
way software evolves and this is important to us and it's actually good
31:34
important to us and it's actually good
31:34
important to us and it's actually good news because what this means is that
31:37
news because what this means is that
31:37
news because what this means is that most of our code is going to be in the
31:38
most of our code is going to be in the
31:38
most of our code is going to be in the long tail so this is code that's rarely
31:41
long tail so this is code that's rarely
31:41
long tail so this is code that's rarely ever touched and if we have some yellow
31:43
ever touched and if we have some yellow
31:43
ever touched and if we have some yellow or red code down there then that's
31:45
or red code down there then that's
31:45
or red code down there then that's technical depth we want to be aware of
31:47
technical depth we want to be aware of
31:47
technical depth we want to be aware of it but we can probably live with it
31:49
it but we can probably live with it
31:49
it but we can probably live with it because the interest is so low on the
31:52
because the interest is so low on the
31:52
because the interest is so low on the other hand we see that most development
31:54
other hand we see that most development
31:54
other hand we see that most development activity is at the head of this Power
31:56
activity is at the head of this Power
31:56
activity is at the head of this Power log curve so that means that in a
32:00
log curve so that means that in a
32:00
log curve so that means that in a Hotpot we cannot afford any technical
32:03
Hotpot we cannot afford any technical
32:03
Hotpot we cannot afford any technical debt at all that's the code we really
32:05
debt at all that's the code we really
32:05
debt at all that's the code we really really need to keep green because if we
32:07
really need to keep green because if we
32:07
really need to keep green because if we fail to do so the costs of that
32:09
fail to do so the costs of that
32:09
fail to do so the costs of that technical depth are going to explode due
32:11
technical depth are going to explode due
32:11
technical depth are going to explode due to the high development frequency of the
32:13
to the high development frequency of the
32:13
to the high development frequency of the code right it's a very high interest on
32:15
code right it's a very high interest on
32:15
code right it's a very high interest on that technical
32:16
that technical depth and what I see in our research is
32:20
depth and what I see in our research is
32:20
depth and what I see in our research is that the hotspots tend to make up a very
32:22
that the hotspots tend to make up a very
32:22
that the hotspots tend to make up a very small part of the code base maybe just
32:24
small part of the code base maybe just
32:24
small part of the code base maybe just two three
32:26
two three four% but attract on unproportionally
32:29
four% but attract on unproportionally
32:29
four% but attract on unproportionally large part of the development activity
32:32
large part of the development activity
32:32
large part of the development activity so starting to pay down technical debt
32:34
so starting to pay down technical debt
32:34
so starting to pay down technical debt in a hotspot is likely to give you a
32:36
in a hotspot is likely to give you a
32:36
in a hotspot is likely to give you a very big short-term benefit as
32:39
very big short-term benefit as
32:40
very big short-term benefit as well and with that I've come to the end
32:42
well and with that I've come to the end
32:42
well and with that I've come to the end of my presentation what I want to show
32:44
of my presentation what I want to show
32:44
of my presentation what I want to show you today is that to really really uh
32:46
you today is that to really really uh
32:46
you today is that to really really uh make code quality or competitive
32:48
make code quality or competitive
32:48
make code quality or competitive Advantage you need to have two different
32:50
Advantage you need to have two different
32:50
Advantage you need to have two different dimensions one is the quality Dimension
32:53
dimensions one is the quality Dimension
32:53
dimensions one is the quality Dimension that you can measure with code Health
32:54
that you can measure with code Health
32:54
that you can measure with code Health where you see if the code is good or bad
32:57
where you see if the code is good or bad
32:57
where you see if the code is good or bad and the other is the relevance Dimension
32:59
and the other is the relevance Dimension
32:59
and the other is the relevance Dimension that you can measure with hotspots so
33:01
that you can measure with hotspots so
33:01
that you can measure with hotspots so that is how you know the impact and
33:03
that is how you know the impact and
33:03
that is how you know the impact and priorities of any cool quality
33:06
priorities of any cool quality
33:06
priorities of any cool quality findings and I started out saying that
33:09
findings and I started out saying that
33:09
findings and I started out saying that um there seems to be this conception in
33:11
um there seems to be this conception in
33:12
um there seems to be this conception in Industry that there is a trade-off
33:13
Industry that there is a trade-off
33:13
Industry that there is a trade-off between speed and quality but what we
33:15
between speed and quality but what we
33:15
between speed and quality but what we see in our research in our data is that
33:18
see in our research in our data is that
33:18
see in our research in our data is that the opposite seems to be true and I like
33:20
the opposite seems to be true and I like
33:20
the opposite seems to be true and I like to think that with 15 times fewer
33:22
to think that with 15 times fewer
33:22
to think that with 15 times fewer defects twice the development speed and
33:25
defects twice the development speed and
33:25
defects twice the development speed and nine times lower onc in completion times
33:27
nine times lower onc in completion times
33:27
nine times lower onc in completion times for talk asks the business advantage of
33:29
for talk asks the business advantage of
33:29
for talk asks the business advantage of cod quality should be really really
33:33
cod quality should be really really
33:33
cod quality should be really really clear and if you want to know more about
33:35
clear and if you want to know more about
33:35
clear and if you want to know more about this then I have a number of resources
33:37
this then I have a number of resources
33:37
this then I have a number of resources for you here uh the links will take you
33:40
for you here uh the links will take you
33:40
for you here uh the links will take you to a white paper that summarizes uh the
33:43
to a white paper that summarizes uh the
33:43
to a white paper that summarizes uh the key uh code Health findings that I
33:45
key uh code Health findings that I
33:45
key uh code Health findings that I talked about the business impact there's
33:48
talked about the business impact there's
33:48
talked about the business impact there's also an actual research paper behind it
33:50
also an actual research paper behind it
33:50
also an actual research paper behind it so if you want to go into all the
33:51
so if you want to go into all the
33:51
so if you want to go into all the details and figure out that hey how did
33:53
details and figure out that hey how did
33:53
details and figure out that hey how did they measure this or how did they
33:54
they measure this or how did they
33:55
they measure this or how did they control for this bias then the research
33:57
control for this bias then the research
33:57
control for this bias then the research paper is your first
33:58
paper is your first brand and uh to do the actual research
34:02
brand and uh to do the actual research
34:02
brand and uh to do the actual research and to visualize it I'm using the codin
34:04
and to visualize it I'm using the codin
34:04
and to visualize it I'm using the codin Tool uh where I work so if you're
34:07
Tool uh where I work so if you're
34:07
Tool uh where I work so if you're interested in trying this out on your
34:09
interested in trying this out on your
34:09
interested in trying this out on your own codebase then I highly encourage you
34:11
own codebase then I highly encourage you
34:11
own codebase then I highly encourage you to give it a shot I think you will find
34:12
to give it a shot I think you will find
34:12
to give it a shot I think you will find it interesting to see what your code
34:14
it interesting to see what your code
34:14
it interesting to see what your code looks like and you can go to codes.com
34:16
looks like and you can go to codes.com
34:16
looks like and you can go to codes.com and just test it out for free and
34:19
and just test it out for free and
34:19
and just test it out for free and finally if you want to dive deeper into
34:21
finally if you want to dive deeper into
34:21
finally if you want to dive deeper into Behavior code analysis then you could
34:23
Behavior code analysis then you could
34:23
Behavior code analysis then you could probably do worse than reading the
34:24
probably do worse than reading the
34:24
probably do worse than reading the second edition of your codess crime
34:26
second edition of your codess crime
34:26
second edition of your codess crime scene it's a brand new second edition
34:29
scene it's a brand new second edition
34:29
scene it's a brand new second edition that goes into Cod quality hotspots and
34:31
that goes into Cod quality hotspots and
34:31
that goes into Cod quality hotspots and many many other things around successful
34:34
many many other things around successful
34:34
many many other things around successful software with that said I'd like to
34:36
software with that said I'd like to
34:36
software with that said I'd like to thank you a lot for listening to me and
34:38
thank you a lot for listening to me and
34:38
thank you a lot for listening to me and I'm very much looking forward to the
34:40
I'm very much looking forward to the
34:40
I'm very much looking forward to the questions so thank you very much
34:42
questions so thank you very much
34:42
questions so thank you very much [Music]