0:03
okay in this session we're going to talk
0:05
okay in this session we're going to talk
0:05
okay in this session we're going to talk about the uh measuring architecture
0:08
about the uh measuring architecture
0:08
about the uh measuring architecture characteristics uh of course the
0:10
characteristics uh of course the
0:10
characteristics uh of course the software AR architecture is one of the
0:14
software AR architecture is one of the
0:14
software AR architecture is one of the important parts of software design and
0:16
important parts of software design and
0:16
important parts of software design and developments and we need to uh have very
0:20
developments and we need to uh have very
0:20
developments and we need to uh have very good and comprehensive information about
0:23
good and comprehensive information about
0:23
good and comprehensive information about the software architecture and how to
0:24
the software architecture and how to
0:24
the software architecture and how to design it and how to manage it uh in
0:27
design it and how to manage it uh in
0:27
design it and how to manage it uh in this session we're going to spe
0:29
this session we're going to spe
0:29
this session we're going to spe specifically talk about the measuring
0:31
specifically talk about the measuring
0:31
specifically talk about the measuring the architecture characteristics but
0:33
the architecture characteristics but
0:33
the architecture characteristics but before that uh my name is V far I'm born
0:37
before that uh my name is V far I'm born
0:37
before that uh my name is V far I'm born in Iran 98 and9 I have my BSC in
0:40
in Iran 98 and9 I have my BSC in
0:40
in Iran 98 and9 I have my BSC in computer software engineer from iry
0:42
computer software engineer from iry
0:42
computer software engineer from iry University and the medical informatics M
0:44
University and the medical informatics M
0:44
University and the medical informatics M degree from TR University I'm
0:47
degree from TR University I'm
0:47
degree from TR University I'm International speaker and book author uh
0:51
International speaker and book author uh
0:51
International speaker and book author uh currently I'm working as the chief uh
0:53
currently I'm working as the chief uh
0:53
currently I'm working as the chief uh executive officer
0:56
executive officer at previously I have authored uh three
0:59
at previously I have authored uh three
0:59
at previously I have authored uh three books design patterns in net
1:01
books design patterns in net
1:02
books design patterns in net specifically on go of patterns the other
1:06
specifically on go of patterns the other
1:06
specifically on go of patterns the other volume of my book is design patternnet
1:08
volume of my book is design patternnet
1:08
volume of my book is design patternnet which is focused on Enterprise
1:10
which is focused on Enterprise
1:10
which is focused on Enterprise application architecture patterns both
1:12
application architecture patterns both
1:12
application architecture patterns both of these books uh were Ed in farsy or
1:15
of these books uh were Ed in farsy or
1:15
of these books uh were Ed in farsy or person language and my third book is
1:18
person language and my third book is
1:18
person language and my third book is about do 7 patterns and deps which is in
1:21
about do 7 patterns and deps which is in
1:21
about do 7 patterns and deps which is in English version you can get access to it
1:23
English version you can get access to it
1:23
English version you can get access to it using the Amazon it's published using
1:26
using the Amazon it's published using
1:26
using the Amazon it's published using the bppb bpb Publications so let's start
1:30
the bppb bpb Publications so let's start
1:30
the bppb bpb Publications so let's start the session we're going to measure the
1:33
the session we're going to measure the
1:33
the session we're going to measure the architecture
1:35
architecture characteristics uh before focusing on
1:37
characteristics uh before focusing on
1:37
characteristics uh before focusing on architecture characteristics let's
1:39
architecture characteristics let's
1:39
architecture characteristics let's clarify some Concepts when we're talking
1:42
clarify some Concepts when we're talking
1:42
clarify some Concepts when we're talking about the software architecture of
1:44
about the software architecture of
1:44
about the software architecture of course we're talking about four
1:46
course we're talking about four
1:46
course we're talking about four different dimensions First Dimension is
1:48
different dimensions First Dimension is
1:48
different dimensions First Dimension is the
1:50
the AR uh use in our uh software
1:55
AR uh use in our uh software
1:55
AR uh use in our uh software the today are microservices or kernel
1:58
the today are microservices or kernel
1:58
the today are microservices or kernel based architecture Styles or layer or
2:02
based architecture Styles or layer or
2:02
based architecture Styles or layer or tired architectur Styles all these
2:05
tired architectur Styles all these
2:05
tired architectur Styles all these samples are architecture style they are
2:08
samples are architecture style they are
2:08
samples are architecture style they are not our architecture they're just our
2:10
not our architecture they're just our
2:10
not our architecture they're just our architecture style in our architecture
2:13
architecture style in our architecture
2:13
architecture style in our architecture we have three other dimensions that we
2:15
we have three other dimensions that we
2:15
we have three other dimensions that we need to focus on them and clarify them
2:17
need to focus on them and clarify them
2:18
need to focus on them and clarify them in order to have a good software which
2:21
in order to have a good software which
2:21
in order to have a good software which is uh which is based on the business
2:24
is uh which is based on the business
2:24
is uh which is based on the business requirements and business needs the
2:27
requirements and business needs the
2:27
requirements and business needs the second uh dimension in architecture is
2:29
second uh dimension in architecture is
2:29
second uh dimension in architecture is architecture
2:31
architecture characteristics such as the performance
2:34
characteristics such as the performance
2:34
characteristics such as the performance agility testability
2:36
agility testability deployability uh I don't know
2:38
deployability uh I don't know
2:38
deployability uh I don't know scalability elasticity all these
2:41
scalability elasticity all these
2:41
scalability elasticity all these characteristics uh needs to be anal
2:43
characteristics uh needs to be anal
2:43
characteristics uh needs to be anal analyzed in a software based on the
2:46
analyzed in a software based on the
2:46
analyzed in a software based on the requirements we need to uh measure them
2:49
requirements we need to uh measure them
2:49
requirements we need to uh measure them we need to find them and answer this
2:53
we need to find them and answer this
2:53
we need to find them and answer this question why they're important and how
2:55
question why they're important and how
2:55
question why they're important and how they will affect
2:57
they will affect our software the third uh Dimension is
3:01
our software the third uh Dimension is
3:01
our software the third uh Dimension is about the architectural decisions which
3:03
about the architectural decisions which
3:03
about the architectural decisions which are our
3:05
are our hard going to design the red lines our
3:08
hard going to design the red lines our
3:08
hard going to design the red lines our architecture and the four uh Dimension
3:11
architecture and the four uh Dimension
3:11
architecture and the four uh Dimension is the design principles which is the uh
3:14
is the design principles which is the uh
3:14
is the design principles which is the uh soft
3:16
soft rules where we can Define the variant in
3:19
rules where we can Define the variant in
3:19
rules where we can Define the variant in our architectures okay with this
3:21
our architectures okay with this
3:21
our architectures okay with this introductions specifically again I said
3:23
introductions specifically again I said
3:23
introductions specifically again I said that in session I'm going to talk about
3:25
that in session I'm going to talk about
3:25
that in session I'm going to talk about only about the architecture
3:26
only about the architecture
3:26
only about the architecture characteristics and uh specifically
3:30
characteristics and uh specifically
3:30
characteristics and uh specifically again we're going to talk about
3:32
again we're going to talk about
3:32
again we're going to talk about measuring the architecture
3:34
measuring the architecture
3:34
measuring the architecture characteristics so you can now find out
3:37
characteristics so you can now find out
3:37
characteristics so you can now find out that it's very
3:39
that it's very little uh world of discussions as we're
3:42
little uh world of discussions as we're
3:42
little uh world of discussions as we're going to focus on it so there there are
3:45
going to focus on it so there there are
3:45
going to focus on it so there there are many more other Concepts and discussions
3:47
many more other Concepts and discussions
3:47
many more other Concepts and discussions you need to find find them you need to
3:49
you need to find find them you need to
3:49
you need to find find them you need to analyze them you have good information
3:51
analyze them you have good information
3:51
analyze them you have good information about them about measure architecture
3:53
about them about measure architecture
3:53
about them about measure architecture characteristics we have uh of course
3:56
characteristics we have uh of course
3:56
characteristics we have uh of course many problems while we are interacting
3:58
many problems while we are interacting
3:58
many problems while we are interacting the architecture characteristics one
4:01
the architecture characteristics one
4:01
the architecture characteristics one very important important problems uh is
4:05
very important important problems uh is
4:05
very important important problems uh is the uh fact that these architecture
4:09
the uh fact that these architecture
4:09
the uh fact that these architecture characteristics are not physics it means
4:11
characteristics are not physics it means
4:11
characteristics are not physics it means that we cannot touch them when we cannot
4:13
that we cannot touch them when we cannot
4:13
that we cannot touch them when we cannot touch them it means that we can uh we
4:16
touch them it means that we can uh we
4:16
touch them it means that we can uh we will not have very uh rigid information
4:19
will not have very uh rigid information
4:19
will not have very uh rigid information information about the software
4:20
information about the software
4:20
information about the software characteristics of course when we do not
4:22
characteristics of course when we do not
4:23
characteristics of course when we do not have any rigid information about or when
4:25
have any rigid information about or when
4:25
have any rigid information about or when we cannot touch something there might be
4:27
we cannot touch something there might be
4:28
we cannot touch something there might be some ambiguity about that con for
4:30
some ambiguity about that con for
4:30
some ambiguity about that con for example when we're talking about agility
4:32
example when we're talking about agility
4:33
example when we're talking about agility uh it's very important to know that how
4:36
uh it's very important to know that how
4:36
uh it's very important to know that how does the architect going through
4:37
does the architect going through
4:37
does the architect going through architect design architect software for
4:40
architect design architect software for
4:40
architect design architect software for agility we cannot touch the agility we
4:43
agility we cannot touch the agility we
4:43
agility we cannot touch the agility we have
4:43
have no uh we have no uh previous
4:48
no uh we have no uh previous
4:48
no uh we have no uh previous understanding about agility so we need
4:49
understanding about agility so we need
4:49
understanding about agility so we need to describe it we need to clarify it uh
4:52
to describe it we need to clarify it uh
4:52
to describe it we need to clarify it uh and we need to resolve this ambiguity
4:55
and we need to resolve this ambiguity
4:55
and we need to resolve this ambiguity around this concept the second problem
4:57
around this concept the second problem
4:57
around this concept the second problem around the uh def of architecture
5:00
around the uh def of architecture
5:00
around the uh def of architecture characteristics is that there might be a
5:04
characteristics is that there might be a
5:04
characteristics is that there might be a varying of definitions around some
5:06
varying of definitions around some
5:06
varying of definitions around some concepts for example when we're talking
5:08
concepts for example when we're talking
5:08
concepts for example when we're talking about performance the different roles in
5:11
about performance the different roles in
5:11
about performance the different roles in our teams might have their own
5:13
our teams might have their own
5:13
our teams might have their own definitions and their own understandings
5:15
definitions and their own understandings
5:15
definitions and their own understandings around performance software
5:17
around performance software
5:17
around performance software architectures might see performance as
5:21
architectures might see performance as
5:21
architectures might see performance as something which is uh totally different
5:23
something which is uh totally different
5:23
something which is uh totally different from what a software developers is about
5:27
from what a software developers is about
5:27
from what a software developers is about performance so we need to get into
5:30
performance so we need to get into
5:30
performance so we need to get into common definition we need to put all
5:32
common definition we need to put all
5:32
common definition we need to put all other team members or all other
5:34
other team members or all other
5:34
other team members or all other stakeholders on the same page to have a
5:38
stakeholders on the same page to have a
5:38
stakeholders on the same page to have a common definitions around the concepts
5:40
common definitions around the concepts
5:40
common definitions around the concepts and the third problem is that some uh
5:43
and the third problem is that some uh
5:43
and the third problem is that some uh characteristics might be too
5:49
composite the agility might be composed of different
5:52
agility might be composed of different
5:52
agility might be composed of different characteristics such as modularity
5:55
characteristics such as modularity
5:55
characteristics such as modularity deployability testability or other
5:57
deployability testability or other
5:57
deployability testability or other characteristics which means that all
5:59
characteristics which means that all
5:59
characteristics which means that all these characteristics when we put all
6:01
these characteristics when we put all
6:01
these characteristics when we put all these characteristics together the
6:03
these characteristics together the
6:03
these characteristics together the agility CES into count and and shapes
6:06
agility CES into count and and shapes
6:06
agility CES into count and and shapes its definition so there might be some
6:09
its definition so there might be some
6:10
its definition so there might be some characteristics which are too composite
6:11
characteristics which are too composite
6:11
characteristics which are too composite so we need to again clarify them we need
6:15
so we need to again clarify them we need
6:15
so we need to again clarify them we need to De compose them and Define each
6:19
to De compose them and Define each
6:19
to De compose them and Define each them find the common definition for each
6:22
them find the common definition for each
6:22
them find the common definition for each of these uh characteristics in order to
6:25
of these uh characteristics in order to
6:25
of these uh characteristics in order to solve these problems we need to have
6:28
solve these problems we need to have
6:28
solve these problems we need to have objective definition objective
6:29
objective definition objective
6:30
objective definition objective definitions means that we need to find
6:31
definitions means that we need to find
6:31
definitions means that we need to find our uous language in our team uh uut
6:36
our uous language in our team uh uut
6:36
our uous language in our team uh uut language in this case means that we need
6:39
language in this case means that we need
6:39
language in this case means that we need to have transparency in software
6:42
to have transparency in software
6:42
to have transparency in software architecture uh characteristics
6:44
architecture uh characteristics
6:44
architecture uh characteristics definitions we needs to define the
6:47
definitions we needs to define the
6:47
definitions we needs to define the characteristics we needs to uh find the
6:50
characteristics we needs to uh find the
6:50
characteristics we needs to uh find the start point of them the end point of
6:52
start point of them the end point of
6:52
start point of them the end point of them how to measure them how they
6:54
them how to measure them how they
6:54
them how to measure them how they affects our software then we all need to
6:58
affects our software then we all need to
6:58
affects our software then we all need to uh we all need to CL clarify this
7:00
uh we all need to CL clarify this
7:00
uh we all need to CL clarify this definition our teams and all team
7:01
definition our teams and all team
7:02
definition our teams and all team members must have same information and
7:04
members must have same information and
7:04
members must have same information and same
7:06
same uh must have same definitions around
7:09
uh must have same definitions around
7:09
uh must have same definitions around this uh Concepts so the transparency in
7:12
this uh Concepts so the transparency in
7:12
this uh Concepts so the transparency in software architecture measuring is
7:15
software architecture measuring is
7:15
software architecture measuring is really important that's why we say that
7:17
really important that's why we say that
7:17
really important that's why we say that Viva transparency because without
7:19
Viva transparency because without
7:19
Viva transparency because without transparency of course our software
7:21
transparency of course our software
7:21
transparency of course our software architect architecture might be very uh
7:25
architect architecture might be very uh
7:25
architect architecture might be very uh weak and it might not be uh help ours
7:29
weak and it might not be uh help ours
7:29
weak and it might not be uh help ours overall software design as
7:32
overall software design as
7:32
overall software design as expected uh in order to measure the
7:34
expected uh in order to measure the
7:34
expected uh in order to measure the software architecture characteristics we
7:36
software architecture characteristics we
7:37
software architecture characteristics we have different mechanisms one of that
7:38
have different mechanisms one of that
7:38
have different mechanisms one of that mechanism or one of them one of that
7:41
mechanism or one of them one of that
7:41
mechanism or one of them one of that methods is operational measures of
7:43
methods is operational measures of
7:43
methods is operational measures of course we can use operational measures
7:46
course we can use operational measures
7:46
course we can use operational measures only for the characteristics or for only
7:49
only for the characteristics or for only
7:50
only for the characteristics or for only for measurements which have uh obvious
7:52
for measurements which have uh obvious
7:53
for measurements which have uh obvious direct measurements we have defined for
7:55
direct measurements we have defined for
7:55
direct measurements we have defined for them for example we're talking about
7:57
them for example we're talking about
7:57
them for example we're talking about performance or we're talking about
8:00
performance or we're talking about
8:00
performance or we're talking about scalability uh we have some uh criterias
8:04
scalability uh we have some uh criterias
8:04
scalability uh we have some uh criterias which we can measure them we can plus
8:07
which we can measure them we can plus
8:07
which we can measure them we can plus some numbers together we can use
8:09
some numbers together we can use
8:09
some numbers together we can use different statistical methods and find a
8:13
different statistical methods and find a
8:13
different statistical methods and find a result or find our final measuring
8:17
result or find our final measuring
8:17
result or find our final measuring result uh the main problem why working
8:20
result uh the main problem why working
8:20
result uh the main problem why working with the numbers or main problem where
8:23
with the numbers or main problem where
8:23
with the numbers or main problem where when we working on operational
8:25
when we working on operational
8:25
when we working on operational measurements uh is that is the fact of
8:28
measurements uh is that is the fact of
8:28
measurements uh is that is the fact of outliers in our data of course when for
8:31
outliers in our data of course when for
8:31
outliers in our data of course when for example suppose that we're going to uh
8:34
example suppose that we're going to uh
8:34
example suppose that we're going to uh measure the response time of our
8:36
measure the response time of our
8:36
measure the response time of our applications which might be uh about the
8:39
applications which might be uh about the
8:39
applications which might be uh about the measuring the performance scalability of
8:41
measuring the performance scalability of
8:41
measuring the performance scalability of our applications uh when we're working
8:44
our applications uh when we're working
8:44
our applications uh when we're working response time we might have some date
8:46
response time we might have some date
8:46
response time we might have some date set for example you see that we have
8:48
set for example you see that we have
8:48
set for example you see that we have some date set here the majority of
8:51
some date set here the majority of
8:51
some date set here the majority of numbers is around one but we have one
8:54
numbers is around one but we have one
8:54
numbers is around one but we have one number which is around
8:56
number which is around
8:56
number which is around 10,000s uh if we uh decide to use the
9:00
10,000s uh if we uh decide to use the
9:00
10,000s uh if we uh decide to use the average statistical methods to analyze
9:02
average statistical methods to analyze
9:02
average statistical methods to analyze this data of course our final result
9:04
this data of course our final result
9:04
this data of course our final result will not be
9:06
will not be uh will not be
9:09
uh will not be true true because the majority of our
9:12
true true because the majority of our
9:12
true true because the majority of our data is equal to one but one of them is
9:14
data is equal to one but one of them is
9:14
data is equal to one but one of them is equal to 10,000s okay we're going to use
9:17
equal to 10,000s okay we're going to use
9:17
equal to 10,000s okay we're going to use the average statistical method average
9:20
the average statistical method average
9:20
the average statistical method average uh what does average means average means
9:23
uh what does average means average means
9:23
uh what does average means average means that the majority of data is around some
9:25
that the majority of data is around some
9:25
that the majority of data is around some value okay suppose that we have three
9:28
value okay suppose that we have three
9:28
value okay suppose that we have three one and one
9:30
one and one 10,000 the sum of these values is about
9:33
10,000 the sum of these values is about
9:33
10,000 the sum of these values is about 10,000
9:34
10,000 and3 okay and then dividing it to four
9:38
and3 okay and then dividing it to four
9:38
and3 okay and then dividing it to four will result in a value which is around
9:40
will result in a value which is around
9:40
will result in a value which is around 10,000 it means that it's it's around a
9:43
10,000 it means that it's it's around a
9:43
10,000 it means that it's it's around a value which is not equal or or which is
9:46
value which is not equal or or which is
9:46
value which is not equal or or which is not near the majority of our data so the
9:49
not near the majority of our data so the
9:49
not near the majority of our data so the 10,000 here is our outlier data we need
9:52
10,000 here is our outlier data we need
9:52
10,000 here is our outlier data we need to find that outlayer data omit it from
9:56
to find that outlayer data omit it from
9:56
to find that outlayer data omit it from our analysis and uh calculate our final
10:00
our analysis and uh calculate our final
10:00
our analysis and uh calculate our final result without the out layer data uh I
10:03
result without the out layer data uh I
10:03
result without the out layer data uh I mean that we need to ignore the out
10:05
mean that we need to ignore the out
10:05
mean that we need to ignore the out layer data of course we're not going to
10:07
layer data of course we're not going to
10:07
layer data of course we're not going to totally remove the outlayer data the out
10:09
totally remove the outlayer data the out
10:09
totally remove the outlayer data the out layer data here is very important to us
10:11
layer data here is very important to us
10:11
layer data here is very important to us but in order to calculate the average as
10:14
but in order to calculate the average as
10:14
but in order to calculate the average as we assume that we're going to use the
10:16
we assume that we're going to use the
10:16
we assume that we're going to use the average statistical method to analyze
10:18
average statistical method to analyze
10:18
average statistical method to analyze our data we need to ignore the outlayer
10:21
our data we need to ignore the outlayer
10:21
our data we need to ignore the outlayer data but in further uh analysis we need
10:25
data but in further uh analysis we need
10:25
data but in further uh analysis we need that out layer data of course as you see
10:28
that out layer data of course as you see
10:28
that out layer data of course as you see that using that this same data set sorry
10:32
that using that this same data set sorry
10:32
that using that this same data set sorry using the same data set we calculate the
10:34
using the same data set we calculate the
10:34
using the same data set we calculate the average response time is equal to one
10:36
average response time is equal to one
10:37
average response time is equal to one but we are aware that our minimum
10:39
but we are aware that our minimum
10:39
but we are aware that our minimum average minimum response time is equal
10:41
average minimum response time is equal
10:41
average minimum response time is equal to one and maximum response time is
10:43
to one and maximum response time is
10:43
to one and maximum response time is equal to 10,000 so we're not omit that
10:46
equal to 10,000 so we're not omit that
10:46
equal to 10,000 so we're not omit that we're not remove the outlayer data we
10:48
we're not remove the outlayer data we
10:48
we're not remove the outlayer data we just ignore it in order to calculate our
10:50
just ignore it in order to calculate our
10:50
just ignore it in order to calculate our average data using this mechanism uh
10:53
average data using this mechanism uh
10:53
average data using this mechanism uh while measuring the uh characteristics
10:57
while measuring the uh characteristics
10:57
while measuring the uh characteristics in operational measures we have our
10:59
in operational measures we have our
10:59
in operational measures we have our average that's preserved and we have
11:02
average that's preserved and we have
11:02
average that's preserved and we have more data to be aware of which could be
11:04
more data to be aware of which could be
11:04
more data to be aware of which could be very useful to analysis and to
11:09
very useful to analysis and to
11:09
very useful to analysis and to measure uh as you see while we're
11:11
measure uh as you see while we're
11:11
measure uh as you see while we're working with operational measures we
11:14
working with operational measures we
11:14
working with operational measures we were uh working with statistical
11:16
were uh working with statistical
11:16
were uh working with statistical analysis and we're trying to build our
11:18
analysis and we're trying to build our
11:18
analysis and we're trying to build our statistical statistical models uh while
11:22
statistical statistical models uh while
11:22
statistical statistical models uh while we have our statistic models of course
11:24
we have our statistic models of course
11:24
we have our statistic models of course in the first stages of creating
11:26
in the first stages of creating
11:26
in the first stages of creating statistic models our model might be fade
11:29
statistic models our model might be fade
11:29
statistic models our model might be fade or it might not be fit very well into
11:32
or it might not be fit very well into
11:32
or it might not be fit very well into our data the main reasons for failure of
11:36
our data the main reasons for failure of
11:37
our data the main reasons for failure of our statical models based on that models
11:39
our statical models based on that models
11:39
our statical models based on that models not the model is incorrect or something
11:41
not the model is incorrect or something
11:41
not the model is incorrect or something is a miss both which teams likes to know
11:45
is a miss both which teams likes to know
11:45
is a miss both which teams likes to know in order to make their stat statistical
11:48
in order to make their stat statistical
11:48
in order to make their stat statistical models better and to evolve it over time
11:50
models better and to evolve it over time
11:50
models better and to evolve it over time of course after some portion of time we
11:53
of course after some portion of time we
11:53
of course after some portion of time we will have a very good statistical model
11:56
will have a very good statistical model
11:56
will have a very good statistical model which can fit into our data and which
11:58
which can fit into our data and which
11:58
which can fit into our data and which can uh uh gives us very informative
12:02
can uh uh gives us very informative
12:02
can uh uh gives us very informative information about our characteristic
12:04
information about our characteristic
12:04
information about our characteristic measure this is over this is uh what the
12:08
measure this is over this is uh what the
12:08
measure this is over this is uh what the operational measures work but uh not all
12:11
operational measures work but uh not all
12:11
operational measures work but uh not all the software characteristics are uh
12:15
the software characteristics are uh
12:15
the software characteristics are uh we're not able to of course measure all
12:17
we're not able to of course measure all
12:17
we're not able to of course measure all the software C using operational
12:19
the software C using operational
12:19
the software C using operational measures some of the characteristics are
12:23
measures some of the characteristics are
12:23
measures some of the characteristics are structural measures which are not so
12:25
structural measures which are not so
12:25
structural measures which are not so obvious such as uh performance or
12:29
obvious such as uh performance or
12:29
obvious such as uh performance or which are not obvious such as which are
12:31
which are not obvious such as which are
12:31
which are not obvious such as which are not obvious as performance for example
12:33
not obvious as performance for example
12:33
not obvious as performance for example the complexity when we're uh talking
12:36
the complexity when we're uh talking
12:36
the complexity when we're uh talking about the complexity or the code
12:38
about the complexity or the code
12:38
about the complexity or the code complexity uh we have no operational
12:41
complexity uh we have no operational
12:41
complexity uh we have no operational measure to measure or we we cannot
12:43
measure to measure or we we cannot
12:44
measure to measure or we we cannot design in a statistical model to analyze
12:46
design in a statistical model to analyze
12:46
design in a statistical model to analyze the code complexity this is where the
12:48
the code complexity this is where the
12:48
the code complexity this is where the cyclomatic complexity cames into game
12:52
cyclomatic complexity cames into game
12:52
cyclomatic complexity cames into game using the cyclomatic complexity we can
12:54
using the cyclomatic complexity we can
12:54
using the cyclomatic complexity we can calculate calculate the total complexity
12:57
calculate calculate the total complexity
12:57
calculate calculate the total complexity of our code and of course we can uh we
13:01
of our code and of course we can uh we
13:02
of our code and of course we can uh we can we get into the numbers we can again
13:06
can we get into the numbers we can again
13:06
can we get into the numbers we can again do our operational measures or do on any
13:08
do our operational measures or do on any
13:08
do our operational measures or do on any other statistical measur but the problem
13:10
other statistical measur but the problem
13:10
other statistical measur but the problem here is to create that
13:13
here is to create that
13:13
here is to create that numbers
13:15
numbers uh about the cyclomatic complexity all
13:18
uh about the cyclomatic complexity all
13:18
uh about the cyclomatic complexity all we
13:19
we know we all know that the complexity of
13:21
know we all know that the complexity of
13:22
know we all know that the complexity of course is a Cod smells might have a harm
13:25
course is a Cod smells might have a harm
13:25
course is a Cod smells might have a harm vers might be F over deployability test
13:29
vers might be F over deployability test
13:29
vers might be F over deployability test ability other software characteristics
13:32
ability other software characteristics
13:32
ability other software characteristics we know that the complexity of course is
13:34
we know that the complexity of course is
13:34
we know that the complexity of course is is not a good thing in in our code we
13:37
is not a good thing in in our code we
13:37
is not a good thing in in our code we should uh we should prevent the
13:40
should uh we should prevent the
13:40
should uh we should prevent the complexity in our code before we can
13:43
complexity in our code before we can
13:43
complexity in our code before we can prevent the complexity in our code we
13:46
prevent the complexity in our code we
13:46
prevent the complexity in our code we need to calculate the complexity in our
13:48
need to calculate the complexity in our
13:48
need to calculate the complexity in our code so let's see how we can calculate
13:51
code so let's see how we can calculate
13:51
code so let's see how we can calculate the cyclomatic complexity in our code uh
13:54
the cyclomatic complexity in our code uh
13:54
the cyclomatic complexity in our code uh it's not very hard of course there some
13:56
it's not very hard of course there some
13:56
it's not very hard of course there some formula to calculate the
13:59
formula to calculate the
13:59
formula to calculate the cytic complex codes one of the very
14:03
cytic complex codes one of the very
14:03
cytic complex codes one of the very wellknown formula is the CC is equal to
14:06
wellknown formula is the CC is equal to
14:06
wellknown formula is the CC is equal to e minus n + 2 multip p e is our number
14:11
e minus n + 2 multip p e is our number
14:11
e minus n + 2 multip p e is our number of the edge in our follow graph n is our
14:14
of the edge in our follow graph n is our
14:14
of the edge in our follow graph n is our number of nodes and P is number of
14:17
number of nodes and P is number of
14:17
number of nodes and P is number of connected components or let's say that
14:20
connected components or let's say that
14:21
connected components or let's say that it's number of methods in our code uh
14:24
it's number of methods in our code uh
14:24
it's number of methods in our code uh without any other description let's dive
14:28
without any other description let's dive
14:28
without any other description let's dive into some s to calculate the code
14:31
into some s to calculate the code
14:31
into some s to calculate the code complexity in some sample
14:33
complexity in some sample
14:33
complexity in some sample codes before moving forward there are
14:37
codes before moving forward there are
14:37
codes before moving forward there are two points to note that when we're uh
14:40
two points to note that when we're uh
14:40
two points to note that when we're uh the exit point is directly connected
14:42
the exit point is directly connected
14:42
the exit point is directly connected back to the entry point of course our
14:44
back to the entry point of course our
14:44
back to the entry point of course our method linear methods the exit point is
14:47
method linear methods the exit point is
14:47
method linear methods the exit point is directly connected to the uh entry point
14:51
directly connected to the uh entry point
14:51
directly connected to the uh entry point then we can omit the uh two before p and
14:54
then we can omit the uh two before p and
14:54
then we can omit the uh two before p and our formula can be simplified as e minus
14:57
our formula can be simplified as e minus
14:57
our formula can be simplified as e minus n plus P or when we are
14:59
n plus P or when we are
14:59
n plus P or when we are talking about a single method we are
15:01
talking about a single method we are
15:01
talking about a single method we are going to calculate the code complex in a
15:04
going to calculate the code complex in a
15:04
going to calculate the code complex in a in a single method we can om p and
15:07
in a single method we can om p and
15:07
in a single method we can om p and formula can be simplified as e minus n +
15:10
formula can be simplified as e minus n +
15:10
formula can be simplified as e minus n + 2 about calculating a cyclomatic complex
15:14
2 about calculating a cyclomatic complex
15:14
2 about calculating a cyclomatic complex in class we can use the average
15:16
in class we can use the average
15:16
in class we can use the average complexity between all me and as
15:19
complexity between all me and as
15:19
complexity between all me and as class that's how we can calculate code
15:22
class that's how we can calculate code
15:22
class that's how we can calculate code complexity in a class okay that's okay
15:26
complexity in a class okay that's okay
15:26
complexity in a class okay that's okay and the final Point notes is that the
15:29
and the final Point notes is that the
15:29
and the final Point notes is that the the use case of the complex cyclomatic
15:32
the use case of the complex cyclomatic
15:32
the use case of the complex cyclomatic complexity I mean that where it can help
15:34
complexity I mean that where it can help
15:34
complexity I mean that where it can help out one of the obvious use cases for the
15:37
out one of the obvious use cases for the
15:37
out one of the obvious use cases for the cyclomatic complexity is that the
15:39
cyclomatic complexity is that the
15:40
cyclomatic complexity is that the cyclomatic complexity denotes the number
15:42
cyclomatic complexity denotes the number
15:42
cyclomatic complexity denotes the number of unit test required for the code it's
15:45
of unit test required for the code it's
15:45
of unit test required for the code it's very informative to developers while
15:48
very informative to developers while
15:48
very informative to developers while they needs to find out how many the test
15:52
they needs to find out how many the test
15:52
they needs to find out how many the test they should write for their code and how
15:54
they should write for their code and how
15:54
they should write for their code and how they should design their unit test in
15:57
they should design their unit test in
15:57
they should design their unit test in order to cover the whole code or in
16:00
order to cover the whole code or in
16:00
order to cover the whole code or in order to cover the whole business
16:02
order to cover the whole business
16:02
order to cover the whole business cyclomatic complexity can helps them in
16:05
cyclomatic complexity can helps them in
16:05
cyclomatic complexity can helps them in that position too for example suppose
16:08
that position too for example suppose
16:08
that position too for example suppose this uh code we have a code which is
16:11
this uh code we have a code which is
16:11
this uh code we have a code which is very simple a is equal to 10 some uh one
16:15
very simple a is equal to 10 some uh one
16:15
very simple a is equal to 10 some uh one if a condition here if B is greater than
16:19
if a condition here if B is greater than
16:19
if a condition here if B is greater than C then a is equal to B else a is equal
16:22
C then a is equal to B else a is equal
16:22
C then a is equal to B else a is equal to C then print a c okay in order to
16:25
to C then print a c okay in order to
16:25
to C then print a c okay in order to calculate the cyclomatic complexity for
16:27
calculate the cyclomatic complexity for
16:27
calculate the cyclomatic complexity for this code
16:29
this code uh one of the methods is to design the
16:31
uh one of the methods is to design the
16:31
uh one of the methods is to design the flowchart of our code we have a start
16:33
flowchart of our code we have a start
16:33
flowchart of our code we have a start Point here and end point here after
16:36
Point here and end point here after
16:36
Point here and end point here after starting a is equal to 10 each of these
16:39
starting a is equal to 10 each of these
16:39
starting a is equal to 10 each of these shapes are our uh n in the formula are
16:44
shapes are our uh n in the formula are
16:44
shapes are our uh n in the formula are there our note in the formula which we
16:47
there our note in the formula which we
16:47
there our note in the formula which we discussed about it and each of these
16:49
discussed about it and each of these
16:49
discussed about it and each of these arrows is The Edge Edge in that formula
16:52
arrows is The Edge Edge in that formula
16:52
arrows is The Edge Edge in that formula okay we have a is equal to 10 we have a
16:56
okay we have a is equal to 10 we have a
16:56
okay we have a is equal to 10 we have a condition note here B greater than C
16:59
condition note here B greater than C
16:59
condition note here B greater than C it might goes to a is equal to b or when
17:02
it might goes to a is equal to b or when
17:02
it might goes to a is equal to b or when B is not greater than C A is equal to C
17:05
B is not greater than C A is equal to C
17:05
B is not greater than C A is equal to C and then print and finish okay how many
17:08
and then print and finish okay how many
17:08
and then print and finish okay how many nodes do we have here we have one two
17:11
nodes do we have here we have one two
17:11
nodes do we have here we have one two three four five six seven nodes okay and
17:14
three four five six seven nodes okay and
17:14
three four five six seven nodes okay and how many edges do we have here I mean
17:16
how many edges do we have here I mean
17:16
how many edges do we have here I mean how many uh Arrow we have in this flow
17:19
how many uh Arrow we have in this flow
17:19
how many uh Arrow we have in this flow chart let's count the arrows we have one
17:22
chart let's count the arrows we have one
17:22
chart let's count the arrows we have one two three four five six and seven EDS
17:25
two three four five six and seven EDS
17:25
two three four five six and seven EDS here what was the formula formula was e
17:28
here what was the formula formula was e
17:28
here what was the formula formula was e minus n plus 2 multiply p e is seven
17:31
minus n plus 2 multiply p e is seven
17:31
minus n plus 2 multiply p e is seven number of Edge and again is the number
17:34
number of Edge and again is the number
17:34
number of Edge and again is the number of nodes which is again seven 7 - 7 is
17:38
of nodes which is again seven 7 - 7 is
17:38
of nodes which is again seven 7 - 7 is equal to Z to 0 + 2 multiply 1 why one
17:42
equal to Z to 0 + 2 multiply 1 why one
17:42
equal to Z to 0 + 2 multiply 1 why one because we're going to calculate the
17:45
because we're going to calculate the
17:45
because we're going to calculate the cyclomatic complex in single me it's the
17:47
cyclomatic complex in single me it's the
17:47
cyclomatic complex in single me it's the single method that we're going to
17:49
single method that we're going to
17:49
single method that we're going to calculate p is equal to
17:51
calculate p is equal to
17:51
calculate p is equal to one the final result or our Cc or catic
17:55
one the final result or our Cc or catic
17:55
one the final result or our Cc or catic complex in this code is equal to two
17:58
complex in this code is equal to two
17:58
complex in this code is equal to two which it's means that we have we need
18:01
which it's means that we have we need
18:01
which it's means that we have we need two unit tests right in order to cover
18:04
two unit tests right in order to cover
18:04
two unit tests right in order to cover this code it's very simple we need one
18:06
this code it's very simple we need one
18:06
this code it's very simple we need one unit test to test that the uh B is
18:11
unit test to test that the uh B is
18:11
unit test to test that the uh B is greater than Z Ro and we need other unit
18:14
greater than Z Ro and we need other unit
18:14
greater than Z Ro and we need other unit tests to cover the B is not greater than
18:17
tests to cover the B is not greater than
18:17
tests to cover the B is not greater than zero it's very easy to calculate cycl
18:19
zero it's very easy to calculate cycl
18:20
zero it's very easy to calculate cycl complexity and get uh many information
18:22
complexity and get uh many information
18:22
complexity and get uh many information from uh the code and the other
18:25
from uh the code and the other
18:25
from uh the code and the other information okay let's uh move on the
18:27
information okay let's uh move on the
18:27
information okay let's uh move on the other example we have some
18:29
other example we have some
18:29
other example we have some uh some other code we have if condition
18:33
uh some other code we have if condition
18:33
uh some other code we have if condition here which there's another if nested
18:36
here which there's another if nested
18:36
here which there's another if nested inside it and something else okay let's
18:40
inside it and something else okay let's
18:40
inside it and something else okay let's create the flowart for that code we have
18:43
create the flowart for that code we have
18:43
create the flowart for that code we have start and finish Point here a is equal
18:46
start and finish Point here a is equal
18:46
start and finish Point here a is equal to uh there's a condition point if a is
18:49
to uh there's a condition point if a is
18:49
to uh there's a condition point if a is equal to
18:50
equal to 345 then the B is greater than Z is
18:54
345 then the B is greater than Z is
18:54
345 then the B is greater than Z is activated other otherwise or else the
18:57
activated other otherwise or else the
18:58
activated other otherwise or else the print a row is activated and the code
19:00
print a row is activated and the code
19:00
print a row is activated and the code goes okay what's the code complex here I
19:03
goes okay what's the code complex here I
19:03
goes okay what's the code complex here I mean what's CC is equal in this code
19:06
mean what's CC is equal in this code
19:06
mean what's CC is equal in this code it's very easy let's count the notes 1 2
19:08
it's very easy let's count the notes 1 2
19:08
it's very easy let's count the notes 1 2 3 4 five 6 7 and the number of edge it's
19:12
3 4 five 6 7 and the number of edge it's
19:13
3 4 five 6 7 and the number of edge it's 1 2 3 4 five 6 78 I think plus 2 multip
19:19
1 2 3 4 five 6 78 I think plus 2 multip
19:19
1 2 3 4 five 6 78 I think plus 2 multip 1 as you see that 8 minus 1 plus 2 is
19:23
1 as you see that 8 minus 1 plus 2 is
19:23
1 as you see that 8 minus 1 plus 2 is equal to three we need three unit
19:25
equal to three we need three unit
19:25
equal to three we need three unit test uh to cover this code of course
19:29
test uh to cover this code of course
19:29
test uh to cover this code of course if the cyclomatic complexity whenever
19:32
if the cyclomatic complexity whenever
19:32
if the cyclomatic complexity whenever the cyclomatic complexity is arises it's
19:35
the cyclomatic complexity is arises it's
19:36
the cyclomatic complexity is arises it's increasing it means that there are some
19:38
increasing it means that there are some
19:38
increasing it means that there are some depth is there are some technical depth
19:40
depth is there are some technical depth
19:40
depth is there are some technical depth inside our codes the greatest the
19:42
inside our codes the greatest the
19:43
inside our codes the greatest the cyclomatic complexity the vest to code
19:45
cyclomatic complexity the vest to code
19:45
cyclomatic complexity the vest to code structures it's very important to not
19:47
structures it's very important to not
19:47
structures it's very important to not that it's not good point for example we
19:50
that it's not good point for example we
19:50
that it's not good point for example we have a code with cyclomatic complex
19:52
have a code with cyclomatic complex
19:52
have a code with cyclomatic complex equal to 100 and we say that yeah you
19:54
equal to 100 and we say that yeah you
19:54
equal to 100 and we say that yeah you see my code is very complex and I'm the
19:57
see my code is very complex and I'm the
19:57
see my code is very complex and I'm the superhero of the no if the codes
20:00
superhero of the no if the codes
20:00
superhero of the no if the codes cyclomatic complexity is equal to 100 it
20:02
cyclomatic complexity is equal to 100 it
20:02
cyclomatic complexity is equal to 100 it means that the codes is is super weak
20:06
means that the codes is is super weak
20:06
means that the codes is is super weak code and
20:07
code and it's there there are many technical
20:10
it's there there are many technical
20:10
it's there there are many technical differ inside that code and we need to
20:11
differ inside that code and we need to
20:11
differ inside that code and we need to refactor that code the lowest cyclomatic
20:15
refactor that code the lowest cyclomatic
20:15
refactor that code the lowest cyclomatic complexity the strongest the structure
20:17
complexity the strongest the structure
20:17
complexity the strongest the structure of codes and very good to have the lower
20:20
of codes and very good to have the lower
20:20
of codes and very good to have the lower cyclomatic complexity inside
20:23
cyclomatic complexity inside
20:23
cyclomatic complexity inside codes uh let's move on to other uh
20:27
codes uh let's move on to other uh
20:27
codes uh let's move on to other uh example to C cating cyclomatic
20:29
example to C cating cyclomatic
20:29
example to C cating cyclomatic complexity we have another simplified
20:33
complexity we have another simplified
20:33
complexity we have another simplified formula to calculate cyclomatic
20:35
formula to calculate cyclomatic
20:35
formula to calculate cyclomatic complexity which is denoted as cc is
20:38
complexity which is denoted as cc is
20:38
complexity which is denoted as cc is equal to p+ one where the p is number of
20:41
equal to p+ one where the p is number of
20:42
equal to p+ one where the p is number of predicates nodes contains in the control
20:45
predicates nodes contains in the control
20:45
predicates nodes contains in the control flow graph without drawing the flow
20:48
flow graph without drawing the flow
20:48
flow graph without drawing the flow chart counting the nodes or counting the
20:50
chart counting the nodes or counting the
20:50
chart counting the nodes or counting the edge we can calculate the cyclomatic
20:53
edge we can calculate the cyclomatic
20:53
edge we can calculate the cyclomatic complexity of over code of course not
20:55
complexity of over code of course not
20:55
complexity of over code of course not all our codes are that simple that we
20:57
all our codes are that simple that we
20:57
all our codes are that simple that we can draw the flowcharts for that for our
21:00
can draw the flowcharts for that for our
21:00
can draw the flowcharts for that for our codes and then it start counting the
21:02
codes and then it start counting the
21:02
codes and then it start counting the nodes and it's not very easy to do this
21:06
nodes and it's not very easy to do this
21:06
nodes and it's not very easy to do this in our uh code or in our code
21:11
in our uh code or in our code
21:11
in our uh code or in our code evaluation this formula cc is equal to P
21:14
evaluation this formula cc is equal to P
21:14
evaluation this formula cc is equal to P plus one is very functional and it's
21:17
plus one is very functional and it's
21:17
plus one is very functional and it's very useful p is the number of
21:20
very useful p is the number of
21:20
very useful p is the number of predicates nodes contains in the Cal
21:22
predicates nodes contains in the Cal
21:22
predicates nodes contains in the Cal flow of code okay we have some codes
21:24
flow of code okay we have some codes
21:25
flow of code okay we have some codes here it's there are main lines of codes
21:27
here it's there are main lines of codes
21:27
here it's there are main lines of codes here it's not very important important
21:28
here it's not very important important
21:28
here it's not very important important let's count the number of predicates
21:30
let's count the number of predicates
21:30
let's count the number of predicates lines in our graph we have one predicate
21:33
lines in our graph we have one predicate
21:33
lines in our graph we have one predicate line here while index is lower than or
21:37
line here while index is lower than or
21:37
line here while index is lower than or equal to n minus one this is condition
21:40
equal to n minus one this is condition
21:40
equal to n minus one this is condition note one we have another picate note
21:44
note one we have another picate note
21:44
note one we have another picate note here it's not important that the
21:45
here it's not important that the
21:45
here it's not important that the predicates nodes are nested or not it's
21:48
predicates nodes are nested or not it's
21:48
predicates nodes are nested or not it's not important while using this formula
21:50
not important while using this formula
21:50
not important while using this formula we're just going to count the predicates
21:52
we're just going to count the predicates
21:52
we're just going to count the predicates nodes without paying paying attention to
21:54
nodes without paying paying attention to
21:54
nodes without paying paying attention to the nesting level of them okay we have n
21:58
the nesting level of them okay we have n
21:59
the nesting level of them okay we have n a person next is equal to zero this
22:01
a person next is equal to zero this
22:01
a person next is equal to zero this conditional note again and we have the
22:03
conditional note again and we have the
22:03
conditional note again and we have the third predicate note here which is the
22:06
third predicate note here which is the
22:06
third predicate note here which is the index is equal to n this conditional Noe
22:09
index is equal to n this conditional Noe
22:09
index is equal to n this conditional Noe number three so what's our cyclomatic
22:13
number three so what's our cyclomatic
22:13
number three so what's our cyclomatic complexity easy p+ one p number of
22:16
complexity easy p+ one p number of
22:16
complexity easy p+ one p number of predicates notes is equal to three 3 + 1
22:19
predicates notes is equal to three 3 + 1
22:19
predicates notes is equal to three 3 + 1 is equal to four it's four unit test for
22:22
is equal to four it's four unit test for
22:23
is equal to four it's four unit test for we need four unit test to cover this
22:26
we need four unit test to cover this
22:26
we need four unit test to cover this codes or in other uh definition we can
22:29
codes or in other uh definition we can
22:29
codes or in other uh definition we can say that there are four different roads
22:34
say that there are four different roads
22:34
say that there are four different roads to execute this code one of the very
22:38
to execute this code one of the very
22:38
to execute this code one of the very important definition of cyclomatic
22:40
important definition of cyclomatic
22:40
important definition of cyclomatic complexity is the number of roads to
22:42
complexity is the number of roads to
22:42
complexity is the number of roads to execute that
22:44
execute that code cyclomatic complex here is four it
22:46
code cyclomatic complex here is four it
22:46
code cyclomatic complex here is four it means that we have four different and
22:49
means that we have four different and
22:49
means that we have four different and four unique roads to execute our codes
22:53
four unique roads to execute our codes
22:53
four unique roads to execute our codes of course when we have four unique roads
22:56
of course when we have four unique roads
22:56
of course when we have four unique roads it means that we need four unit test we
22:59
it means that we need four unit test we
22:59
it means that we need four unit test we needs to write a unit test we need to
23:01
needs to write a unit test we need to
23:01
needs to write a unit test we need to write a unit test for each our uh uni
23:05
write a unit test for each our uh uni
23:05
write a unit test for each our uh uni Cod it's very easy okay let's go to
23:08
Cod it's very easy okay let's go to
23:08
Cod it's very easy okay let's go to other example oh we have another code
23:11
other example oh we have another code
23:11
other example oh we have another code here oh my God uh there are something in
23:14
here oh my God uh there are something in
23:14
here oh my God uh there are something in the a screen I'm not going to uh read
23:17
the a screen I'm not going to uh read
23:17
the a screen I'm not going to uh read the code at all let's calculate the
23:19
the code at all let's calculate the
23:19
the code at all let's calculate the cyclomatic complexity here oh we're
23:23
cyclomatic complexity here oh we're
23:23
cyclomatic complexity here oh we're going to uh find out another method to
23:28
going to uh find out another method to
23:28
going to uh find out another method to count to calculating cyclomatic
23:29
count to calculating cyclomatic
23:29
count to calculating cyclomatic complexity we can put line numbers in
23:32
complexity we can put line numbers in
23:32
complexity we can put line numbers in our codes starting from one to 15 for
23:35
our codes starting from one to 15 for
23:35
our codes starting from one to 15 for example of course the variable
23:37
example of course the variable
23:37
example of course the variable declaration lines are not counted let's
23:40
declaration lines are not counted let's
23:40
declaration lines are not counted let's see how this one works we have line
23:42
see how this one works we have line
23:42
see how this one works we have line number one two three there are all
23:45
number one two three there are all
23:45
number one two three there are all executed sequentially there are not
23:47
executed sequentially there are not
23:47
executed sequentially there are not predicate noes here so it's not
23:49
predicate noes here so it's not
23:49
predicate noes here so it's not important we put one two three in same
23:52
important we put one two three in same
23:52
important we put one two three in same shape after executing 1 two three we're
23:55
shape after executing 1 two three we're
23:55
shape after executing 1 two three we're going to line number four in line number
23:57
going to line number four in line number
23:57
going to line number four in line number four we have two options we can jump
24:00
four we have two options we can jump
24:00
four we have two options we can jump into line number 13 we can jump from
24:03
into line number 13 we can jump from
24:04
into line number 13 we can jump from line number four to line number 13 if
24:07
line number four to line number 13 if
24:07
line number four to line number 13 if the index is not lower than or equal to
24:10
the index is not lower than or equal to
24:10
the index is not lower than or equal to n minus one then we will jump into line
24:12
n minus one then we will jump into line
24:12
n minus one then we will jump into line number 13 or if the condition is correct
24:15
number 13 or if the condition is correct
24:15
number 13 or if the condition is correct from n line number four we will jump
24:18
from n line number four we will jump
24:18
from n line number four we will jump into line number five and line number
24:20
into line number five and line number
24:20
into line number five and line number six and this analysis continues until we
24:23
six and this analysis continues until we
24:23
six and this analysis continues until we reach the end of our method so uh how we
24:27
reach the end of our method so uh how we
24:27
reach the end of our method so uh how we can use this graph have to calculate the
24:29
can use this graph have to calculate the
24:29
can use this graph have to calculate the code complexity e minus n + 2 mtip p how
24:35
code complexity e minus n + 2 mtip p how
24:35
code complexity e minus n + 2 mtip p how many edges do we have here let's count
24:37
many edges do we have here let's count
24:37
many edges do we have here let's count the arrows we have 10 arrow in this
24:39
the arrows we have 10 arrow in this
24:39
the arrows we have 10 arrow in this shape and how many in this uh graph and
24:42
shape and how many in this uh graph and
24:43
shape and how many in this uh graph and how many shape do we have here we have
24:45
how many shape do we have here we have
24:45
how many shape do we have here we have eight shapes 10 minus 8 + 2 is equal to
24:49
eight shapes 10 minus 8 + 2 is equal to
24:49
eight shapes 10 minus 8 + 2 is equal to four without using the graph we can use
24:52
four without using the graph we can use
24:52
four without using the graph we can use the previous Formula p+ One how many
24:54
the previous Formula p+ One how many
24:55
the previous Formula p+ One how many predicates do we have we have while if
24:57
predicates do we have we have while if
24:57
predicates do we have we have while if and if we have three per gate plus one
25:00
and if we have three per gate plus one
25:00
and if we have three per gate plus one is equal to four our cyclomatic complex
25:03
is equal to four our cyclomatic complex
25:03
is equal to four our cyclomatic complex this code is four again what does it
25:04
this code is four again what does it
25:04
this code is four again what does it mean it means that there are four uni
25:07
mean it means that there are four uni
25:07
mean it means that there are four uni RADS to execute these codes it means
25:10
RADS to execute these codes it means
25:10
RADS to execute these codes it means that we need four unit tests to cover
25:12
that we need four unit tests to cover
25:12
that we need four unit tests to cover the all execution roads in this
25:15
the all execution roads in this
25:15
the all execution roads in this code uh let's see other example uh it's
25:19
code uh let's see other example uh it's
25:19
code uh let's see other example uh it's very easy to calculate cycl complexity
25:21
very easy to calculate cycl complexity
25:21
very easy to calculate cycl complexity in this code of course this uh code
25:23
in this code of course this uh code
25:23
in this code of course this uh code example is the gate uh
25:26
example is the gate uh
25:26
example is the gate uh cs24 exams question
25:28
cs24 exams question let's calculate the codee complex
25:31
let's calculate the codee complex
25:31
let's calculate the codee complex example we can uh draw the graph from
25:35
example we can uh draw the graph from
25:35
example we can uh draw the graph from line number one we have option to jump
25:37
line number one we have option to jump
25:37
line number one we have option to jump into line number uh six or we can Fair
25:41
into line number uh six or we can Fair
25:41
into line number uh six or we can Fair the execution to line number two or
25:44
the execution to line number two or
25:44
the execution to line number two or three uh again from line number two or
25:47
three uh again from line number two or
25:47
three uh again from line number two or three there there's a if condition there
25:49
three there there's a if condition there
25:49
three there there's a if condition there we can jump into line number five or we
25:51
we can jump into line number five or we
25:51
we can jump into line number five or we can further to line number
25:53
can further to line number
25:53
can further to line number four we reach the end of our uh lines B
25:58
four we reach the end of our uh lines B
25:58
four we reach the end of our uh lines B complex here number of edge minus number
26:01
complex here number of edge minus number
26:01
complex here number of edge minus number of uh nodes plus two plus two plus two
26:05
of uh nodes plus two plus two plus two
26:05
of uh nodes plus two plus two plus two multip P equal three or P plus one
26:08
multip P equal three or P plus one
26:08
multip P equal three or P plus one number of predicates how many predicates
26:09
number of predicates how many predicates
26:10
number of predicates how many predicates do we have in the screen while and if we
26:12
do we have in the screen while and if we
26:12
do we have in the screen while and if we have two predicates plus one is equal to
26:14
have two predicates plus one is equal to
26:14
have two predicates plus one is equal to three our Cy complex in code is equal to
26:18
three our Cy complex in code is equal to
26:18
three our Cy complex in code is equal to three uh let's see another example where
26:21
three uh let's see another example where
26:21
three uh let's see another example where we have a loop here what's our
26:24
we have a loop here what's our
26:24
we have a loop here what's our cyclomatic complex here it's not
26:26
cyclomatic complex here it's not
26:26
cyclomatic complex here it's not important that we have four in our code
26:29
important that we have four in our code
26:29
important that we have four in our code or we have if condition our code we have
26:32
or we have if condition our code we have
26:32
or we have if condition our code we have Su expression they're not toally
26:34
Su expression they're not toally
26:34
Su expression they're not toally important the predicate here is the key
26:37
important the predicate here is the key
26:37
important the predicate here is the key to calculate a cyclomatic complexity how
26:39
to calculate a cyclomatic complexity how
26:39
to calculate a cyclomatic complexity how many predicates do we have in the screen
26:42
many predicates do we have in the screen
26:42
many predicates do we have in the screen predicate number one over four predicate
26:44
predicate number one over four predicate
26:44
predicate number one over four predicate number two a is equal to B it's very
26:47
number two a is equal to B it's very
26:47
number two a is equal to B it's very important to note that when we're going
26:49
important to note that when we're going
26:49
important to note that when we're going to com combine the if conditions using
26:51
to com combine the if conditions using
26:51
to com combine the if conditions using and or Expressions they will be counted
26:54
and or Expressions they will be counted
26:54
and or Expressions they will be counted as separate predicates okay predicate
26:57
as separate predicates okay predicate
26:57
as separate predicates okay predicate number 2 a is equal to B and predicate
27:00
number 2 a is equal to B and predicate
27:00
number 2 a is equal to B and predicate number three B is equal to C and final
27:03
number three B is equal to C and final
27:03
number three B is equal to C and final predicate else if a is not equal to
27:07
predicate else if a is not equal to
27:07
predicate else if a is not equal to B uh then we have else if in our codes
27:10
B uh then we have else if in our codes
27:10
B uh then we have else if in our codes it will be counted as predicate but if
27:13
it will be counted as predicate but if
27:13
it will be counted as predicate but if it would be if it was else only it it's
27:17
it would be if it was else only it it's
27:17
it would be if it was else only it it's not predicate at all because else
27:19
not predicate at all because else
27:19
not predicate at all because else predicates is counted in previous if a
27:22
predicates is counted in previous if a
27:22
predicates is counted in previous if a statement so here in this go how many
27:24
statement so here in this go how many
27:24
statement so here in this go how many predicate do we have predicate number
27:26
predicate do we have predicate number
27:26
predicate do we have predicate number 144 a is equal to B B is equal to C and
27:29
144 a is equal to B B is equal to C and
27:29
144 a is equal to B B is equal to C and A is not equal to B we have four
27:31
A is not equal to B we have four
27:31
A is not equal to B we have four predicates in screen the cycl complex is
27:34
predicates in screen the cycl complex is
27:34
predicates in screen the cycl complex is equal to
27:38
five uh example of calculating cycla
27:41
uh example of calculating cycla
27:41
uh example of calculating cycla complexity uh we have some code here oh
27:44
complexity uh we have some code here oh
27:44
complexity uh we have some code here oh my god of course I'm not going to read
27:47
my god of course I'm not going to read
27:48
my god of course I'm not going to read this code uh but my col comes to me and
27:51
this code uh but my col comes to me and
27:51
this code uh but my col comes to me and asks me that whether this code is good
27:53
asks me that whether this code is good
27:54
asks me that whether this code is good code or not where whether this code is
27:56
code or not where whether this code is
27:56
code or not where whether this code is complex code or not where this code uh
27:59
complex code or not where this code uh
27:59
complex code or not where this code uh is there any technical depth in this
28:01
is there any technical depth in this
28:01
is there any technical depth in this code or not I need to calculate
28:05
code or not I need to calculate
28:05
code or not I need to calculate different measures one of them is
28:07
different measures one of them is
28:07
different measures one of them is cyclomatic complexity from cyclomatic
28:09
cyclomatic complexity from cyclomatic
28:09
cyclomatic complexity from cyclomatic complexity Viewpoint I can say that this
28:12
complexity Viewpoint I can say that this
28:12
complexity Viewpoint I can say that this code uh is complex or not but I need to
28:17
code uh is complex or not but I need to
28:17
code uh is complex or not but I need to quantify this qualification in order to
28:20
quantify this qualification in order to
28:20
quantify this qualification in order to calculate my complexity P plus two one
28:23
calculate my complexity P plus two one
28:23
calculate my complexity P plus two one number of predicates for each one if two
28:26
number of predicates for each one if two
28:26
number of predicates for each one if two and the third if here three we have
28:28
and the third if here three we have
28:28
and the third if here three we have three perate 3 + 1 is equal to four so
28:32
three perate 3 + 1 is equal to four so
28:32
three perate 3 + 1 is equal to four so from cyclomatic complexity view of point
28:35
from cyclomatic complexity view of point
28:35
from cyclomatic complexity view of point I can say that this code is a good code
28:37
I can say that this code is a good code
28:37
I can say that this code is a good code it's not very complex code again I note
28:41
it's not very complex code again I note
28:41
it's not very complex code again I note that from cyclomatic complexity point of
28:44
that from cyclomatic complexity point of
28:44
that from cyclomatic complexity point of you this code is not complex we have
28:46
you this code is not complex we have
28:46
you this code is not complex we have other measures to uh consider when we're
28:50
other measures to uh consider when we're
28:50
other measures to uh consider when we're when we're talking about technical deps
28:53
when we're talking about technical deps
28:53
when we're talking about technical deps there are many different measures we
28:55
there are many different measures we
28:55
there are many different measures we need to calculate one of them is
28:56
need to calculate one of them is
28:56
need to calculate one of them is cyclomatic complexity the other one is
28:58
cyclomatic complexity the other one is
28:58
cyclomatic complexity the other one is lines of code the depths of inheritance
29:00
lines of code the depths of inheritance
29:00
lines of code the depths of inheritance and the other uh factors we need to
29:03
and the other uh factors we need to
29:03
and the other uh factors we need to calculate and paying attention uh to
29:06
calculate and paying attention uh to
29:06
calculate and paying attention uh to them but from cyclomatic complex points
29:09
them but from cyclomatic complex points
29:09
them but from cyclomatic complex points of view this code seems to be good code
29:13
of view this code seems to be good code
29:13
of view this code seems to be good code but from lines of code if I I need to
29:16
but from lines of code if I I need to
29:16
but from lines of code if I I need to analyze this code from
29:19
analyze this code from
29:19
analyze this code from the of view of course this is not good
29:23
the of view of course this is not good
29:23
the of view of course this is not good code okay uh what's good value for
29:27
code okay uh what's good value for
29:27
code okay uh what's good value for cyclomatic comp
29:28
cyclomatic comp of course finding the good value for
29:31
of course finding the good value for
29:31
of course finding the good value for cyclomatic complexity have direct
29:33
cyclomatic complexity have direct
29:33
cyclomatic complexity have direct relation with the problem area we're
29:35
relation with the problem area we're
29:35
relation with the problem area we're working on uh sometimes we're working on
29:38
working on uh sometimes we're working on
29:38
working on uh sometimes we're working on a problem on a complex problem which has
29:42
a problem on a complex problem which has
29:42
a problem on a complex problem which has only one complex solution so when uh we
29:48
only one complex solution so when uh we
29:48
only one complex solution so when uh we have no other way to solve a problem
29:50
have no other way to solve a problem
29:50
have no other way to solve a problem other than that complex solution then
29:53
other than that complex solution then
29:53
other than that complex solution then the the highy cyclomatic complexity for
29:56
the the highy cyclomatic complexity for
29:56
the the highy cyclomatic complexity for that solution would be
30:00
that solution would be
30:00
that solution would be okay which can have a solution with
30:05
okay which can have a solution with
30:05
okay which can have a solution with lower cyclomatic complexity but we
30:07
lower cyclomatic complexity but we
30:07
lower cyclomatic complexity but we achieve the cyclomatic comp with the
30:09
achieve the cyclomatic comp with the
30:09
achieve the cyclomatic comp with the high value of course our final result
30:11
high value of course our final result
30:11
high value of course our final result would not be a good result but totally
30:14
would not be a good result but totally
30:14
would not be a good result but totally but totally as a rule of time we can say
30:16
but totally as a rule of time we can say
30:16
but totally as a rule of time we can say that if the pyromatic complexity is
30:18
that if the pyromatic complexity is
30:18
that if the pyromatic complexity is between one and 10 it's a good code the
30:22
between one and 10 it's a good code the
30:22
between one and 10 it's a good code the structure of code and the uh it's it's
30:25
structure of code and the uh it's it's
30:25
structure of code and the uh it's it's Val structures and Val written code
30:28
Val structures and Val written code
30:28
Val structures and Val written code there the code is high testable and cost
30:30
there the code is high testable and cost
30:30
there the code is high testable and cost and affort is less it's a rule of
30:33
and affort is less it's a rule of
30:33
and affort is less it's a rule of time it's a rule of time it might be
30:36
time it's a rule of time it might be
30:36
time it's a rule of time it might be different from Project to the other
30:38
different from Project to the other
30:38
different from Project to the other project and the complexity is between 10
30:40
project and the complexity is between 10
30:40
project and the complexity is between 10 to 20 it means that okay we have some
30:43
to 20 it means that okay we have some
30:43
to 20 it means that okay we have some problems in over Cod the testability is
30:45
problems in over Cod the testability is
30:45
problems in over Cod the testability is going to be affected in negative manner
30:48
going to be affected in negative manner
30:48
going to be affected in negative manner or the cost of forces medium it's it's
30:51
or the cost of forces medium it's it's
30:51
or the cost of forces medium it's it's if it's between 20 and 40 40 it means
30:54
if it's between 20 and 40 40 it means
30:54
if it's between 20 and 40 40 it means that we are facing very complex code the
30:58
that we are facing very complex code the
30:58
that we are facing very complex code the testability is low cost effort are high
31:00
testability is low cost effort are high
31:00
testability is low cost effort are high and if the cyclomatic complexity is
31:03
and if the cyclomatic complexity is
31:03
and if the cyclomatic complexity is greater than V it means that's okay the
31:07
greater than V it means that's okay the
31:07
greater than V it means that's okay the code is not at all testable and uh we
31:11
code is not at all testable and uh we
31:11
code is not at all testable and uh we we're facing with an electronical garage
31:14
we're facing with an electronical garage
31:14
we're facing with an electronical garage we need to of course uh refactor that
31:17
we need to of course uh refactor that
31:17
we need to of course uh refactor that code again I'm going to get back to my
31:20
code again I'm going to get back to my
31:20
code again I'm going to get back to my first expression the desired range or
31:23
first expression the desired range or
31:23
first expression the desired range or the desired value for cyclomatic
31:26
the desired value for cyclomatic
31:26
the desired value for cyclomatic complexity is d directly related to the
31:30
complexity is d directly related to the
31:30
complexity is d directly related to the problem and solution area these numbers
31:34
problem and solution area these numbers
31:34
problem and solution area these numbers these range are rule of time are are
31:36
these range are rule of time are are
31:36
these range are rule of time are are thumb things to be considered as best
31:39
thumb things to be considered as best
31:39
thumb things to be considered as best practice for example there are not hard
31:41
practice for example there are not hard
31:41
practice for example there are not hard rules that we should apply them on Old
31:44
rules that we should apply them on Old
31:44
rules that we should apply them on Old projects no there are rle of times they
31:47
projects no there are rle of times they
31:47
projects no there are rle of times they might their range might be uh smaller or
31:50
might their range might be uh smaller or
31:50
might their range might be uh smaller or bigger in different
31:52
bigger in different projects the final uh method to measure
31:56
projects the final uh method to measure
31:56
projects the final uh method to measure the architecture characteristics is the
31:59
the architecture characteristics is the
31:59
the architecture characteristics is the process
32:00
process measures some other architectural
32:03
measures some other architectural
32:03
measures some other architectural characteristics uh are composed of many
32:07
characteristics uh are composed of many
32:07
characteristics uh are composed of many other
32:09
other characteristic architectural
32:10
characteristic architectural
32:10
characteristic architectural characteristic for example as I said for
32:12
characteristic for example as I said for
32:12
characteristic for example as I said for examp in the agility software
32:15
examp in the agility software
32:15
examp in the agility software architecture the agility might be
32:16
architecture the agility might be
32:16
architecture the agility might be composed of testability and
32:18
composed of testability and
32:18
composed of testability and deployability we need to uh measure
32:21
deployability we need to uh measure
32:21
deployability we need to uh measure testability and deployability in order
32:24
testability and deployability in order
32:24
testability and deployability in order to measure the agility in the top level
32:26
to measure the agility in the top level
32:26
to measure the agility in the top level okay testability can be measured through
32:29
okay testability can be measured through
32:29
okay testability can be measured through the codee coverage testing and we can
32:32
the codee coverage testing and we can
32:32
the codee coverage testing and we can gather the result from code coverage
32:33
gather the result from code coverage
32:33
gather the result from code coverage testing okay but in order to uh
32:37
testing okay but in order to uh
32:37
testing okay but in order to uh calculate the deployability again we
32:39
calculate the deployability again we
32:39
calculate the deployability again we might need to calculate some other inner
32:43
might need to calculate some other inner
32:43
might need to calculate some other inner uh software architect software
32:45
uh software architect software
32:45
uh software architect software architecture characteristics such as the
32:47
architecture characteristics such as the
32:47
architecture characteristics such as the successful or fail deployments it needs
32:50
successful or fail deployments it needs
32:50
successful or fail deployments it needs to measure their uh rate of successful
32:53
to measure their uh rate of successful
32:53
to measure their uh rate of successful or fail deployments in
32:55
or fail deployments in
32:55
or fail deployments in know after measuring deploy liability
32:58
know after measuring deploy liability
32:58
know after measuring deploy liability and measuring testability we can finally
33:00
and measuring testability we can finally
33:00
and measuring testability we can finally measure the testability in our s so we
33:03
measure the testability in our s so we
33:03
measure the testability in our s so we need to measure the whole process in
33:05
need to measure the whole process in
33:05
need to measure the whole process in order to measure of architecture uh in
33:07
order to measure of architecture uh in
33:07
order to measure of architecture uh in order to sum up the discussions in a
33:10
order to sum up the discussions in a
33:10
order to sum up the discussions in a session we introduced the three
33:13
session we introduced the three
33:13
session we introduced the three different measuring methods to measure
33:16
different measuring methods to measure
33:16
different measuring methods to measure architect software architecture
33:17
architect software architecture
33:17
architect software architecture characteristics the operational measures
33:20
characteristics the operational measures
33:20
characteristics the operational measures for example Performance which were going
33:22
for example Performance which were going
33:22
for example Performance which were going to using the architectural models or
33:23
to using the architectural models or
33:23
to using the architectural models or architectural methods structural
33:26
architectural methods structural
33:26
architectural methods structural measures uh for example using the
33:28
measures uh for example using the
33:28
measures uh for example using the cyclomatic complexity there are many
33:31
cyclomatic complexity there are many
33:31
cyclomatic complexity there are many formulas and methods to calculating the
33:34
formulas and methods to calculating the
33:34
formulas and methods to calculating the cyclomatic complexity and the third
33:36
cyclomatic complexity and the third
33:36
cyclomatic complexity and the third methods using the process measure to
33:38
methods using the process measure to
33:38
methods using the process measure to calculating the software architecture
33:41
calculating the software architecture
33:41
calculating the software architecture characteristics I hope that this session
33:44
characteristics I hope that this session
33:44
characteristics I hope that this session would be informative for you in order to
33:46
would be informative for you in order to
33:46
would be informative for you in order to contact me you can use V Point far Jing
33:51
contact me you can use V Point far Jing
33:51
contact me you can use V Point far Jing in order to send me your emails or you
33:53
in order to send me your emails or you
33:53
in order to send me your emails or you can find me in GitHub using V Faron you
33:56
can find me in GitHub using V Faron you
33:56
can find me in GitHub using V Faron you can find me using V LinkedIn V far in
34:01
can find me using V LinkedIn V far in
34:01
can find me using V LinkedIn V far in Instagram Jing in Twitter Twitter or X
34:06
Instagram Jing in Twitter Twitter or X
34:06
Instagram Jing in Twitter Twitter or X you can read my BL Post in Jing
34:08
you can read my BL Post in Jing
34:08
you can read my BL Post in Jing medium.com and you can watch
34:11
medium.com and you can watch
34:11
medium.com and you can watch my uh videos in YouTube using j.net
34:14
my uh videos in YouTube using j.net
34:14
my uh videos in YouTube using j.net YouTube channel I