Vous êtes sur la page 1sur 52

Maciej Lukaszewski | WS 13/14

Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 1


L. Bass, P. Clements, R. Kazman: Software Architecture in Practice
Chapter !:
Architecture Reconstruction an" Conformance
#acie$ Lu%aszews%i
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 2

1& 'tro!uctio
2& Architecture Recostructio (rocess&
2&1& Raw )iew e*tractio
2&2& +ata,ase Costructio
2&3& -iew $usio
2&4& $i!i. -io%atios&
3& /ui!e%ies
4& Su##ar0
A&en"a
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 3

'ntro"uction: wh( reconstruction)
What i" s0ste# a%rea!0 e*ists1
+ocu#etatio %ost1
+ocu#etatio o %o.er s0chroize!1
2he aswer is: re)erse e.ieeri.3
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 4

Architecture reconstruction:
4&&&techi5ues that a%%ow a aa%0st to ,ui%!6 #aitai6
a! u!ersta! a represetatio o" a e*isti.
architecture&&&7
*wo purposes:
8 to !ocu#et a architecture
8 to esure co"or#ace ,etwee as8,ui%t a! as8
!esi.e! architecture
'ntro"uction ''
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 9

Recostructio6 ,ut how1
8 usi. auto#ate! a! se#iauto#ate! e*tractio too%s
8 pro,i. the ori.ia% !esi. itet o" the architect
: co#,iatio o" ,oth techi5ues
: i practise: recostructio ot "u%%0 auto#ate!
'ntro"uction ''
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie ;

$irst: wor%+ench3
(hases:
1& Raw )iew e*tractio
2& +ata,ase costructio
3& -iew "usio a! #aipu%atio&
4& Architecture aa%0sis: "i!i. )io%atios
Architecture Reconstruction Process
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie <

4&&&aa%0zi. a s0ste#=s e*isti. !esi. a! i#p%e#etatio
arti"acts to costruct oe or #ore #o!e%s o" it&7
/oa%s:
8 e*tracti. a tar.et set o" architectura% )iews to support
!ocu#etatio e""ort
8 aswers o 4what co#poets are a""ecte! i" ' rewrite
co#poet A176 4>ow to re"actor %a0eri. to re#o)e c0c%ic
!epe!ecies7
: e%e#ets o" iterest ?"i%es6 "uctios6 )aria,%es@ a! their
re%atioships co#e "ro# source arti"acts ?co!e6 hea!er "i%es6
,ui%! "i%es@
Raw ,iew e-traction
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie A


Source
e%e#et
Re%atio 2ar.et
e%e#et
+escriptio
$i%e ic%u!es $i%e C preprocessor
Bic%u!e o" oe "i%e
,0 aother
"i%e cotais $uctio +e"iitio o" a
"ucio i a "i%e
A t0pica% %ist o" the e%e#ets a! se)era% re%atioships a#o. the#&
Raw ,iew e-traction ''
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie C

2wo cate.ories o" i"or#atio o,taie!:
8 static D o,ser)i. o%0 s0ste# arti"acts
8 !0a#ic D o,ser)i. how the s0ste# rus
/oa%: "usi. ,oth to create #ore accurate
s0ste# )iews
Raw ,iew e-traction '''
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 10

What i" s0ste# cha.es at ruti#e1
: capturi. ruti#e co"i.uratio
Wh0 capturi.1
8 !0a#ic e%e#ets
8 %ate ,i!i.
8 static re)erse e.ieeri. ot possi,%e ?peer828peer6
SEA6 c%ou!@

Raw ,iew e-traction '.
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 12

Last6 ,ut ot %east : re!uce irre%e)at
i"or#atio
F*a#p%e: operati.8s0ste# speci"ic
%i,raries
Raw ,iew e-traction .
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 13

8 stori. e*tracte! i"or#atio i !ata,ase
?%ar.e a#out o" !ata6 #aipu%atios o"
!ata error8proe@
8 whe usi. a work,ech ?set o" too%s@
choosi. a !ata,ase a! !eci!i. o
itera% represetatios o" )iews re5uire!
8 o"te e*tracte! !ata "ro# the co!e too
co#p%e* : white oise
/ata+ase construction
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 14
G
Raw )iews #a0 ,e too speci"ic to ai! i architectura%
u!ersta!i.&
Accurate6 ,ut ot he%p"u%
/ata+ase construction ''
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 19

>ow to "i%ter i"or#atio1
Maipu%ati. )iews ?e&.& hi!i. #etho!s
isi!e c%ass !e"iitios@
Showi. a,stractios ?e&.& i!eti"i.
!istict %a0ers@
/ata+ase construction '''
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 1;

-iews which ha)e ,ee e*tracte! are #aipu%ate! to
create "use! )iews
e&.& static ca%% )iew "use! with !0a#ic ca%% )iew to pro)i!e
#ore accurate i"or#atio a,out the part o" s0ste#
Creati. a "use! )iew H creati. a h0pothesis a,out the
architecture a! a )isua%izatio o" it
8 )iews ca ,e iterprete!6 "urther re"ie!6 or rejecte!
8 o ui)ersa% co#p%etio criteria "or this process
.iew fusion
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 1<

2oo% "or static co!e re)iew writte i Ia)a6 support o"


other pro.ra##i. %a.ua.es p%ae!

4Jri!.i. the .ap ,etwee the architects a!


!e)e%opers7

More http://www&he%%o2#orrow&co#/pro!ucts/soarj
Short e-cursion: Sonar0 1Sonar&raph for 0a,a2
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 1A

Short e-cursion: Sonar0 1Sonar&raph for 0a,a2
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 1C

SoarI e*tracts "acts "ro# a set o" source co!e "i%es a! %ets 0ou !e"ie a
set o" %a0ers a! )ertica% s%ices throu.h those %a0ers&
.iew fusion: e-ample of a fuse" ,iew
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 20

-iew "usio phase .a)e us a %ot o" h0potheses

those i"or# o" architectura% e%e#ets ?%a0ers@6


costraits6 re%atioships

>0potheses ee! to ,e teste! i or!er to check


conformance with architect=s itetio

2wo #ajor possi,i%ities "or #aitaii. co"or#ace


,etwee co!e a! architecture:
8 co"or#ace ,0 costructio
8 co"or#ace ,0 aa%0sis
Architecture anal(sis: fin"in& ,iolations
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 21

(re)ious "i.ure with a!!e! re%atioships a!
costraits6 which ha)e ,ee a!!e! ,0 a architect to
re"%ect !esi. itet&
Architecture anal(sis '': e-ample
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 22

Black Arc: SonarJ has found a
violation. The arc between the
Service layer and JUnit.
Architecture anal(sis '''
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 24

>a)e a .oa% a! a set o" o,jecti)es or 5uestios i #i!


,e"ore u!ertaki. a architecture recostructio project&

E,tai so#e represetatio o" the s0ste# ,e"ore ,e.ii.


the !etai%e! recostructio process&

'!eti"0i. %a0ers is a .oo! p%ace to start

' so#e cases: !isre.ar! the e*isti. !ocu#etatio

2oo%s ca ot !o a%% the work3 ')o%)e#et o" peop%e "a#i%iar


with the s0ste# re5uire!&

3ui"elines
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 29

Architecture recostructio esures that a s0ste# is


,ui%t the wa0 it was !esi.e! a! that it e)o%)es i a
wa0 that is cosistet with !e)e%oper=s itetios&

Recostructio ee!e! whe:


8 !ocu#etatio %ost or out8o"8!ate
8 checki. co"or#ace
8 starti. the ree.ieeri. process to a ew
!esire! architecture
Summar(
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 2;

2he so"tware architecture recostructio


process co#prises the "o%%owi. phases:
8 raw )iew e*tractio
8 !ata,ase costructio
8 )iew "usio
8 architecture aa%0sis
Summar( ''
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 2<

1& What i"ereces ca 0ou #ake a,out a s0ste#=s
#o!u%e structures "ro# e*a#ii. a set o" ,eha)iora%
traces .athere! !0a#ica%%01
/iscussion
Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 2A

2& Suppose 0ou h0pothesize that a s0ste# #akes use o"
particu%ar tactics to achie)e a particu%ar 5ua%it0 attri,ute& $i%% i
the co%u#s o" the ta,%e ,e%ow to show how 0ou wou%! .o a,out
)eri"0i. 0our h0pothesis&
/iscussion
*actics for.. 'ter)iewi.
e*perts o the
s0ste#
Aa%0zi.
structure o"
source co!e
"i%es
Static aa%0sis
o" source co!e
+0a#ic aa%0sis
o" s0ste#=s
e*ecutio
A)ai%a,i%it0
'teropera,i%it0
Mo!i"ia,i%it0
(er"or#ace
Securit0
2esta,i%it0
Ksa,i%it0


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 2

1& 'tro!uctio
2& Architecture Recostructio (rocess&
2&1& Raw )iew e*tractio
2&2& +ata,ase Costructio
2&3& -iew $usio
2&4& $i!i. -io%atios&
3& /ui!e%ies
4& Su##ar0
A&en"a


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 3

'ntro"uction: wh( reconstruction)
What i" s0ste# a%rea!0 e*ists1
+ocu#etatio %ost1
+ocu#etatio o %o.er s0chroize!1
2he aswer is: re)erse e.ieeri.3
'#a.iar0 situatio:
: so "ar !iscusse! architectura% !ecisios to achie)e .oa%s
a! re5uire#ets6 ,ut:
: 0ou co#e to a co#pa0 with so#e co#p%e* so%utios
a%rea!0 worki. a! the architecture ot recor!e! ,0
actua% !e)e%opers1
: s0ste# a%rea!0 e*ists6 ,ut o !ocu#etatio !escri,i.
ori.ia% processes
: !ocu#etatio a)ai%a,%e6 ,ut o %o.er up8to8!ate !ue to
series o" cha.es
>ow to #aitai sucha s0ste# a! test 5uia%it0 attri,utes1



Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 4

Architecture reconstruction:
4&&&techi5ues that a%%ow a aa%0st to ,ui%!6 #aitai6
a! u!ersta! a represetatio o" a e*isti.
architecture&&&7
*wo purposes:
8 to !ocu#et a architecture
8 to esure co"or#ace ,etwee as8,ui%t a! as8
!esi.e! architecture
'ntro"uction ''
' architecture recostructio6 the as8,ui%t architecture o"
a i#p%e#ete! s0ste# is re)erse e.ieere! "ro#
e*isti. s0ste# arti"acts
8 the opposite to "orwar! e.ieeri.: e%e#ets #appe!
to speci"ic i#p%e#etatio e%e#ets ?"uctios6
c%asses6 "i%es6 o,jects@
8 t0pica%%0 its a )er0 too%8itesi)e acti)it0


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 9

Recostructio6 ,ut how1
8 usi. auto#ate! a! se#iauto#ate! e*tractio too%s
8 pro,i. the ori.ia% !esi. itet o" the architect
: co#,iatio o" ,oth techi5ues
: i practise: recostructio ot "u%%0 auto#ate!
'ntro"uction ''
' practise: ot "u%%0 auto#atic6 rather a iterpreti)e6
iteracti)e a! iterati)e process i)o%)i. #a0
acti)ities a! ski%%s o" e*perts a! architects


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie ;

$irst: wor%+ench3
(hases:
1& Raw )iew e*tractio
2& +ata,ase costructio
3& -iew "usio a! #aipu%atio&
4& Architecture aa%0sis: "i!i. )io%atios
Architecture Reconstruction Process
: re5uires ski%%"u%% app%icatio o" too%s6 ot possi,%e
with a si.%e too% 6 e&*& i#p%e#etatios writte i
!i""eret scripti. %a.ua.es6 o too% speaks e)er0
%a.ua.e
: work,ech: too% set D shou%! ,e ope ?eas0 to
ite.rate ew too%s@6 a! pro)i!e a ite.ratio
"ra#ework where,0 ew too%s !ot i#pact
e*isti. !ata a! too%s


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie <

4&&&aa%0zi. a s0ste#=s e*isti. !esi. a! i#p%e#etatio
arti"acts to costruct oe or #ore #o!e%s o" it&7
/oa%s:
8 e*tracti. a tar.et set o" architectura% )iews to support
!ocu#etatio e""ort
8 aswers o 4what co#poets are a""ecte! i" ' rewrite
co#poet A176 4>ow to re"actor %a0eri. to re#o)e c0c%ic
!epe!ecies7
: e%e#ets o" iterest ?"i%es6 "uctios6 )aria,%es@ a! their
re%atioships co#e "ro# source arti"acts ?co!e6 hea!er "i%es6
,ui%! "i%es@
Raw ,iew e-traction


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie A


Source
e%e#et
Re%atio 2ar.et
e%e#et
+escriptio
$i%e ic%u!es $i%e C preprocessor
Bic%u!e o" oe "i%e
,0 aother
"i%e cotais $uctio +e"iitio o" a
"ucio i a "i%e
A t0pica% %ist o" the e%e#ets a! se)era% re%atioships a#o. the#&
Raw ,iew e-traction ''
: 20pica% %ist o" the e%e#ets a! re%atioships that
#i.ht ,e e*tracte!
: each re%atioship .i)es !i""eret i"or#atio a,out
the s0ste#
1& ca%%s D he%ps to ,ui%! a ca%% .raph
2& ic%u!es D set o" !epe!ecies
3& accessLrea! accessLwrite D how !ata is use!
Ftc&


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie C

2wo cate.ories o" i"or#atio o,taie!:
8 static D o,ser)i. o%0 s0ste# arti"acts
8 !0a#ic D o,ser)i. how the s0ste# rus
/oa%: "usi. ,oth to create #ore accurate
s0ste# )iews
Raw ,iew e-traction '''


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 10

What i" s0ste# cha.es at ruti#e1
: capturi. ruti#e co"i.uratio
Wh0 capturi.1
8 !0a#ic e%e#ets
8 %ate ,i!i.
8 static re)erse e.ieeri. ot possi,%e ?peer828peer6
SEA6 c%ou!@

Raw ,iew e-traction '.
So6 What is this 4!0a#ic78thi. a%% a,out1
Wh0 capturi. !0a#ic e%e#ets1
8 !0a#ic e%e#ets8 't #a0 ,e possi,%e that s0ste#
cha.es at ruti#e& ' that case the ruti#e co"i.uratio
shou%! ,e capture! a! use! whe carr0i. out the
recostructio& F*a#p%e: co"i.uratio "i%e rea! i at
startup a! coectios are #a!e or e%e#ets e*ecute!&
8 %ate ,i!i. D #echais# where a #etho! ,ei. ca%%e!
upo a o,ject is %ooke! up ,0 a#e at ruti#e e*&
(o%0#orphis#6 p%u.8is6 poiters&
8 peer828peer6 SEA a! c%ou! co#puti. o%0 !0a#ica%%06
,ecause precise topo%o.0 o" a s0ste# #a0 ot ,e
!eter#ie! uti% ruti#e& 't !epe!s o a)ai%a,i%it06
%oa!i. 6 so caot ,e re)erse e.ieere! usi. static
too%s& 2here"ore too%s that .eerate !0a#ic i"o a,out
the s0ste#&


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 12

Last6 ,ut ot %east : re!uce irre%e)at
i"or#atio
F*a#p%e: operati.8s0ste# speci"ic
%i,raries
Raw ,iew e-traction .
Je"ore %oa!i. a raw )iew ito the
!ata,ase : re#o)e irre%e)at
i"or#atio
$or e*a#p%e: whi%e ,ui%!i. or usi.
%i,raries that are ES8speci"ic6 0ou
#a0 ,e o%0 itereste! i a speci"ic
ES ?e&.& Liu*@ a! !iscar! the
%i,raries "or other p%at"or#s&


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 13

8 stori. e*tracte! i"or#atio i !ata,ase
?%ar.e a#out o" !ata6 #aipu%atios o"
!ata error8proe@
8 whe usi. a work,ech ?set o" too%s@
choosi. a !ata,ase a! !eci!i. o
itera% represetatios o" )iews re5uire!
8 o"te e*tracte! !ata "ro# the co!e too
co#p%e* : white oise
/ata+ase construction


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 14
G Raw )iews #a0 ,e too speci"ic to ai! i architectura%
u!ersta!i.&
Accurate6 ,ut ot he%p"u%
/ata+ase construction ''
White oise: whe e*tracte! !ata
"ro# a co!e cosists o" c%asses
a! #etho!s a! ic%usios a!
ca%%i. re%atios& Fach e%e#et
p%otte! o a .ri!6 a! each re%atio
!raw as a %ie& Accurate )iew6 ,ut
pro)i!es o isi.ht ito structures
:


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 19

>ow to "i%ter i"or#atio1
Maipu%ati. )iews ?e&.& hi!i. #etho!s
isi!e c%ass !e"iitios@
Showi. a,stractios ?e&.& i!eti"i.
!istict %a0ers@
/ata+ase construction '''
Jecause o" white oise : there"ore
#aipu%ati. such raw )iews to
co%%apse i"or#atio ?e*& >i!i.
#etho!s isi!e c%ass !e"iitios@


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 1;

-iews which ha)e ,ee e*tracte! are #aipu%ate! to
create "use! )iews
e&.& static ca%% )iew "use! with !0a#ic ca%% )iew to pro)i!e
#ore accurate i"or#atio a,out the part o" s0ste#
Creati. a "use! )iew H creati. a h0pothesis a,out the
architecture a! a )isua%izatio o" it
8 )iews ca ,e iterprete!6 "urther re"ie!6 or rejecte!
8 o ui)ersa% co#p%etio criteria "or this process
.iew fusion


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 1<

2oo% "or static co!e re)iew writte i Ia)a6 support o"


other pro.ra##i. %a.ua.es p%ae!

4Jri!.i. the .ap ,etwee the architects a!


!e)e%opers7

More http://www&he%%o2#orrow&co#/pro!ucts/soarj
Short e-cursion: Sonar0 1Sonar&raph for 0a,a2


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 1A

Short e-cursion: Sonar0 1Sonar&raph for 0a,a2
: +e,t i!e*: a..re.ate! #etrics to e*p%ai the e""ort to #ake
s0ste# 4c%ea76 4how !i""icu%t to re#o)e a%% wari.s a!
)io%atios7
: the %ies o" co!e etc&
: c0c%icit06 306CAM o" packa.es i)o%)e! i c0c%ic !epe!ecies&
J0 c%icki. o oe6 )isua%isatio o" c0c%e .roup wi%% ,e show
: ,e%ow 4how #a0 spots to cut7 8 to re#o)e to packa.e c0c%es
: other iteresti. #etric: AC+ ?a)era.e co#poet !epe!ec0@
shows how #a0 "i%es are .oi. to ,e a""ecte! i" ' cha.e this
project
: i wari. ,o*6 .eera% wari.s e&.& 1 c0c%e .roup or co!e
!up%icatios ?,0 c%icki. o it6 s0ste# !irect%0 ju#ps to !up%icate!
%ies@


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 1C

SoarI e*tracts "acts "ro# a set o" source co!e "i%es a! %ets 0ou !e"ie a
set o" %a0ers a! )ertica% s%ices throu.h those %a0ers&
.iew fusion: e-ample of a fuse" ,iew
Far%0 resu%ts "ro# the too% SoarI&


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 20

-iew "usio phase .a)e us a %ot o" h0potheses

those i"or# o" architectura% e%e#ets ?%a0ers@6


costraits6 re%atioships

>0potheses ee! to ,e teste! i or!er to check


conformance with architect=s itetio

2wo #ajor possi,i%ities "or #aitaii. co"or#ace


,etwee co!e a! architecture:
8 co"or#ace ,0 costructio
8 co"or#ace ,0 aa%0sis
Architecture anal(sis: fin"in& ,iolations
8 ,0 costructio: auto#atica%%0 .eeratio a su,statia%
part o" the s0ste# ,ase! o a architectura%
speci"icatio& >i.h%0 !esira,%e6 ,ecause too%s
.uaratee co"or#ace& Ca ,e u"ortuete%0 o%0
app%ie! whe e.ieers ca e#p%o0 speci"ic
architecture8,ase! !e)e%op#et too%s6 %a.ua.es& $or
s0ste#s re5uiri. i#p%e#etatio "ro# outsi!e6 this
approach !oes ot app%0
8 ,0 aa%0sis D techi5ue to aa%0ze s0ste# i"or#atio
to #ark oco"or#i. e%e#ets6 so the0 ca ,e "i*e!:
,rou.ht to co"or#ace&


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 21

(re)ious "i.ure with a!!e! re%atioships a!
costraits6 which ha)e ,ee a!!e! ,0 a architect to
re"%ect !esi. itet&
Architecture anal(sis '': e-ample
In this examle! the architect has indicated the
relationshis between the layers.
Usin" these relationshis and constraints! a tool
such as SonarJ is able to automatically detect and
reort violations of the layerin" in the software.
#hat does the fi"ure tell us$
%ata layer &row '( can access! and hence deends
on! the %SI layer.
%ata layer may not access! and has no
deendencies on! %omain! Service! or )ontroller
&rows *! +! and ,(.
The JUnit comonent in the -.xternal/ comonent is
defined to be inaccessible.
0o ortion of the alication should deend uon
JUnit! because this should only be used by test
code.


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 22

Black Arc: SonarJ has found a
violation. The arc between the
Service layer and JUnit.
Architecture anal(sis '''
2his )io%atio is "ou! ,0 SoarI ,0
searchi. throu.h its !ata,ase6
app%0i. the user8!e"ie! patters6
a! "i!i. )io%atios o" those
patters&
2he hi.h%i.hte! arc i!icates that this
is a i%%e.a% !epe!ec0 a!
architectura% )io%atio&


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 24

>a)e a .oa% a! a set o" o,jecti)es or 5uestios i #i!


,e"ore u!ertaki. a architecture recostructio project&

E,tai so#e represetatio o" the s0ste# ,e"ore ,e.ii.


the !etai%e! recostructio process&

'!eti"0i. %a0ers is a .oo! p%ace to start

' so#e cases: !isre.ar! the e*isti. !ocu#etatio

2oo%s ca ot !o a%% the work3 ')o%)e#et o" peop%e "a#i%iar


with the s0ste# re5uire!&

3ui"elines


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 29

Architecture recostructio esures that a s0ste# is


,ui%t the wa0 it was !esi.e! a! that it e)o%)es i a
wa0 that is cosistet with !e)e%oper=s itetios&

Recostructio ee!e! whe:


8 !ocu#etatio %ost or out8o"8!ate
8 checki. co"or#ace
8 starti. the ree.ieeri. process to a ew
!esire! architecture
Summar(


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 2;

2he so"tware architecture recostructio


process co#prises the "o%%owi. phases:
8 raw )iew e*tractio
8 !ata,ase costructio
8 )iew "usio
8 architecture aa%0sis
Summar( ''


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 2<

1& What i"ereces ca 0ou #ake a,out a s0ste#=s
#o!u%e structures "ro# e*a#ii. a set o" ,eha)iora%
traces .athere! !0a#ica%%01
/iscussion
:!0a#ic aa%0sis is per"or#e! ,0 e*ecuti. pro.ra#s o a rea% or )irtua%
processor
: to ,e e""ecti)e6 su""iciet test iputs ee!e!N !i""eret techi5ues to esure
that a s%ice o" set o" possi,%e ,eha)iors has ,ee o,ser)e! e&.& co!e co)era.e
?hi.her co)era.e6 %ess ,u.s@
: se)era% steps: prepari. iput6 rui. a test pro.ra#6 .atheri. para#eters6
aa%0zi. the output
: !0a#ic aa%0sis is e*ecute! ,0 passi. a set o" !ata to the iput o" the
pro.ra# : e""iciec0 o" test !epe!s o 5uatit0 a! 5ua%it0 o" !ata
: Metrics pro)i!e!:
8 ressources cosu#e! D ti#e o" pro.ra# e*ecutio o who%e or "or
!i""eret #o!u%es6 the u#,er o" e*tera% 5ueries ?e&.& to the !ata,ase@6 the
u#,er o" #e#or0 ,ei. use!6 other ressources
8 c0c%o#atic co#p%e*it06 !e.ree o" co!e co)era.e with tests6 pro.ra#
#etrics ?o per"or#ace6 reactio ti#e6 respose@
8 pro.ra# errors ?!i)isios ,0 zero@6 u%% poiter !ere"ereci.6 #e#or0
%eaks6 race co!itios ?output !epe!s o se5uece or ti#i. o" other e)et@
8 )u%era,i%ities i the pro.ra#
8 other a!)ata.es: !0a#ic aa%0sis !etects !epe!ecies that is ot
possi,%e "or static6 e&.& !0a#ic !epe!ecies6 po%i#orphis#
Re#e#,er: e)e 100M co)era.e !oest #ea there are o errors at a%%3
+0a#ic aa%0sis !oest re)ea% %o.ic errors a! seco!%06 testi. uti%it0 is ot
"ree o" errors too&


Maciej Lukaszewski | WS 13/14
Chapter 20: Architecture Recostructio a! Co"or#ace| $o%ie 2A

2& Suppose 0ou h0pothesize that a s0ste# #akes use o"
particu%ar tactics to achie)e a particu%ar 5ua%it0 attri,ute& $i%% i
the co%u#s o" the ta,%e ,e%ow to show how 0ou wou%! .o a,out
)eri"0i. 0our h0pothesis&
/iscussion
*actics for.. 'ter)iewi.
e*perts o the
s0ste#
Aa%0zi.
structure o"
source co!e
"i%es
Static aa%0sis
o" source co!e
+0a#ic aa%0sis
o" s0ste#=s
e*ecutio
A)ai%a,i%it0
'teropera,i%it0
Mo!i"ia,i%it0
(er"or#ace
Securit0
2esta,i%it0
Ksa,i%it0
: 'ter)iewi.:
a)ai%a,i%it0 ?4what are the SLA1 What ti#e is the s0ste# #eat to ,e
a)iai%a,%e1 What=s the #ii#u# a)ai%ia,%e ti#e1 What=s the #a*i#u# !owti#e1
What=s the coute! M o" a)ai%a,i%it017@
(er"or#ace/Ksa,i%it0: user ,eha)ior aa%0sis6 sur)e0
'teropera,i%it0 ?work with other s0ste#s@: !oes the s0ste# a!here to
iter"ace sta!ar!s1 's there a eas0 wa0 to co)ert ito !i""eret sta!ar!1
: Structure o" co!e: a)ai%a,i%it0/per"or#ace ?4Ja! s#e%%s7 which or !up%icate! co!e6
which %ea! to !e%a0s@
Securit0 ?securit0 checks a! !etecti. securit0 )u%era,i%ities usi. too%s@
'teropera,i%it0: kow sta!ar! use!1 Sa#e "or#at1 Sa#e co!i"icatio o"
!ata1
: +0a#ic aa%0sis o" s0ste#=s e*ecutio: a)ai%a,i%it0 ?respose ti#e6
!owti#e/!e%a0s !ue to %ate ,i!i.6 causi. a)ai%i,i%it0 pro,%e#s6 ruti#e
#easure#ets@
(er"or#ace: ressources cosu#e! ?how #uch ti#e ee!e! to e*ecute a
certai #o!u%e1@
2esta,i%it0: #e#or0 %eaks
: static a! !0a#ic aa%0sis: too%s !esi.e! speci"ica%%0 "or "i!i. securit0 "%aws
e&.& s5%8ijectio6 spoo"i. a! other securit0 )u%era,i%ities& Lea!i. too%s e&.&
$orti"0 or Co)erit0&
2op securit0 )u%era,i%ities e&.& u)a%i!ate! para#eters6 ,roke access cotro% or
sessios6 isecure use o" cr0pto.raph0&

Vous aimerez peut-être aussi