Sie sind auf Seite 1von 227

Course Notes:

Course Notes:

Object-Oriented Software Engineering CS350 Fall 2012

-1-

Object-Oriented Software Engineering (CS350)

-2-

Course Notes:

able of Contents
1 !ntroduction Software Engineering O"er"iew #$e %ioneering Era 1&'5 to 1&(5: #$e Origins 1&(5 to 1&)5: #$e Software Crisis 1&)5 to 1&)&: No Si*"er +u**et Software ,rojects 1&&0 to 1&&&: %ro-inence of t$e !nternet 2000 to %resent: .ig$tweig$t /et$odo*ogies Current #rends in Software Engineering Software engineering toda0 Et$ica* considerations E1a-,*es of Codes of Conduct O,inions on et$ics %rofessiona* res,onsibi*ities in de"e*o,ing software 3$o4s 5es,onsib*e6 5es,onsibi*ities for Engineering and 7eo-science Software Co-,uter-based s0ste- engineering S0ste-s Engineering S0ste- ,ro,erties S0ste- -ode*ing Engineering ,rocess 2 Software ,rocesses /ode*s %rotot0,ing E"o*utionar0 ra,id de"e*o,-ent 3aterfa** /ode* S,ira* -ode* 5e-use %rocess iteration S,ecification 8esign 9 !-,*e-entation O"er"iew Software design to,ics :a*idation 9 E"o*ution 8efinitions 5e*ated conce,ts C*assification of -et$ods -311 11 11 11 12 12 13 13 1' 1' 15 15 1( 1( 12 12 12 12 12 12 1) 1) 1) 1& 1& 1& 22 2& 33 3' 32 3& '0 '0 '0 '3 '3 '' ''

Object-Oriented Software Engineering (CS350) !nde,endent :erification and :a*idation 5egu*ator0 en"iron-ent 7enera* introduction !-,act of software e"o*ution C$anges in Software E"o*ution /ode*s and #$eories #0,es of software -aintenance Stage -ode* .e$-an4s .aws of Software E"o*ution %roject -anage-ent ;istor0 Software de"e*o,-ent ,rocess %roject ,*anning< -onitoring and contro* !ssue %$i*oso,$0 /i*estones 9 de*i"erab*es =sing -i*estones in sc$edu*ing Sc$edu*ing O"er"iew C>SE #oo*s ;istor0 Co-,onents Su,,orting software >,,*ications 5is?s and associated contro*s 5is? -anage-ent !ntroduction %rocess Create a ris? -anage-ent ,*an .i-itations >reas of ris? -anage-ent %ositi"e 5is? /anage-ent 5is? -anage-ent and business continuit0 5is? co--unication ' Software re@uire-ents Aunctiona* "s non-functiona* Origin of ter%rocess 8o-ains %ur,ose %$ases of do-ain engineering =ser re@uire-ents S0ste- re@uire-ents 5eco--ended s0ste- re@uire-ents ;ardware re@uire-ents Software re@uire-ents -''' '' '5 '5 '5 '( '( '2 ') ') ') 50 50 51 51 51 52 52 53 53 5' 5' 5) 5) 5& 5& (0 (5 (( (2 (& 20 20 22 22 22 22 23 23 2' 2( 2( 2( 22 2)

Course Notes: Ot$er re@uire-ents E1a-,*es 5e@uire-ents docu-ent Origins of ter%roduct "ersus ,rocess re@uire-ents 5e@uire-ents in s0ste-s and software engineering %roduct re@uire-ents !ssues 5 Object-oriented design too*s =/. 8iagra-s ;istor0 #o,ics Criticis-s =/. -ode*ing too*s C*ass diagra-s Object diagra-s Object diagra- to,ics !nstance s,ecifications Object diagra- e1a-,*e =sage State transition diagra-s %ac?age diagra-s O"er"iew E*e-ents =sage ( 5e@uire-ents engineering ,rocesses Aeasibi*it0 stud0 Ai"e co--on factors #ec$no*og0 and s0ste- feasibi*it0 Ot$er feasibi*it0 factors Out,ut E*icitation 9 ana*0sis %rob*e-s 7uide*ines Se@uence of ste,s Co-,*e-entar0 a,,roac$es Non-functiona* re@uire-ents 5e@uire-ents ana*0sis to,ics %5E"iew %rocess-data diagra2 S0ste- -ode*s +e$a"iora* -ode*s 8ata-f*ow -ode*s O"er"iew State -ac$ine -ode*s -52) 2) 2& )0 )0 )0 )1 )' )5 )5 )5 )2 &' &5 &5 101 102 102 102 103 103 103 103 10' 10' 10( 10( 10( 10( 102 10) 10) 10) 10& 10& 10& 110 111 11( 11& 122 122 122 122 12'

Object-Oriented Software Engineering (CS350) +asic state -ac$ine conce,ts +asic =/. state diagra-s E"ents States E1tended states 7uard conditions >ctions and transitions 5un-to-co-,*etion e1ecution -ode* =/. e1tensions to t$e traditiona* AS/ for-a*is;ierarc$ica**0 nested states Ort$ogona* regions Entr0 and e1it actions !nterna* transitions #ransition e1ecution se@uence .oca* "ersus e1terna* transitions E"ent deferra* #$e *i-itations of =/. state -ac$ines 8ata -ode*s O"er"iew #$e ro*e of data -ode*s #$ree ,ers,ecti"es ;istor0 #0,es of data -ode*s 8ata -ode* to,ics 5e*ated -ode*s ) Object-oriented design O"er"iew Object-oriented design to,ics !n,ut (sources) for object-oriented design Object-oriented conce,ts 8esigning conce,ts Out,ut (de*i"erab*es) of object-oriented design So-e design ,rinci,*es and strategies Objects 9 c*asses 8esign and i-,*e-entation Structure +e$a"ior #$e conce,t of c*ass interface /e-ber accessibi*it0 !nter-c*ass re*ations$i,s Co-,ositiona* ;ierarc$ica* Ort$ogona*it0 of t$e c*ass conce,t and in$eritance 3it$in object-oriented ana*0sis #a1ono-0 of c*asses -(12' 125 125 12( 12( 122 12& 12& 130 130 132 133 13' 135 132 132 13) 13) 13& 13& 1'1 1'2 1'2 1'2 151 15( 15( 15( 15( 152 152 15) 15) 15) 15& 15& 15& 1(0 1(0 1(1 1(1 1(2 1(3 1(3 1('

Course Notes: >bstract and Concrete .oca* and inner /etac*asses Non-subc*assab*e %artia* =ninstantiab*e =nna-ed +enefits 5un-ti-e re,resentation & C*ass *ibraries /icrosoft Aoundation C*asses (/AC) ;istor0 Aeatures :isua* CBB 200) Aeature %ac? 10 8esign wit$ reuse Co-,onent-based de"e*o,-ent 8efinition and c$aracteristics of co-,onents ;istor0 8ifferences fro- object-oriented ,rogra--ing >rc$itecture /ode*s #ec$no*ogies Co--ercia*-Off-#$e-S$e*f (CO#S) Considerations 8esign ,atterns ;istor0 %ractice Structure C*assification and *ist 8ocu-entation 11 =ser interface design 7ra,$ica* =ser !nterface (7=!) ;istor0 Co-,onents %ost-3!/% interfaces =ser interface and interaction design Co-,arison to ot$er interfaces #$ree-di-ensiona* user interfaces 8esign ,rinci,*es %rocesses 5e@uire-ents 5esearc$ C %ast and Ongoing 8ata "s infor-ation 8ata 12 Software testing -21(' 1(' 1(5 1(5 1(5 1(2 1() 1() 1() 120 120 120 121 121 122 122 122 123 12' 12' 12' 12' 12( 12( 122 12& 12& 1)0 1)0 1)( 1)2 1)2 1)2 1)) 1)& 1)& 1&0 1&0 1&2 1&2 1&3 1&' 1&5 1&5 202

Object-Oriented Software Engineering (CS350) O"er"iew 8efects and fai*ures !n,ut co-binations and ,reconditions Econo-ics 5o*es ;istor0 #esting -et$ods Static "s d0na-ic testing #$e bo1 a,,roac$ :isua* testing #esting *e"e*s =nit testing !ntegration testing S0ste- testing S0ste- integration testing #o,-down and botto--u, Objecti"es of testing !nsta**ation testing Co-,atibi*it0 testing S-o?e and sanit0 testing 5egression testing >cce,tance testing >*,$a testing +eta testing Aunctiona* "s non-functiona* testing 8estructi"e testing Software ,erfor-ance testing =sabi*it0 testing >ccessibi*it0 Securit0 testing !nternationa*iDation and *oca*iDation #$e testing ,rocess #raditiona* C//! or waterfa** de"e*o,-ent -ode* >gi*e or E1tre-e de"e*o,-ent -ode* > sa-,*e testing c0c*e >uto-ated testing #esting too*s /easure-ent in software testing #esting artifacts Certifications Contro"ers0 5e*ated ,rocesses Software "erification and "a*idation Software @ua*it0 assurance (SE>) 13 Software c$ange -)202 203 203 203 20' 20' 20' 20' 205 202 202 20) 20) 20) 20) 20) 20& 20& 20& 20& 20& 210 210 210 210 210 211 211 211 211 211 212 212 212 213 213 21' 21' 21' 21( 212 212 212 21) 21&

Course Notes: /aintenance #$e i-,ortance of software -aintenance Software -aintenance ,*anning Software -aintenance ,rocesses Categories of -aintenance in !SOF!EC 1'2(' >rc$itecture O"er"iew ;istor0 Software arc$itecture to,ics E1a-,*es of arc$itectura* st0*es and ,atterns 21& 21& 221 222 222 223 223 22' 22' 22(

-&-

Object-Oriented Software Engineering (CS350)

- 10 -

Course Notes:

1! "ntroduction
Software Engineering
Software engineering (SE) is t$e a,,*ication of a s0ste-atic< disci,*ined< @uantifiab*e a,,roac$ to t$e design< de"e*o,-ent< o,eration< and -aintenance of software< and t$e stud0 of t$ese a,,roac$esG t$at is< t$e a,,*ication of engineering to software #$e ter- software engineering first a,,eared in t$e 1&() N>#O Software Engineering Conference< and was -eant to ,ro"o?e t$oug$t regarding t$e ,ercei"ed Hsoftware crisisH at t$e ti-e

O#er#iew
#$ere are a nu-ber of areas w$ere t$e e"o*ution of software engineering is notab*e: E-ergence as a ,rofession: +0 t$e ear*0 1&)0s< software engineering $ad a*read0 e-erged as a bonafide ,rofession< to stand beside co-,uter science and traditiona* engineering See a*so software engineering ,rofessiona*is 5o*e of wo-en: !n t$e 1&'0s< 1&50s< and 1&(0s< -en often fi**ed t$e -ore ,restigious and better ,a0ing $ardware engineering ro*es< but often de*egated t$e writing of software to wo-en 7race ;o,,er< Ia-ie Aenton and -an0 ot$er unsung wo-en fi**ed -an0 ,rogra--ing jobs during t$e first se"era* decades of software engineering #oda0< fewer wo-en wor? in software engineering t$an in ot$er ,rofessions< a situation w$ose cause is not c*ear*0 identified !t is often attributed to se1ua* discri-ination< c0bercu*ture or bias in education /an0 acade-ic and ,rofessiona* organiDations consider t$is situation unba*anced and are tr0ing $ard to so*"e it %rocesses: %rocesses $a"e beco-e a big ,art of software engineering and are $ai*ed for t$eir ,otentia* to i-,ro"e software and s$ar,*0 criticiDed for t$eir ,otentia* to constrict ,rogra--ers Cost of $ardware: #$e re*ati"e cost of software "ersus $ardware $as c$anged substantia**0 o"er t$e *ast 50 0ears 3$en -ainfra-es were e1,ensi"e and re@uired *arge su,,ort staffs< t$e few organiDations bu0ing t$e- a*so $ad t$e resources to fund *arge< e1,ensi"e custo- software engineering ,rojects Co-,uters are now -uc$ -ore nu-erous and -uc$ -ore ,owerfu*< w$ic$ $as se"era* effects on software #$e *arger -ar?et can su,,ort *arge ,rojects to create co--ercia* off t$e s$e*f software< as done b0 co-,anies suc$ as /icrosoft #$e c$ea, -ac$ines a**ow eac$ ,rogra--er to $a"e a ter-ina* ca,ab*e of fair*0 ra,id co-,i*ation #$e ,rogra-s in @uestion can use tec$ni@ues suc$ as garbage co**ection< w$ic$ -a?e t$e- easier and faster for t$e ,rogra--er to write On t$e ot$er $and< -an0 fewer organiDations are interested in e-,*o0ing ,rogra--ers for *arge custo- software ,rojects< instead using co--ercia* off t$e s$e*f software as -uc$ as ,ossib*e $e %ioneering Era -1-

Object-Oriented Software Engineering (CS350) #$e -ost i-,ortant de"e*o,-ent was t$at new co-,uters were co-ing out a*-ost e"er0 0ear or two< rendering e1isting ones obso*ete Software ,eo,*e $ad to rewrite a** t$eir ,rogra-s to run on t$ese new -ac$ines %rogra--ers did not $a"e co-,uters on t$eir des?s and $ad to go to t$e H-ac$ine roo-H Iobs were run b0 signing u, for -ac$ine ti-e or b0 o,erationa* staff Iobs were run b0 ,utting ,unc$ed cards for in,ut into t$e -ac$ine4s card reader and waiting for resu*ts to co-e bac? on t$e ,rinter #$e fie*d was so new t$at t$e idea of -anage-ent b0 sc$edu*e was non-e1istent /a?ing ,redictions of a ,roject4s co-,*etion date was a*-ost i-,ossib*e Co-,uter $ardware was a,,*ication-s,ecific Scientific and business tas?s needed different -ac$ines 8ue to t$e need to fre@uent*0 trans*ate o*d software to -eet t$e needs of new -ac$ines< $ig$-order *anguages *i?e AO5#5>N< CO+O.< and >.7O. were de"e*o,ed ;ardware "endors ga"e awa0 s0ste-s software for free as $ardware cou*d not be so*d wit$out software > few co-,anies so*d t$e ser"ice of bui*ding custo- software but no software co-,anies were se**ing ,ac?aged software #$e notion of reuse f*ouris$ed >s software was free< user organiDations co--on*0 ga"e it awa0 7rou,s *i?e !+/4s scientific user grou, S;>5E offered cata*ogs of reusab*e co-,onents >cade-ia did not 0et teac$ t$e ,rinci,*es of co-,uter science /odu*ar ,rogra--ing and data abstraction were a*read0 being used in ,rogra--ing

1&'5 to 1&(5: $e Origins


#$e ter- software engineering first a,,eared in t$e *ate 1&50s and ear*0 1&(0s %rogra--ers $a"e a*wa0s ?nown about ci"i*< e*ectrica*< and co-,uter engineering and debated w$at engineering -ig$t -ean for software #$e N>#O Science Co--ittee s,onsored two conferencesJon software engineering in 1&() (7ar-isc$< 7er-an0) and 1&(&< w$ic$ ga"e t$e fie*d its initia* boost /an0 be*ie"e t$ese conferences -ar?ed t$e officia* start of t$e ,rofession of software engineering

1&(5 to 1&)5: $e Software Crisis


Software engineering was s,urred b0 t$e so-ca**ed software crisis of t$e 1&(0s< 1&20s< and 1&)0s< w$ic$ identified -an0 of t$e ,rob*e-s of software de"e*o,-ent /an0 software ,rojects ran o"er budget and sc$edu*e So-e ,rojects caused ,ro,ert0 da-age > few ,rojects caused *oss of *ife #$e software crisis was origina**0 defined in ter-s of ,roducti"it0< but e"o*"ed to e-,$asiDe @ua*it0 So-e used t$e ter- software crisis to refer to t$eir inabi*it0 to $ire enoug$ @ua*ified ,rogra--ers Cost and +udget O"erruns: #$e OSF3(0 o,erating s0ste- was a c*assic e1a-,*e #$is decade*ong ,roject fro- t$e 1&(0s e"entua**0 ,roduced one of t$e -ost co-,*e1 software s0ste-s at t$e ti-e OSF3(0 was one of t$e first *arge (1000 ,rogra--ers) software ,rojects Ared +roo?s c*ai-s in The Mythical Man Month t$at $e -ade a -u*ti-i**ion do**ar -ista?e of not de"e*o,ing a co$erent arc$itecture before starting de"e*o,-ent %ro,ert0 8a-age: Software defects can cause ,ro,ert0 da-age %oor software securit0 a**ows $ac?ers to stea* identities< costing ti-e< -one0< and re,utations .ife and 8eat$: Software defects can ?i** So-e e-bedded s0ste-s used in radiot$era,0 -ac$ines fai*ed so catastro,$ica**0 t$at t$e0 ad-inistered *et$a* doses of radiation to ,atients #$e -ost fa-ous of t$ese fai*ures is t$e Therac 25 incident - 12 -

Course Notes: %eter 7 Neu-ann $as ?e,t a conte-,orar0 *ist of software ,rob*e-s and disasters #$e software crisis $as been fading fro- "iew< because it is ,s0c$o*ogica**0 e1tre-e*0 difficu*t to re-ain in crisis -ode for a ,rotracted ,eriod (-ore t$an 20 0ears) Ne"ert$e*ess< software - es,ecia**0 rea*-ti-e e-bedded software - re-ains ris?0 and is ,er"asi"e< and it is crucia* not to gi"e in to co-,*acenc0 O"er t$e *ast 10-15 0ears /ic$ae* > Iac?son $as written e1tensi"e*0 about t$e nature of software engineering< $as identified t$e -ain source of its difficu*ties as *ac? of s,ecia*iDation< and $as suggested t$at $is ,rob*e- fra-es ,ro"ide t$e basis for a Hnor-a* ,racticeH of software engineering< a ,rere@uisite if software engineering is to beco-e an engineering science K/ic$ae* Iac?son< HEngineering and Software EngineeringH in S NanD ed< #$e Auture of Software Engineering< S,ringer :er*ag 2010G /ic$ae* Iac?son< %rob*e- Ara-es: >na*0Ding and Structuring Software 8e"e*o,-ent %rob*e-sG >ddison-3es*e0< 2001L

1&)5 to 1&)&: No Sil#er *ullet


Aor decades< so*"ing t$e software crisis was ,ara-ount to researc$ers and co-,anies ,roducing software too*s #$e cost of owning and -aintaining software in t$e 1&)0s was twice as e1,ensi"e as de"e*o,ing t$e software M 8uring t$e 1&&0s< t$e cost of owners$i, and -aintenance increased b0 30N o"er t$e 1&)0s M !n 1&&5< statistics s$owed t$at $a*f of sur"e0ed de"e*o,-ent ,rojects were o,erationa*< but were not considered successfu* M #$e a"erage software ,roject o"ers$oots its sc$edu*e b0 $a*f M #$ree-@uarters of a** *arge software ,roducts de*i"ered to t$e custo-er are fai*ures t$at are eit$er not used at a**< or do not -eet t$e custo-erOs re@uire-ents

Software +rojects
See-ing*0< e"er0 new tec$no*og0 and ,ractice fro- t$e 1&20s to t$e 1&&0s was tru-,eted as a silver bullet to so*"e t$e software crisis #oo*s< disci,*ine< for-a* -et$ods< ,rocess< and ,rofessiona*is- were touted as si*"er bu**ets: #oo*s: Es,ecia**0 e-,$asiDed were too*s: structured ,rogra--ing< object-oriented ,rogra--ing< C>SE too*s< >da< docu-entation< and standards were touted as si*"er bu**ets 8isci,*ine: So-e ,undits argued t$at t$e software crisis was due to t$e *ac? of disci,*ine of ,rogra--ers Aor-a* -et$ods: So-e be*ie"ed t$at if for-a* engineering -et$odo*ogies wou*d be a,,*ied to software de"e*o,-ent< t$en ,roduction of software wou*d beco-e as ,redictab*e an industr0 as ot$er branc$es of engineering #$e0 ad"ocated ,ro"ing a** ,rogra-s correct %rocess: /an0 ad"ocated t$e use of defined ,rocesses and -et$odo*ogies *i?e t$e Ca,abi*it0 /aturit0 /ode* %rofessiona*is-: #$is *ed to wor? on a code of et$ics< *icenses< and ,rofessiona*is!n 1&)(< Ared +roo?s ,ub*is$ed $is No Silver Bullet artic*e< arguing t$at no indi"idua* tec$no*og0 or ,ractice wou*d e"er -a?e a 10-fo*d i-,ro"e-ent in ,roducti"it0 wit$in 10 0ears 8ebate about si*"er bu**ets raged o"er t$e fo**owing decade >d"ocates for >da< co-,onents< and ,rocesses continued arguing for 0ears t$at t$eir fa"orite tec$no*og0 wou*d be a si*"er bu**et S?e,tics disagreed E"entua**0< a*-ost e"er0one acce,ted t$at no si*"er bu**et wou*d e"er be found Pet< c*ai-s about silver bullets ,o, u, now and again< e"en toda0 - 13 -

Object-Oriented Software Engineering (CS350) So-e inter,ret no silver bullet to -ean t$at software engineering fai*ed ;owe"er< wit$ furt$er reading< +roo?s goes on to sa0< Q3e wi** sure*0 -a?e substantia* ,rogress o"er t$e ne1t '0 0earsG an order of -agnitude o"er '0 0ears is $ard*0 -agica* R #$e searc$ for a sing*e ?e0 to success ne"er wor?ed >** ?nown tec$no*ogies and ,ractices $a"e on*0 -ade incre-enta* i-,ro"e-ents to ,roducti"it0 and @ua*it0 Pet< t$ere are no si*"er bu**ets for an0 ot$er ,rofession< eit$er Ot$ers inter,ret no silver bullet as ,roof t$at software engineering $as fina**0 -atured and recogniDed t$at ,rojects succeed due to $ard wor? ;owe"er< it cou*d a*so be said t$at t$ere are< in fact< a range of silver bullets toda0< inc*uding *ig$tweig$t -et$odo*ogies< s,reads$eet ca*cu*ators< custo-iDed browsers< in-site searc$ engines< database re,ort generators< integrated design-test coding-editors wit$ -e-or0FdifferencesFundo< and s,ecia*t0 s$o,s t$at generate nic$e software< suc$ as infor-ation websites< at a fraction of t$e cost of tota**0 custo-iDed website de"e*o,-ent Ne"ert$e*ess< t$e fie*d of software engineering a,,ears too co-,*e1 and di"erse for a sing*e Hsi*"er bu**etH to i-,ro"e -ost issues< and eac$ issue accounts for on*0 a s-a** ,ortion of a** software ,rob*e-s

1&&0 to 1&&&: %ro,inence of t$e "nternet


#$e rise of t$e !nternet *ed to "er0 ra,id growt$ in t$e de-and for internationa* infor-ation dis,*a0Fe-ai* s0ste-s on t$e 3or*d 3ide 3eb %rogra--ers were re@uired to $and*e i**ustrations< -a,s< ,$otogra,$s< and ot$er i-ages< ,*us si-,*e ani-ation< at a rate ne"er before seen< wit$ few we**?nown -et$ods to o,ti-iDe i-age dis,*a0Fstorage (suc$ as t$e use of t$u-bnai* i-ages) #$e growt$ of browser usage< running on t$e ;#/. *anguage< c$anged t$e wa0 in w$ic$ infor-ationdis,*a0 and retrie"a* was organiDed #$e wides,read networ? connections *ed to t$e growt$ and ,re"ention of internationa* co-,uter "iruses on /S 3indows co-,uters< and t$e "ast ,ro*iferation of s,a- e--ai* beca-e a -ajor design issue in e--ai* s0ste-s< f*ooding co--unication c$anne*s and re@uiring se-i-auto-ated ,rescreening Se0word-searc$ s0ste-s e"o*"ed into web-based searc$ engines< and -an0 software s0ste-s $ad to be re-designed< for internationa* searc$ing< de,ending on searc$ engine o,ti-iDation (SEO) tec$ni@ues ;u-an natura*-*anguage trans*ation s0ste-s were needed to atte-,t to trans*ate t$e infor-ation f*ow in -u*ti,*e foreign *anguages< wit$ -an0 software s0ste-s being designed for -u*ti-*anguage usage< based on design conce,ts fro- $u-an trans*ators #0,ica* co-,uter-user bases went fro- $undreds< or t$ousands of users< to< often< -an0--i**ions of internationa* users

2000 to %resent: -ig$tweig$t .et$odologies


3it$ t$e e1,anding de-and for software in -an0 s-a**er organiDations< t$e need for ine1,ensi"e software so*utions *ed to t$e growt$ of si-,*er< faster -et$odo*ogies t$at de"e*o,ed running software< fro- re@uire-ents to de,*o0-ent< @uic?er 9 easier #$e use of ra,id-,rotot0,ing e"o*"ed to entire lightweight methodologies< suc$ as E1tre-e %rogra--ing (T%)< w$ic$ atte-,ted to si-,*if0 -an0 areas of software engineering< inc*uding re@uire-ents gat$ering and re*iabi*it0 testing for t$e growing< "ast nu-ber of s-a** software s0ste-s :er0 *arge software s0ste-s sti** used $ea"i*0-docu-ented -et$odo*ogies< wit$ -an0 "o*u-es in t$e docu-entation setG $owe"er< s-a**er s0ste-s $ad a si-,*er< faster a*ternati"e a,,roac$ to -anaging t$e de"e*o,-ent and -aintenance of software ca*cu*ations and - 1' -

Course Notes: a*gorit$-s< infor-ation storageFretrie"a* and dis,*a0

Current rends in Software Engineering


Software engineering is a 0oung disci,*ine< and is sti** de"e*o,ing #$e directions in w$ic$ software engineering is de"e*o,ing inc*ude: s!ects: ;e*, software engineers dea* wit$ @ua*it0 attributes b0 ,ro"iding too*s to add or re-o"e boi*er,*ate code fro- -an0 areas in t$e source code >s,ects describe $ow a** objects or functions s$ou*d be$a"e in ,articu*ar circu-stances Aor e1a-,*e< as,ects can add debugging< *ogging< or *oc?ing contro* into a** objects of ,articu*ar t0,es 5esearc$ers are current*0 wor?ing to understand $ow to use as,ects to design genera*-,ur,ose code 5e*ated conce,ts inc*ude generati"e ,rogra--ing and te-,*ates gile: >gi*e software de"e*o,-ent guides software de"e*o,-ent ,rojects t$at e"o*"e ra,id*0 wit$ c$anging e1,ectations and co-,etiti"e -ar?ets %ro,onents of t$is -et$od be*ie"e t$at $ea"0< docu-ent-dri"en ,rocesses (*i?e #ic?!#< C// and !SO &000) are fading in i-,ortance So-e ,eo,*e be*ie"e t$at co-,anies and agencies e1,ort -an0 of t$e jobs t$at can be guided b0 $ea"0-weig$t ,rocesses 5e*ated conce,ts inc*ude e1tre-e ,rogra--ing< scru-< and *ean software de"e*o,-ent E"!erimental: e1,eri-enta* software engineering is a branc$ of software engineering interested in de"ising e1,eri-ents on software< in co**ecting data fro- t$e e1,eri-ents< and in de"ising *aws and t$eories fro- t$is data %ro,onents of t$is -et$od ad"ocate t$at t$e nature of software is suc$ t$at we can ad"ance t$e ?now*edge on software t$roug$ e1,eri-ents on*0 Model#driven: -ode* dri"en design de"e*o,s te1tua* and gra,$ica* -ode*s as ,ri-ar0 design artifacts 8e"e*o,-ent too*s are a"ai*ab*e t$at use -ode* transfor-ation and code generation to generate we**-organiDed code frag-ents t$at ser"e as a basis for ,roducing co-,*ete a,,*ications Software !roduct lines : software ,roduct *ines is a s0ste-atic wa0 to ,roduce families of software s0ste-s< instead of creating a succession of co-,*ete*0 indi"idua* ,roducts #$is -et$od e-,$asiDes e1tensi"e< s0ste-atic< for-a* code reuse< to tr0 to industria*iDe t$e software de"e*o,-ent ,rocess

#$e Auture of Software Engineering conference (AOSE)< $e*d at !CSE 2000< docu-ented t$e state of t$e art of SE in 2000 and *isted -an0 ,rob*e-s to be so*"ed o"er t$e ne1t decade #$e AOSE trac?s at t$e !CSE 2000 and t$e !CSE 2002 conferences a*so $e*, identif0 t$e state of t$e art in software engineering

Software engineering toda/


#$e ,rofession is tr0ing to define its boundar0 and content #$e Software Engineering +od0 of Snow*edge S3E+OS $as been tab*ed as an !SO standard during 200( (!SOF!EC #5 1&25&)

- 15 -

Object-Oriented Software Engineering (CS350) !n 200(< Money Maga$ine and Salary%com rated software engineering as t$e best job in >-erica in ter-s of growt$< ,a0< stress *e"e*s< f*e1ibi*it0 in $ours and wor?ing en"iron-ent< creati"it0< and $ow eas0 it is to enter and ad"ance in t$e fie*d

Ethical considerations
Software engineering et$ics is a *arge fie*d !n so-e wa0s it began as an unrea*istic atte-,t to define bugs as unet$ica* /ore recent*0 it $as been defined as t$e a,,*ication of bot$ co-,uter science and engineering ,$i*oso,$0< ,rinci,*es< and ,ractices to t$e design and de"e*o,-ent of software s0ste-s 8ue to t$is engineering focus and t$e increased use of software in -ission critica* and $u-an critica* s0ste-s< w$ere fai*ure can resu*t in *arge *osses of ca,ita* but -ore i-,ortant*0 *i"es suc$ as t$e #$erac-25 s0ste-< -an0 et$ica* codes $a"e been de"e*o,ed b0 a nu-ber of societies< associations and organiDations #$ese entities< suc$ as t$e >C/< !EEE< >%E7+C and !nstitute for Certification of Co-,uting %rofessiona*s (!CC%) $a"e for-a* codes of et$ics >d$erence to t$e code of et$ics is re@uired as a condition of -e-bers$i, or certification >ccording to t$e !CC%< "io*ation of t$e code can resu*t in re"ocation of t$e certificate >*so< a** engineering societies re@uire confor-ance to t$eir et$ica* codesG "io*ation of t$e code resu*ts in t$e re"ocation of t$e *icense to ,ractice engineering in t$e societ04s jurisdiction #$ese codes of et$ics usua**0 $a"e -uc$ in co--on #$e0 t0,ica**0 re*ate t$e need to act consistent*0 wit$ t$e c*ient4s interest< e-,*o0er4s interest< and -ost i-,ortant*0 t$e ,ub*ic4s interest #$e0 a*so out*ine t$e need to act wit$ ,rofessiona*is- and to ,ro-ote an et$ica* a,,roac$ to t$e ,rofession > Software Engineering Code of Et$ics $as been a,,ro"ed b0 t$e >C/ and t$e !EEE-CS as t$e standard for teac$ing and ,racticing software engineering

E0a,+les of Codes of Conduct


#$e fo**owing are e1a-,*es of Codes of conduct for %rofessiona* Engineers #$ese 2 $a"e been c$osen because bot$ jurisdictions $a"e a designation for %rofessiona* Software Engineers >ssociation of %rofessiona* Engineers and 7eo-scientists of +ritis$ Co*u-bia (>%E7+C): >** -e-bers in t$e association4s code of Et$ics -ust ensure t$at go"ern-ent< t$e ,ub*ic can re*0 on +C4s ,rofessiona* engineers and 7eo-scientists to act at a** ti-es wit$ fairness< courtes0 and good fait$ to t$eir e-,*o0ers< e-,*o0ee and custo-ers< and to u,$o*d t$e trut$< $onest0 and trustwort$iness< and to safe guard $u-an *ife and t$e en"iron-ent #$is is just one of t$e -an0 wa0s in w$ic$ +COs %rofessiona* Engineers and %rofessiona* 7eo-scientists -aintain t$eir co-,etiti"e edge in toda0Os g*oba* -ar?et,*ace >ssociation of %rofessiona* Engineers< 7eo-scientists and 7eo,$0sicists of >*berta(>%E77>): 8ifferent wit$ +ritis$ Co*u-bia< t$e >*berta 7o"ern-ent granted se*f go"ernance to engineers< 7eo-scientists and geo,$0sicists >** -e-bers in t$e >%E77> $a"e to acce,t *ega* and et$ica* res,onsibi*it0 for t$e wor? and to $o*d t$e interest of t$e ,ub*ic and societ0 #$e >%E77> is a standards guide*ine of ,rofessiona* ,ractice to u,$o*d t$e ,rotection of ,ub*ic interest for engineering< 7eo-scientists and geo,$0sics in >*berta

- 1( -

Course Notes:

O+inions on et$ics
+i** Io0 argued t$at Hbetter softwareH can on*0 enab*e its ,ri"i*eged end users< -a?e rea*it0 -ore ,ower-,oint0 as o,,osed to -ore $u-ane< and u*ti-ate*0 run awa0 wit$ itse*f so t$at Ht$e future doesn4t need us H ;e o,en*0 @uestioned t$e goa*s of software engineering in t$is res,ect< as?ing w$0 it isn4t tr0ing to be -ore et$ica* rat$er t$an -ore efficient !n $is boo? Code and Ot$er .aws of C0bers,ace< .awrence .essig argues t$at co-,uter code can regu*ate conduct in -uc$ t$e sa-e wa0 as t$e *ega* code .essig and Io0 urge ,eo,*e to t$in? about t$e conse@uences of t$e software being de"e*o,ed< not on*0 in a functiona* wa0< but a*so in $ow it affects t$e ,ub*ic and societ0 as a w$o*e O"era**< due to t$e 0out$ of software engineering< -an0 of t$e et$ica* codes and "a*ues $a"e been borrowed fro- ot$er fie*ds< suc$ as -ec$anica* and ci"i* engineering ;owe"er< t$ere are -an0 et$ica* @uestions t$at e"en t$ese< -uc$ o*der< disci,*ines $a"e not encountered Euestions about t$e et$ica* i-,act of internet a,,*ications< w$ic$ $a"e a g*oba* reac$< $a"e ne"er been encountered unti* recent*0 and ot$er et$ica* @uestions are sti** to be encountered #$is -eans t$e et$ica* codes for software engineering are a wor? in ,rogress< t$at wi** c$ange and u,date as -ore @uestions arise

Professional responsibilities in developing software


1$o2s 3es+onsible4
#$e de"e*o,ers wor? wit$ c*ients and users to define s0ste- re@uire-ents Once t$e s0ste- is bui*t if an0 accidents occur< suc$ as econo-ica* $ar- or ot$er< w$o is res,onsib*e6 !f an inde,endent E> tea- does integration testing and does not disco"er a critica* fau*t in t$e s0ste-< w$o is et$ica**0 res,onsib*e for da-age caused b0 t$at fau*t6

3es+onsibilities for Engineering and 5eo-science Software


8e"e*o,ing software is a $ig$*0 ris?0 ,ro,osition #$e software de"e*o,-ent ,rocess is a co-,*e1 underta?ing consisting of s,ecif0ing< designing< i-,*e-enting< and testing >n0 s-a** -ista?e or fau*t wi** cause un*i-ited da-age to societ0 %rofessiona* /e-bers contribute to t$e success of software de"e*o,-ent ,rojects ;owe"er< >ssociation of %rofessiona* Engineering and 7eo-science is ,ri-ari*0 concerned wit$ t$eir res,onsibi*it0 for -ini-iDing t$e ris? of fai*ure and ,rotecting t$e ,ub*ic interest J

Computer-based system engineering S/ste,s Engineering


Systems engineers dea* ,ri-ari*0 wit$ t$e o"era** s0ste- re@uire-ents and design< inc*uding $ardware and $u-an issues #$e0 are often concerned wit$ ,artitioning functiona*it0 to $ardware< software or $u-an o,erators #$erefore< t$e out,ut of t$e s0ste-s engineering ,rocess ser"es as an in,ut to t$e software engineering ,rocess

- 12 -

Object-Oriented Software Engineering (CS350)

System properties System modeling Engineering process


#$e definition< i-,*e-entation< assess-ent< -easure-ent< -anage-ent< c$ange< and i-,ro"e-ent of t$e software *ife c0c*e ,rocess itse*f

- 1) -

Course Notes:

2! Software +rocesses
Models
%rotot/+ing
#$e origina* ,ur,ose of a ,rotot0,e is to a**ow users of t$e software to e"a*uate de"e*o,ers4 ,ro,osa*s for t$e design of t$e e"entua* ,roduct b0 actua**0 tr0ing t$e- out< rat$er t$an $a"ing to inter,ret and e"a*uate t$e design based on descri,tions %rotot0,ing can a*so be used b0 end users to describe and ,ro"e re@uire-ents t$at de"e*o,ers $a"e not considered< and t$at can be a ?e0 factor in t$e co--ercia* re*ations$i, between de"e*o,ers and t$eir c*ients !nteraction design in ,articu*ar -a?es $ea"0 use of ,rotot0,ing wit$ t$at goa* #$is ,rocess is in contrast wit$ t$e 1&(0s and 1&20s -ono*it$ic de"e*o,-ent c0c*e of bui*ding t$e entire ,rogra- first and t$en wor?ing out an0 inconsistencies between design and i-,*e-entation< w$ic$ *ed to $ig$er software costs and ,oor esti-ates of ti-e and cost #$e -ono*it$ic a,,roac$ $as been dubbed t$e HS*a0ing t$e (software) 8ragonH tec$ni@ue< since it assu-es t$at t$e software designer and de"e*o,er is a sing*e $ero w$o $as to s*a0 t$e entire dragon a*one %rotot0,ing can a*so a"oid t$e great e1,ense and difficu*t0 of c$anging a finis$ed software ,roduct #$e ,ractice of ,rotot0,ing is one of t$e ,oints Ared +roo?s -a?es in $is 1&25 boo? The Mythical Man#Month and $is 10-0ear anni"ersar0 artic*e No Silver Bullet >n ear*0 e1a-,*e of *arge-sca*e software ,rotot0,ing was t$e i-,*e-entation of NP=4s >daFE8 trans*ator for t$e >da ,rogra--ing *anguage !t was i-,*e-ented in SE#. wit$ t$e intent of ,roducing an e1ecutab*e se-antic -ode* for t$e >da *anguage< e-,$asiDing c*arit0 of design and user interface o"er s,eed and efficienc0 #$e NP= >daFE8 s0ste- was t$e first "a*idated >da i-,*e-entation< certified on >,ri* 11< 1&)3 Outline of the prototyping process #$e ,rocess of ,rotot0,ing in"o*"es t$e fo**owing ste,s 1 !dentif0 basic re@uire-ents

- 1& -

Object-Oriented Software Engineering (CS350) 8eter-ine basic re@uire-ents inc*uding t$e in,ut and out,ut infor-ation desired 8etai*s< suc$ as securit0< can t0,ica**0 be ignored 2 8e"e*o, !nitia* %rotot0,e #$e initia* ,rotot0,e is de"e*o,ed t$at inc*udes on*0 user interfaces (See ;oriDonta* %rotot0,e< be*ow) 3 5e"iew #$e custo-ers< inc*uding end-users< e1a-ine t$e ,rotot0,e and ,ro"ide feedbac? on additions or c$anges ' 5e"ise and En$ance t$e %rotot0,e =sing t$e feedbac? bot$ t$e s,ecifications and t$e ,rotot0,e can be i-,ro"ed Negotiation about w$at is wit$in t$e sco,e of t$e contractF,roduct -a0 be necessar0 !f c$anges are introduced t$en a re,eat of ste,s U3 and U' -a0 be needed Dimensions of prototypes Nie*sen su--ariDes t$e "arious di-ension of ,rotot0,es in $is boo? =sabi*it0 Engineering Hori ontal Prototype > co--on ter- for a user interface ,rotot0,e is t$e horizontal prototype !t ,ro"ides a broad "iew of an entire s0ste- or subs0ste-< focusing on user interaction -ore t$an *ow-*e"e* s0ste- functiona*it0< suc$ as database access ;oriDonta* ,rotot0,es are usefu* for: Confir-ation of user interface re@uire-ents and s0ste- sco,e 8e-onstration "ersion of t$e s0ste- to obtain bu0-in fro- t$e business 8e"e*o, ,re*i-inar0 esti-ates of de"e*o,-ent ti-e< cost and effort !ertical Prototype > vertical prototype is a -ore co-,*ete e*aboration of a sing*e subs0ste- or function !t is usefu* for obtaining detai*ed re@uire-ents for a gi"en function< wit$ t$e fo**owing benefits: 5efine-ent database design Obtain infor-ation on data "o*u-es and s0ste- interface needs< for networ? siDing and ,erfor-ance engineering C*arifies co-,*e1 re@uire-ents b0 dri**ing down to actua* s0ste- functiona*it0 "ypes of prototyping Software ,rotot0,ing $as -an0 "ariants ;owe"er< a** t$e -et$ods are in so-e wa0 based on two -ajor t0,es of ,rotot0,ing: #$rowawa0 %rotot0,ing and E"o*utionar0 %rotot0,ing "hrowaway prototyping

- 20 -

Course Notes: >*so ca**ed c*ose-ended ,rotot0,ing #$rowawa0 or 5a,id %rotot0,ing refers to t$e creation of a -ode* t$at wi** e"entua**0 be discarded rat$er t$an beco-ing ,art of t$e fina* de*i"ered software >fter ,re*i-inar0 re@uire-ents gat$ering is acco-,*is$ed< a si-,*e wor?ing -ode* of t$e s0ste- is constructed to "isua**0 s$ow t$e users w$at t$eir re@uire-ents -a0 *oo? *i?e w$en t$e0 are i-,*e-ented into a finis$ed s0ste5a,id %rotot0,ing in"o*"ed creating a wor?ing -ode* of "arious ,arts of t$e s0ste- at a "er0 ear*0 stage< after a re*ati"e*0 s$ort in"estigation #$e -et$od used in bui*ding it is usua**0 @uite infor-a*< t$e -ost i-,ortant factor being t$e s,eed wit$ w$ic$ t$e -ode* is ,ro"ided #$e -ode* t$en beco-es t$e starting ,oint fro- w$ic$ users can re-e1a-ine t$eir e1,ectations and c*arif0 t$eir re@uire-ents 3$en t$is $as been ac$ie"ed< t$e ,rotot0,e -ode* is 4t$rown awa04< and t$e s0ste- is for-a**0 de"e*o,ed based on t$e identified re@uire-ents #$e -ost ob"ious reason for using #$rowawa0 %rotot0,ing is t$at it can be done @uic?*0 !f t$e users can get @uic? feedbac? on t$eir re@uire-ents< t$e0 -a0 be ab*e to refine t$e- ear*0 in t$e de"e*o,-ent of t$e software /a?ing c$anges ear*0 in t$e de"e*o,-ent *ifec0c*e is e1tre-e*0 cost effecti"e since t$ere is not$ing at t$at ,oint to redo !f a ,roject is c$anged after a considerab*e wor? $as been done t$en s-a** c$anges cou*d re@uire *arge efforts to i-,*e-ent since software s0ste-s $a"e -an0 de,endencies S,eed is crucia* in i-,*e-enting a t$rowawa0 ,rotot0,e< since wit$ a *i-ited budget of ti-e and -one0 *itt*e can be e1,ended on a ,rotot0,e t$at wi** be discarded >not$er strengt$ of #$rowawa0 %rotot0,ing is its abi*it0 to construct interfaces t$at t$e users can test #$e user interface is w$at t$e user sees as t$e s0ste-< and b0 seeing it in front of t$e-< it is -uc$ easier to gras, $ow t$e s0ste- wi** wor? Vit is asserted t$at re"o*utionar0 ra,id ,rotot0,ing is a -ore effecti"e -anner in w$ic$ to dea* wit$ user re@uire-ents-re*ated issues< and t$erefore a greater en$ance-ent to software ,roducti"it0 o"era** 5e@uire-ents can be identified< si-u*ated< and tested far -ore @uic?*0 and c$ea,*0 w$en issues of e"o*"abi*it0< -aintainabi*it0< and software structure are ignored #$is< in turn< *eads to t$e accurate s,ecification of re@uire-ents< and t$e subse@uent construction of a "a*id and usab*e s0ste- fro- t$e user4s ,ers,ecti"e "ia con"entiona* software de"e*o,-ent -ode*s %rotot0,es can be c*assified according to t$e fide*it0 wit$ w$ic$ t$e0 rese-b*e t$e actua* ,roduct in ter-s of a,,earance< interaction and ti-ing One -et$od of creating a *ow fide*it0 #$rowawa0 %rotot0,e is %a,er %rotot0,ing #$e ,rotot0,e is i-,*e-ented using ,a,er and ,enci*< and t$us -i-ics t$e function of t$e actua* ,roduct< but does not *oo? at a** *i?e it >not$er -et$od to easi*0 bui*d $ig$ fide*it0 #$rowawa0 %rotot0,es is to use a 7=! +ui*der and create a clic& dummy< a ,rotot0,e t$at *oo?s *i?e t$e goa* s0ste-< but does not ,ro"ide an0 functiona*it0 Not e1act*0 t$e sa-e as #$rowawa0 %rotot0,ing< but certain*0 in t$e sa-e fa-i*0< is t$e usage of stor0boards< ani-atics or drawings #$ese are non-functiona* i-,*e-entations but s$ow $ow t$e s0ste- wi** *oo? S=//>5P:-!n t$is a,,roac$ t$e ,rotot0,e is constructed wit$ t$e idea t$at it wi** be discarded and t$e fina* s0ste- wi** be bui*t fro- scratc$ #$e ste,s in t$is a,,roac$ are: 1 3rite ,re*i-inar0 re@uire-ents - 21 -

Object-Oriented Software Engineering (CS350) 2 3 ' 5 ( 8esign t$e ,rotot0,e =ser e1,eriencesFuses t$e ,rotot0,e< s,ecifies new re@uire-ents 5e,eat if necessar0 3rite t$e fina* re@uire-ents 8e"e*o, t$e rea* ,roducts

Evolutionary prototyping E"o*utionar0 %rotot0,ing (a*so ?nown as breadboard ,rotot0,ing) is @uite different fro- #$rowawa0 %rotot0,ing #$e -ain goa* w$en using E"o*utionar0 %rotot0,ing is to bui*d a "er0 robust ,rotot0,e in a structured -anner and constant*0 refine it H#$e reason for t$is is t$at t$e E"o*utionar0 ,rotot0,e< w$en bui*t< for-s t$e $eart of t$e new s0ste-< and t$e i-,ro"e-ents and furt$er re@uire-ents wi** be bui*t 3$en de"e*o,ing a s0ste- using E"o*utionar0 %rotot0,ing< t$e s0ste- is continua**0 refined and rebui*t HVe"o*utionar0 ,rotot0,ing ac?now*edges t$at we do not understand a** t$e re@uire-ents and bui*ds on*0 t$ose t$at are we** understood H #$is tec$ni@ue a**ows t$e de"e*o,-ent tea- to add features< or -a?e c$anges t$at cou*dn4t be concei"ed during t$e re@uire-ents and design ,$ase Aor a s0ste- to be usefu*< it -ust e"o*"e t$roug$ use in its intended o,erationa* en"iron-ent > ,roduct is ne"er HdoneGH it is a*wa0s -aturing as t$e usage en"iron-ent c$angesVwe often tr0 to define a s0ste- using our -ost fa-i*iar fra-e of reference---w$ere we are now 3e -a?e assu-,tions about t$e wa0 business wi** be conducted and t$e tec$no*og0 base on w$ic$ t$e business wi** be i-,*e-ented > ,*an is enacted to de"e*o, t$e ca,abi*it0< and< sooner or *ater< so-et$ing rese-b*ing t$e en"isioned s0ste- is de*i"ered E"o*utionar0 %rotot0,es $a"e an ad"antage o"er #$rowawa0 %rotot0,es in t$at t$e0 are functiona* s0ste-s >*t$oug$ t$e0 -a0 not $a"e a** t$e features t$e users $a"e ,*anned< t$e0 -a0 be used on an interi- basis unti* t$e fina* s0ste- is de*i"ered H!t is not unusua* wit$in a ,rotot0,ing en"iron-ent for t$e user to ,ut an initia* ,rotot0,e to ,ractica* use w$i*e waiting for a -ore de"e*o,ed "ersionV#$e user -a0 decide t$at a 4f*awed4 s0ste- is better t$an no s0ste- at a** H !n E"o*utionar0 %rotot0,ing< de"e*o,ers can focus t$e-se*"es to de"e*o, ,arts of t$e s0ste- t$at t$e0 understand instead of wor?ing on de"e*o,ing a w$o*e s0ste#o -ini-iDe ris?< t$e de"e*o,er does not i-,*e-ent ,oor*0 understood features #$e ,artia* s0ste- is sent to custo-er sites >s users wor? wit$ t$e s0ste-< t$e0 detect o,,ortunities for new features and gi"e re@uests for t$ese features to de"e*o,ers 8e"e*o,ers t$en ta?e t$ese en$ance-ent re@uests a*ong wit$ t$eir own and use sound configuration--anage-ent ,ractices to c$ange t$e software-re@uire-ents s,ecification< u,date t$e design< recode and retest

- 22 -

Course Notes: #ncremental prototyping #$e fina* ,roduct is bui*t as se,arate ,rotot0,es >t t$e end t$e se,arate ,rotot0,es are -erged in an o"era** design E$treme prototyping E1tre-e %rotot0,ing as a de"e*o,-ent ,rocess is used es,ecia**0 for de"e*o,ing web a,,*ications +asica**0< it brea?s down web de"e*o,-ent into t$ree ,$ases< eac$ one based on t$e ,receding one #$e first ,$ase is a static ,rotot0,e t$at consists -ain*0 of ;#/. ,ages !n t$e second ,$ase< t$e screens are ,rogra--ed and fu**0 functiona* using a si-u*ated ser"ices *a0er !n t$e t$ird ,$ase t$e ser"ices are i-,*e-ented #$e ,rocess is ca**ed E1tre-e %rotot0,ing to draw attention to t$e second ,$ase of t$e ,rocess< w$ere a fu**0 functiona* =! is de"e*o,ed wit$ "er0 *itt*e regard to t$e ser"ices ot$er t$an t$eir contract %dvantages of prototyping #$ere are -an0 ad"antages to using ,rotot0,ing in software de"e*o,-ent C so-e tangib*e< so-e abstract Reduced time and costs: %rotot0,ing can i-,ro"e t$e @ua*it0 of re@uire-ents and s,ecifications ,ro"ided to de"e*o,ers +ecause c$anges cost e1,onentia**0 -ore to i-,*e-ent as t$e0 are detected *ater in de"e*o,-ent< t$e ear*0 deter-ination of what the user really wants can resu*t in faster and *ess e1,ensi"e software Improved and increased user involvement: %rotot0,ing re@uires user in"o*"e-ent and a**ows t$eto see and interact wit$ a ,rotot0,e a**owing t$e- to ,ro"ide better and -ore co-,*ete feedbac? and s,ecifications #$e ,resence of t$e ,rotot0,e being e1a-ined b0 t$e user ,re"ents -an0 -isunderstandings and -iss-co--unications t$at occur w$en eac$ side be*ie"e t$e ot$er understands w$at t$e0 said Since users ?now t$e ,rob*e- do-ain better t$an an0one on t$e de"e*o,-ent teadoes< increased interaction can resu*t in fina* ,roduct t$at $as greater tangib*e and intangib*e @ua*it0 #$e fina* ,roduct is -ore *i?e*0 to satisf0 t$e users desire for *oo?< fee* and ,erfor-ance Disadvantages of prototyping =sing< or ,er$a,s -isusing< ,rotot0,ing can a*so $a"e disad"antages Insufficient analysis: #$e focus on a *i-ited ,rotot0,e can distract de"e*o,ers fro- ,ro,er*0 ana*0Ding t$e co-,*ete ,roject #$is can *ead to o"er*oo?ing better so*utions< ,re,aration of inco-,*ete s,ecifications or t$e con"ersion of *i-ited ,rotot0,es into ,oor*0 engineered fina* ,rojects t$at are $ard to -aintain Aurt$er< since a ,rotot0,e is *i-ited in functiona*it0 it -a0 not sca*e we** if t$e ,rotot0,e is used as t$e basis of a fina* de*i"erab*e< w$ic$ -a0 not be noticed if de"e*o,ers are too focused on bui*ding a ,rotot0,e as a -ode*

- 23 -

Object-Oriented Software Engineering (CS350) User confusion of prototype and finished system : =sers can begin to t$in? t$at a ,rotot0,e< intended to be t$rown awa0< is actua**0 a fina* s0ste- t$at -ere*0 needs to be finis$ed or ,o*is$ed (#$e0 are< for e1a-,*e< often unaware of t$e effort needed to add error-c$ec?ing and securit0 features w$ic$ a ,rotot0,e -a0 not $a"e ) #$is can *ead t$e- to e1,ect t$e ,rotot0,e to accurate*0 -ode* t$e ,erfor-ance of t$e fina* s0ste- w$en t$is is not t$e intent of t$e de"e*o,ers =sers can a*so beco-e attac$ed to features t$at were inc*uded in a ,rotot0,e for consideration and t$en re-o"ed fro- t$e s,ecification for a fina* s0ste- !f users are ab*e to re@uire a** ,ro,osed features be inc*uded in t$e fina* s0ste- t$is can *ead to conf*ict Developer misunderstanding of user objectives: 8e"e*o,ers -a0 assu-e t$at users s$are t$eir objecti"es (e g to de*i"er core functiona*it0 on ti-e and wit$in budget)< wit$out understanding wider co--ercia* issues Aor e1a-,*e< user re,resentati"es attending Enter,rise software (e g %eo,*eSoft) e"ents -a0 $a"e seen de-onstrations of Htransaction auditingH (w$ere c$anges are *ogged and dis,*a0ed in a difference grid "iew) wit$out being to*d t$at t$is feature de-ands additiona* coding and often re@uires -ore $ardware to $and*e e1tra database accesses =sers -ig$t be*ie"e t$e0 can de-and auditing on e"er0 fie*d< w$ereas de"e*o,ers -ig$t t$in? t$is is feature cree, because t$e0 $a"e -ade assu-,tions about t$e e1tent of user re@uire-ents !f t$e de"e*o,er $as co--itted de*i"er0 before t$e user re@uire-ents were re"iewed< de"e*o,ers are between a roc? and a $ard ,*ace< ,articu*ar*0 if user -anage-ent deri"es so-e ad"antage fro- t$eir fai*ure to i-,*e-ent re@uire-ents Developer attachment to prototype: 8e"e*o,ers can a*so beco-e attac$ed to ,rotot0,es t$e0 $a"e s,ent a great dea* of effort ,roducingG t$is can *ead to ,rob*e-s *i?e atte-,ting to con"ert a *i-ited ,rotot0,e into a fina* s0ste- w$en it does not $a"e an a,,ro,riate under*0ing arc$itecture (#$is -a0 suggest t$at t$rowawa0 ,rotot0,ing< rat$er t$an e"o*utionar0 ,rotot0,ing< s$ou*d be used ) Excessive development time of the prototype: > ?e0 ,ro,ert0 to ,rotot0,ing is t$e fact t$at it is su,,osed to be done @uic?*0 !f t$e de"e*o,ers *ose sig$t of t$is fact< t$e0 "er0 we** -a0 tr0 to de"e*o, a ,rotot0,e t$at is too co-,*e1 3$en t$e ,rotot0,e is t$rown awa0 t$e ,recise*0 de"e*o,ed re@uire-ents t$at it ,ro"ides -a0 not 0ie*d a sufficient increase in ,roducti"it0 to -a?e u, for t$e ti-e s,ent de"e*o,ing t$e ,rotot0,e =sers can beco-e stuc? in debates o"er detai*s of t$e ,rotot0,e< $o*ding u, t$e de"e*o,-ent tea- and de*a0ing t$e fina* ,roduct Expense of implementing prototyping: t$e start u, costs for bui*ding a de"e*o,-ent tea- focused on ,rotot0,ing -a0 be $ig$ /an0 co-,anies $a"e de"e*o,-ent -et$odo*ogies in ,*ace< and c$anging t$e- can -ean retraining< retoo*ing< or bot$ /an0 co-,anies tend to just ju-, into t$e ,rotot0,ing wit$out bot$ering to retrain t$eir wor?ers as -uc$ as t$e0 s$ou*d > co--on ,rob*e- wit$ ado,ting ,rotot0,ing tec$no*og0 is $ig$ e1,ectations for ,roducti"it0 wit$ insufficient effort be$ind t$e *earning cur"e !n addition to training for t$e use of a ,rotot0,ing tec$ni@ue< t$ere is an often o"er*oo?ed need for de"e*o,ing cor,orate and ,roject s,ecific under*0ing structure to su,,ort t$e tec$no*og0 3$en t$is under*0ing structure is o-itted< *ower ,roducti"it0 can often resu*t &est pro'ects to use prototyping !t $as been argued t$at ,rotot0,ing< in so-e for- or anot$er< s$ou*d be used a** t$e ti-e ;owe"er< ,rotot0,ing is -ost beneficia* in s0ste-s t$at wi** $a"e -an0 interactions wit$ t$e users - 2' -

Course Notes: !t $as been found t$at ,rotot0,ing is "er0 effecti"e in t$e ana*0sis and design of on-*ine s0ste-s< es,ecia**0 for transaction ,rocessing< w$ere t$e use of screen dia*ogs is -uc$ -ore in e"idence #$e greater t$e interaction between t$e co-,uter and t$e user< t$e greater t$e benefit is t$at can be obtained fro- bui*ding a @uic? s0ste- and *etting t$e user ,*a0 wit$ it S0ste-s wit$ *itt*e user interaction< suc$ as batc$ ,rocessing or s0ste-s t$at -ost*0 do ca*cu*ations< benefit *itt*e fro- ,rotot0,ing So-eti-es< t$e coding needed to ,erfor- t$e s0ste- functions -a0 be too intensi"e and t$e ,otentia* gains t$at ,rotot0,ing cou*d ,ro"ide are too s-a** %rotot0,ing is es,ecia**0 good for designing good $u-an-co-,uter interfaces HOne of t$e -ost ,roducti"e uses of ra,id ,rotot0,ing to date $as been as a too* for iterati"e user re@uire-ents engineering and $u-an-co-,uter interface design H Methods #$ere are few for-a* ,rotot0,ing -et$odo*ogies e"en t$oug$ -ost >gi*e /et$ods re*0 $ea"i*0 u,on ,rotot0,ing tec$ni@ues Dynamic systems development method 80na-ic S0ste-s 8e"e*o,-ent /et$od (8S8/) is a fra-ewor? for de*i"ering business so*utions t$at re*ies $ea"i*0 u,on ,rotot0,ing as a core tec$ni@ue< and is itse*f !SO &001 a,,ro"ed !t e1,ands u,on -ost understood definitions of a ,rotot0,e >ccording to 8S8/ t$e ,rotot0,e -a0 be a diagra-< a business ,rocess< or e"en a s0ste- ,*aced into ,roduction 8S8/ ,rotot0,es are intended to be incre-enta*< e"o*"ing fro- si-,*e for-s into -ore co-,re$ensi"e ones 8S8/ ,rotot0,es -a0 be throwaway or evolutionary E"o*utionar0 ,rotot0,es -a0 be e"o*"ed $oriDonta**0 (breadt$ t$en de,t$) or "ertica**0 (eac$ section is bui*t in detai* wit$ additiona* iterations detai*ing subse@uent sections) E"o*utionar0 ,rotot0,es can e"entua**0 e"o*"e into fina* s0ste-s #$e four categories of ,rotot0,es as reco--ended b0 8S8/ are: Business prototypes C used to design and de-onstrates t$e business ,rocesses being auto-ated Usability prototypes C used to define< refine< and de-onstrate user interface design usabi*it0< accessibi*it0< *oo? and fee* erformance and capacity prototypes - used to define< de-onstrate< and ,redict $ow s0ste-s wi** ,erfor- under ,ea? *oads as we** as to de-onstrate and e"a*uate ot$er non-functiona* as,ects of t$e s0ste- (transaction rates< data storage "o*u-e< res,onse ti-e< etc ) !apability"techni#ue prototypes C used to de"e*o,< de-onstrate< and e"a*uate a design a,,roac$ or conce,t #$e 8S8/ *ife-c0c*e of a ,rotot0,e is to: 1 2 3 ' !dentif0 ,rotot0,e >gree to a ,*an Create t$e ,rotot0,e 5e"iew t$e ,rotot0,e - 25 -

Object-Oriented Software Engineering (CS350) Operational prototyping O,erationa* %rotot0,ing was ,ro,osed b0 >*an 8a"is as a wa0 to integrate t$rowawa0 and e"o*utionar0 ,rotot0,ing wit$ con"entiona* s0ste- de"e*o,-ent H!t offers t$e best of bot$ t$e @uic?-and-dirt0 and con"entiona*-de"e*o,-ent wor*ds in a sensib*e -anner 8esigners de"e*o, on*0 we**-understood features in bui*ding t$e e"o*utionar0 base*ine< w$i*e using t$rowawa0 ,rotot0,ing to e1,eri-ent wit$ t$e ,oor*0 understood features H 8a"is4 be*ief is t$at to tr0 to Hretrofit @ua*it0 onto a ra,id ,rotot0,eH is not t$e correct a,,roac$ w$en tr0ing to co-bine t$e two a,,roac$es ;is idea is to engage in an e"o*utionar0 ,rotot0,ing -et$odo*og0 and ra,id*0 ,rotot0,e t$e features of t$e s0ste- after eac$ e"o*ution #$e s,ecific -et$odo*og0 fo**ows t$ese ste,s: >n e"o*utionar0 ,rotot0,e is constructed and -ade into a base*ine using con"entiona* de"e*o,-ent strategies< s,ecif0ing and i-,*e-enting on*0 t$e re@uire-ents t$at are we** understood Co,ies of t$e base*ine are sent to -u*ti,*e custo-er sites a*ong wit$ a trained ,rotot0,er >t eac$ site< t$e ,rotot0,er watc$es t$e user at t$e s0ste 3$ene"er t$e user encounters a ,rob*e- or t$in?s of a new feature or re@uire-ent< t$e ,rotot0,er *ogs it #$is frees t$e user fro- $a"ing to record t$e ,rob*e-< and a**ows $i- to continue wor?ing >fter t$e user session is o"er< t$e ,rotot0,er constructs a t$rowawa0 ,rotot0,e on to, of t$e base*ine s0ste #$e user now uses t$e new s0ste- and e"a*uates !f t$e new c$anges aren4t effecti"e< t$e ,rotot0,er re-o"es t$e !f t$e user *i?es t$e c$anges< t$e ,rotot0,er writes feature-en$ance-ent re@uests and forwards t$e- to t$e de"e*o,-ent tea #$e de"e*o,-ent tea-< wit$ t$e c$ange re@uests in $and fro- a** t$e sites< t$en ,roduce a new e"o*utionar0 ,rotot0,e using con"entiona* -et$ods Ob"ious*0< a ?e0 to t$is -et$od is to $a"e we** trained ,rotot0,ers a"ai*ab*e to go to t$e user sites #$e O,erationa* %rotot0,ing -et$odo*og0 $as -an0 benefits in s0ste-s t$at are co-,*e1 and $a"e few ?nown re@uire-ents in ad"ance Evolutionary systems development E"o*utionar0 S0ste-s 8e"e*o,-ent is a c*ass of -et$odo*ogies t$at atte-,t to for-a**0 i-,*e-ent E"o*utionar0 %rotot0,ing One ,articu*ar t0,e< ca**ed S0ste-scraft is described b0 Io$n Crinnion in $is boo?: E"o*utionar0 S0ste-s 8e"e*o,-ent S0ste-scraft was designed as a 4,rotot0,e4 -et$odo*og0 t$at s$ou*d be -odified and ada,ted to fit t$e s,ecific en"iron-ent in w$ic$ it was i-,*e-ented S0ste-scraft was not designed as a rigid 4coo?boo?4 a,,roac$ to t$e de"e*o,-ent ,rocess !t is now genera**0 recognisedJsicW t$at a good -et$odo*og0 s$ou*d be f*e1ib*e enoug$ to be adjustab*e to suit a** ?inds of en"iron-ent and situationV

- 2( -

Course Notes: #$e basis of S0ste-scraft< not un*i?e E"o*utionar0 %rotot0,ing< is to create a wor?ing s0ste- fro- t$e initia* re@uire-ents and bui*d u,on it in a series of re"isions S0ste-scraft ,*aces $ea"0 e-,$asis on traditiona* ana*0sis being used t$roug$out t$e de"e*o,-ent of t$e s0ste-

E#olutionar/ ra+id de#elo+,ent


E"o*utionar0 5a,id 8e"e*o,-ent (E58) was de"e*o,ed b0 t$e Software %roducti"it0 Consortiu-< a tec$no*og0 de"e*o,-ent and integration agent for t$e !nfor-ation #ec$no*og0 Office of t$e 8efense >d"anced 5esearc$ %rojects >genc0 (8>5%>) Aunda-enta* to E58 is t$e conce,t of co-,osing software s0ste-s based on t$e reuse of co-,onents< t$e use of software te-,*ates and on an arc$itectura* te-,*ate Continuous e"o*ution of s0ste- ca,abi*ities in ra,id res,onse to c$anging user needs and tec$no*og0 is $ig$*ig$ted b0 t$e e"o*"ab*e arc$itecture< re,resenting a c*ass of so*utions #$e ,rocess focuses on t$e use of s-a** artisan-based tea-s integrating software and s0ste-s engineering disci,*ines wor?ing -u*ti,*e< often ,ara**e* s$ort-duration ti-ebo1es wit$ fre@uent custo-er interaction Se0 to t$e success of t$e E58-based ,rojects is ,ara**e* e1,*orator0 ana*0sis and de"e*o,-ent of features< infrastructures< and co-,onents wit$ and ado,tion of *eading edge tec$no*ogies enab*ing t$e @uic? reaction to c$anges in tec$no*ogies< t$e -ar?et,*ace< or custo-er re@uire-ents #o e*icit custo-erFuser in,ut< fre@uent sc$edu*ed and ad $ocFi-,ro-,tu -eetings wit$ t$e sta?e$o*ders are $e*d 8e-onstrations of s0ste- ca,abi*ities are $e*d to so*icit feedbac? before designFi-,*e-entation decisions are so*idified Are@uent re*eases (e g < betas) are -ade a"ai*ab*e for use to ,ro"ide insig$t into $ow t$e s0ste- cou*d better su,,ort user and custo-er needs #$is assures t$at t$e s0ste- e"o*"es to satisf0 e1isting user needs #$e design fra-ewor? for t$e s0ste- is based on using e1isting ,ub*is$ed or de facto standards #$e s0ste- is organiDed to a**ow for e"o*"ing a set of ca,abi*ities t$at inc*udes considerations for ,erfor-ance< ca,acities< and functiona*it0 #$e arc$itecture is defined in ter-s of abstract interfaces t$at enca,su*ate t$e ser"ices and t$eir i-,*e-entation (e g < CO#S a,,*ications) #$e arc$itecture ser"es as a te-,*ate to be used for guiding de"e*o,-ent of -ore t$an a sing*e instance of t$e s0ste- !t a**ows for -u*ti,*e a,,*ication co-,onents to be used to i-,*e-ent t$e ser"ices > core set of functiona*it0 not *i?e*0 to c$ange is a*so identified and estab*is$ed #$e E58 ,rocess is structured to use de-onstrated functiona*it0 rat$er t$an ,a,er ,roducts as a wa0 for sta?e$o*ders to co--unicate t$eir needs and e1,ectations Centra* to t$is goa* of ra,id de*i"er0 is t$e use of t$e Hti-ebo1H -et$od #i-ebo1es are fi1ed ,eriods of ti-e in w$ic$ s,ecific tas?s (e g < de"e*o,ing a set of functiona*it0) -ust be ,erfor-ed 5at$er t$an a**owing ti-e to e1,and to satisf0 so-e "ague set of goa*s< t$e ti-e is fi1ed (bot$ in ter-s of ca*endar wee?s and ,erson-$ours) and a set of goa*s is defined t$at rea*istica**0 can be ac$ie"ed wit$in t$ese constraints #o ?ee, de"e*o,-ent fro- degenerating into a Hrando- wa*?<H *ong-range ,*ans are defined to guide t$e iterations #$ese ,*ans ,ro"ide a "ision for t$e o"era** s0ste- and set boundaries (e g < constraints) for t$e ,roject Eac$ iteration wit$in t$e ,rocess is conducted in t$e conte1t of t$ese *ong-range ,*ans

- 22 -

Object-Oriented Software Engineering (CS350) Once an arc$itecture is estab*is$ed< software is integrated and tested on a dai*0 basis #$is a**ows t$e tea- to assess ,rogress objecti"e*0 and identif0 ,otentia* ,rob*e-s @uic?*0 Since s-a** a-ounts of t$e s0ste- are integrated at one ti-e< diagnosing and re-o"ing t$e defect is ra,id =ser de-onstrations can be $e*d at s$ort notice since t$e s0ste- is genera**0 read0 to e1ercise at a** ti-es Scrum Scru- is an agi*e -et$od for ,roject -anage-ent #$e a,,roac$ was first described b0 #a?euc$i and Nona?a in H#$e New New %roduct 8e"e*o,-ent 7a-eH (;ar"ard +usiness 5e"iew< Ian-Aeb 1&)() "ools Efficient*0 using ,rotot0,ing re@uires t$at an organiDation $a"e ,ro,er too*s and a staff trained to use t$ose too*s #oo*s used in ,rotot0,ing can "ar0 fro- indi"idua* too*s *i?e 't$ generation ,rogra--ing *anguages used for ra,id ,rotot0,ing to co-,*e1 integrated C>SE too*s 't$ generation "isua* ,rogra--ing *anguages *i?e :isua* +asic and Co*dAusion are fre@uent*0 used since t$e0 are c$ea,< we** ?nown and re*ati"e*0 eas0 and fast to use C>SE too*s< su,,orting re@uire-ents ana*0sis< *i?e t$e 5e@uire-ents Engineering En"iron-ent (see be*ow) are often de"e*o,ed or se*ected b0 t$e -i*itar0 or *arge organiDations Object oriented too*s are a*so being de"e*o,ed *i?e .P/+ fro- t$e 7E 5esearc$ and 8e"e*o,-ent Center =sers -a0 ,rotot0,e e*e-ents of an a,,*ication t$e-se*"es in a s,reads$eet Screen generators( design tools ) Software *actories >*so co--on*0 used are screen generating ,rogra-s t$at enab*e ,rotot0,ers to s$ow users s0ste-s t$at don4t function< but s$ow w$at t$e screens -a0 *oo? *i?e 8e"e*o,ing ;u-an Co-,uter !nterfaces can so-eti-es be t$e critica* ,art of t$e de"e*o,-ent effort< since to t$e users t$e interface essentia**0 is t$e s0steSoftware Aactories are Code 7enerators t$at a**ow 0ou to -ode* t$e do-ain -ode* and t$en drag and dro, t$e =! >*so t$e0 enab*e 0ou to run t$e ,rotot0,e and use basic database functiona*it0 #$is a,,roac$ a**ows 0ou to e1,*ore t$e do-ain -ode* and -a?e sure it is in s0nc wit$ t$e 7=! ,rotot0,e >*so 0ou can use t$e =! Contro*s t$at wi** *ater on be used for rea* de"e*o,-ent %pplication definition or simulation software > new c*ass of software ca**ed a*so $pplication definition or simulation soft%are enab*e users to ra,id*0 bui*d *ig$tweig$t< ani-ated si-u*ations of anot$er co-,uter ,rogra-< wit$out writing code >,,*ication si-u*ation software a**ows bot$ tec$nica* and non-tec$nica* users to e1,erience< test< co**aborate and "a*idate t$e si-u*ated ,rogra-< and ,ro"ides re,orts suc$ as annotations< screens$ot and sc$e-atics >s a so*ution s,ecification tec$ni@ue< >,,*ication Si-u*ation fa**s between *ow-ris?< but *i-ited< te1t or drawing-based -oc?-u,s (or wirefra-es) so-eti-es ca**ed !a!er based !rototy!ing< and ti-e-consu-ing< $ig$-ris? code-based ,rotot0,es< a**owing software ,rofessiona*s to "a*idate re@uire-ents and design c$oices ear*0 on< before de"e*o,-ent begins !n doing so< ris?s and costs associated wit$ software i-,*e-entations can be dra-atica**0 reduced

- 2) -

Course Notes: #o si-u*ate a,,*ications one can a*so use software w$ic$ si-u*ate rea*-wor*d software ,rogra-s for co-,uter based training< de-onstration< and custo-er su,,ort< suc$ as screen-casting software as t$ose areas are c*ose*0 re*ated #$ere are a*so -ore s,ecia*iDed too*s So-e of t$e *eading too*s in t$is categor0 are >1ure< A*uid =!< 8efine!# fro- +or*and< i5ise< /oc?u,#iger Iustin-ind %rotot0,er< .ucidC$art and %rotoS$are +e,uirements Engineering Environment H#$e 5e@uire-ents Engineering En"iron-ent (5EE)< under de"e*o,-ent at 5o-e .aborator0 since 1&)5< ,ro"ides an integrated too*set for ra,id*0 re,resenting< bui*ding< and e1ecuting -ode*s of critica* as,ects of co-,*e1 s0ste-s H 5e@uire-ents Engineering En"iron-ent is current*0 used b0 t$e >ir Aorce to de"e*o, s0ste-s !t is: an integrated set of too*s t$at a**ows s0ste-s ana*0sts to ra,id*0 bui*d functiona*< user interface< and ,erfor-ance ,rotot0,e -ode*s of s0ste- co-,onents #$ese -ode*ing acti"ities are ,erfor-ed to gain a greater understanding of co-,*e1 s0ste-s and *essen t$e i-,act t$at inaccurate re@uire-ent s,ecifications $a"e on cost and sc$edu*ing during t$e s0stede"e*o,-ent ,rocess /ode*s can be constructed easi*0< and at "ar0ing *e"e*s of abstraction or granu*arit0< de,ending on t$e s,ecific be$a"iora* as,ects of t$e -ode* being e1ercised 5EE is co-,osed of t$ree ,arts #$e first< ca**ed ,roto is a C>SE too* s,ecifica**0 designed to su,,ort ra,id ,rotot0,ing #$e second ,art is ca**ed t$e 5a,id !nterface %rotot0,ing S0ste- or 5!%< w$ic$ is a co**ection of too*s t$at faci*itate t$e creation of user interfaces #$e t$ird ,art of 5EE is a user interface to 5!% and ,roto t$at is gra,$ica* and intended to be eas0 to use 5o-e .aborator0< t$e de"e*o,er of 5EE< intended t$at to su,,ort t$eir interna* re@uire-ents gat$ering -et$odo*og0 #$eir -et$od $as t$ree -ain ,arts: E*icitation fro- "arious sources w$ic$ -eans u *oose (users< interfaces to ot$er s0ste-s)< s,ecification< and consistenc0 c$ec?ing >na*0sis t$at t$e needs of di"erse users ta?en toget$er do not conf*ict and are tec$nica**0 and econo-ica**0 feasib*e :a*idation t$at re@uire-ents so deri"ed are an accurate ref*ection of user needs

!n 1&&(< 5o-e .abs contracted Software %roducti"it0 So*utions (S%S) to furt$er en$ance 5EE to create Ha co--ercia* @ua*it0 5EE t$at su,,orts re@uire-ents s,ecification< si-u*ation< user interface ,rotot0,ing< -a,,ing of re@uire-ents to $ardware arc$itectures< and code generationVH #$is s0ste- is na-ed t$e >d"anced 5e@uire-ents Engineering 3or?station or >5E3

1aterfall .odel
#$e waterfall model is a se@uentia* design ,rocess< often used in software de"e*o,-ent ,rocesses< in w$ic$ ,rogress is seen as f*owing steadi*0 downwards (*i?e a waterfa**) t$roug$ t$e ,$ases of Conce,tion< !nitiation< >na*0sis< 8esign< Construction< #esting< %roductionF!-,*e-entation< and /aintenance

- 2& -

Object-Oriented Software Engineering (CS350) #$e waterfa** de"e*o,-ent -ode* originates in t$e -anufacturing and construction industries: $ig$*0 structured ,$0sica* en"iron-ents in w$ic$ after-t$e-fact c$anges are ,ro$ibiti"e*0 cost*0< if not i-,ossib*e Since no for-a* software de"e*o,-ent -et$odo*ogies e1isted at t$e ti-e< t$is $ardwareoriented -ode* was si-,*0 ada,ted for software de"e*o,-ent #$e first ?nown ,resentation describing use of si-i*ar ,$ases in software engineering was $e*d b0 ;erbert 8 +enington at S0-,osiu- on ad"anced ,rogra--ing -et$ods for digita* co-,uters on 2& Iune 1&5( #$is ,resentation was about t$e de"e*o,-ent of software for S>7E !n 1&)3 t$e ,a,er was re,ub*is$ed wit$ a foreword b0 +enington ,ointing out t$at t$e ,rocess was not in fact ,erfor-ed in strict to,-down< but de,ended on a ,rotot0,e #$e first for-a* descri,tion of t$e waterfa** -ode* is often cited as a 1&20 artic*e b0 3inston 3 5o0ce< a*t$oug$ 5o0ce did not use t$e ter- Hwaterfa**H in t$is artic*e 5o0ce ,resented t$is -ode* as an e1a-,*e of a f*awed< non-wor?ing -ode* #$is< in fact< is $ow t$e ter- is genera**0 used in writing about software de"e*o,-entXto describe a critica* "iew of a co--on*0 used software de"e*o,-ent ,ractice Model !n 5o0ce4s origina* waterfa** -ode*< t$e fo**owing ,$ases are fo**owed in order: 1 2 3 ' 5 ( 2 5e@uire-ents s,ecification 8esign Construction (>S> i-,*e-entation or coding) !ntegration #esting and debugging (>S> "a*idation) !nsta**ation /aintenance

#$us t$e waterfa** -ode* -aintains t$at one s$ou*d -o"e to a ,$ase on*0 w$en its ,receding ,$ase is co-,*eted and ,erfected :arious -odified waterfa** -ode*s (inc*uding 5o0ce4s fina* -ode*)< $owe"er< can inc*ude s*ig$t or -ajor "ariations on t$is ,rocess Supporting arguments #i-e s,ent ear*0 in t$e software ,roduction c0c*e can *ead to greater econo-0 at *ater stages /cConne** s$ows t$at a bug found in t$e ear*0 stages (suc$ as re@uire-ents s,ecification or design) is c$ea,er in -one0< effort< and ti-e to fi1 t$an t$e sa-e bug found *ater on in t$e ,rocess #o ta?e an e1tre-e e1a-,*e< if a ,rogra- design turns out to be i-,ossib*e to i-,*e-ent< it is easier to fi1 t$e design at t$e design stage t$an to rea*iDe -ont$s *ater< w$en ,rogra- co-,onents are being integrated< t$at a** t$e wor? done so far $as to be scra,,ed because of a bro?en design

- 30 -

Course Notes: #$is is t$e centra* idea be$ind +ig 8esign =, Aront and t$e waterfa** -ode*: ti-e s,ent ear*0 on -a?ing sure re@uire-ents and design are correct sa"es 0ou -uc$ ti-e and effort *ater #$us< t$e t$in?ing of t$ose w$o fo**ow t$e waterfa** ,rocess goes< -a?e sure eac$ ,$ase is 100N co-,*ete and abso*ute*0 correct before 0ou ,roceed to t$e ne1t ,$ase %rogra- re@uire-ents s$ou*d be set in stone before design begins (ot$erwise wor? ,ut into a design based on incorrect re@uire-ents is wasted) #$e ,rogra-4s design s$ou*d be ,erfect before ,eo,*e begin to i-,*e-ent t$e design (ot$erwise t$e0 i-,*e-ent t$e wrong design and t$eir wor? is wasted)< etc > furt$er argu-ent for t$e waterfa** -ode* is t$at it ,*aces e-,$asis on docu-entation (suc$ as re@uire-ents docu-ents and design docu-ents) as we** as source code !n *ess t$oroug$*0 designed and docu-ented -et$odo*ogies< ?now*edge is *ost if tea- -e-bers *ea"e before t$e ,roject is co-,*eted< and it -a0 be difficu*t for a ,roject to reco"er fro- t$e *oss !f a fu**0 wor?ing design docu-ent is ,resent (as is t$e intent of +ig 8esign =, Aront and t$e waterfa** -ode*)< new tea-e-bers or e"en entire*0 new tea-s s$ou*d be ab*e to fa-i*iariDe t$e-se*"es b0 reading t$e docu-ents So-e waterfa** ,ro,onents ,refer t$e waterfa** -ode* for its si-,*e a,,roac$ and argue t$at it is -ore disci,*ined #$e waterfa** -ode* ,ro"ides a structured a,,roac$G t$e -ode* itse*f ,rogresses *inear*0 t$roug$ discrete< easi*0 understandab*e and e1,*ainab*e ,$ases and t$us is eas0 to understandG it a*so ,ro"ides easi*0 identifiab*e -i*estones in t$e de"e*o,-ent ,rocess !t is ,er$a,s for t$is reason t$at t$e waterfa** -ode* is used as a beginning e1a-,*e of a de"e*o,-ent -ode* in -an0 software engineering te1ts and courses !t is argued t$at t$e waterfa** -ode* and +ig 8esign u, Aront in genera* can be suited to software ,rojects t$at are stab*e (es,ecia**0 t$ose ,rojects wit$ unc$anging re@uire-ents< suc$ as wit$ s$rin? wra, software) and w$ere it is ,ossib*e and *i?e*0 t$at designers wi** be ab*e to fu**0 ,redict ,rob*eareas of t$e s0ste- and ,roduce a correct design before i-,*e-entation is started #$e waterfa** -ode* a*so re@uires t$at i-,*e-enters fo**ow t$e we**--ade< co-,*ete design accurate*0< ensuring t$at t$e integration of t$e s0ste- ,roceeds s-oot$*0 Criticism >gi*e ad"ocates argue t$e waterfa** -ode* is a bad idea in ,racticeXbe*ie"ing it i-,ossib*e for an0 non-tri"ia* ,roject to finis$ a ,$ase of a software ,roduct4s *ife-c0c*e ,erfect*0 before -o"ing to t$e ne1t ,$ases and *earning fro- t$eAor e1a-,*e< c*ients -a0 not ?now e1act*0 w$at re@uire-ents t$e0 need before re"iewing a wor?ing ,rotot0,e and co--enting on it #$e0 -a0 c$ange t$eir re@uire-ents constant*0 8esigners and ,rogra--ers -a0 $a"e *itt*e contro* o"er t$is !f c*ients c$ange t$eir re@uire-ents after t$e design is fina*iDed< t$e design -ust be -odified to acco--odate t$e new re@uire-ents #$is effecti"e*0 -eans in"a*idating a good dea* of wor?ing $ours< w$ic$ -eans increased cost< es,ecia**0 if a *arge a-ount of t$e ,roject4s resources $as a*read0 been in"ested in +ig 8esign =, Aront 8esigners -a0 not be aware of future i-,*e-entation difficu*ties w$en writing a design for an uni-,*e-ented software ,roduct #$at is< it -a0 beco-e c*ear in t$e i-,*e-entation ,$ase t$at a ,articu*ar area of ,rogra- functiona*it0 is e1traordinari*0 difficu*t to i-,*e-ent !n t$is case< it is better to re"ise t$e design t$an ,ersist in a design based on fau*t0 ,redictions< and t$at does not account for t$e new*0 disco"ered ,rob*e-s - 31 -

Object-Oriented Software Engineering (CS350) !n Code Co-,*ete (a boo? t$at criticiDes wides,read use of t$e waterfa** -ode*)< Ste"e /cConne** refers to design as a Hwic?ed ,rob*e-HXa ,rob*e- w$ose re@uire-ents and *i-itations cannot be entire*0 ?nown before co-,*etion #$e i-,*ication of t$is is t$at it is i-,ossib*e to ,erfect one ,$ase of software de"e*o,-ent< t$us it is i-,ossib*e if using t$e waterfa** -ode* to -o"e on to t$e ne1t ,$ase 8a"id %arnas< in > 5ationa* 8esign %rocess: 'ow and (hy to )a&e *t< writes: Q/an0 of t$e Js0ste-4sW detai*s on*0 beco-e ?nown to us as we ,rogress in t$e Js0ste-4sW i-,*e-entation So-e of t$e t$ings t$at we *earn in"a*idate our design and we -ust bac?trac? R E1,anding t$e conce,t abo"e< t$e ,roject sta?e$o*ders (non-!# ,ersonne*) -a0 not be fu**0 aware of t$e ca,abi*ities of t$e tec$no*og0 being i-,*e-ented #$is can *ead to w$at t$e0 Ht$in? is ,ossib*eH defining e1,ectations and re@uire-ents #$is can *ead to a design t$at does not use t$e fu** ,otentia* of w$at t$e new tec$no*og0 can de*i"er< or si-,*0 re,*icates t$e e1isting a,,*ication or ,rocess wit$ t$e new tec$no*og0 #$is can cause substantia* c$anges to t$e i-,*e-entation re@uire-ents once t$e sta?e$o*ders beco-e -ore aware of t$e functiona*it0 a"ai*ab*e fro- t$e new tec$no*og0 >n e1a-,*e is w$ere an organiDation -igrates fro- a ,a,er-based ,rocess to an e*ectronic ,rocess 3$i*e ?e0 de*i"erab*es of t$e ,a,er ,rocess -ust be -aintained< benefits of rea*-ti-e data in,ut "a*idation< traceabi*it0< and auto-ated decision ,oint routing -a0 not be antici,ated at t$e ear*0 ,*anning stages of t$e ,roject #$e idea be$ind t$e waterfa** -ode* -a0 be H-easure twiceG cut once<H and t$ose o,,osed to t$e waterfa** -ode* argue t$at t$is idea tends to fa** a,art w$en t$e ,rob*e- constant*0 c$anges due to re@uire-ent -odifications and new rea*iDations about t$e ,rob*e- itse*f > ,otentia* so*ution is for an e1,erienced de"e*o,er to s,end ti-e u, front on refactoring to conso*idate t$e software< and to ,re,are it for a ,ossib*e u,date< no -atter if suc$ is ,*anned a*read0 >not$er a,,roac$ is to use a design targeting -odu*arit0 wit$ interfaces to increase t$e f*e1ibi*it0 of t$e software wit$ res,ect to t$e design 8ue to t$e t0,es of criticis-s discussed abo"e< so-e organiDations< suc$ as t$e =S 8e,art-ent of 8efense< now $a"e a ,reference against waterfa** t0,e -et$odo*ogies< starting wit$ /i*-Std-'&) Hc*ear*0 encouraging e"o*utionar0 ac@uisition and !!8H #$e current 8o8 Standard 5000 2< re*eased in 2000< states a c*ear ,reference against waterfa**: H#$ere are two a,,roac$es< e"o*utionar0 and sing*e ste, Jwaterfa**W< to fu** ca,abi*it0 >n e"o*utionar0 a,,roac$ is ,referred V J!n t$isW a,,roac$< t$e u*ti-ate ca,abi*it0 de*i"ered to t$e user is di"ided into two or -ore b*oc?s< wit$ increasing incre-ents of ca,abi*it0 software de"e*o,-ent s$a** fo**ow an iterati"e s,ira* de"e*o,-ent ,rocess in w$ic$ continua**0 e1,anding software "ersions are based on *earning fro- ear*ier de"e*o,-ent H Modified models !n res,onse to t$e ,ercei"ed ,rob*e-s wit$ t$e ,ure waterfa** -ode*< -an0 -odified waterfa** -ode*s $a"e been introduced #$ese -ode*s -a0 address so-e or a** of t$e criticis-s of t$e ,ure waterfa** -ode* /an0 different -ode*s are co"ered b0 Ste"e /cConne** in t$e H*ife-c0c*e ,*anningH c$a,ter of $is boo? +a!id ,evelo!ment- Taming (ild Software Schedules

- 32 -

Course Notes: 3$i*e a** software de"e*o,-ent -ode*s bear so-e si-i*arit0 to t$e waterfa** -ode*< as a** software de"e*o,-ent -ode*s incor,orate at *east so-e ,$ases si-i*ar to t$ose used in t$e waterfa** -ode*< t$is section dea*s wit$ t$ose c*osest to t$e waterfa** -ode* Aor -ode*s t$at a,,*0 furt$er differences to t$e waterfa** -ode*< or for radica**0 different -ode*s see? genera* infor-ation on t$e software de"e*o,-ent ,rocess

S+iral ,odel
#$e ?e0 c$aracteristic of a S,ira* -ode* is ris? -anage-ent at regu*ar stages in t$e de"e*o,-ent c0c*e !n 1&))< +arr0 +oe$- ,ub*is$ed a for-a* software s0ste- de"e*o,-ent Hs,ira* -ode*<H w$ic$ co-bines so-e ?e0 as,ect of t$e waterfa** -ode* and ra,id ,rotot0,ing -et$odo*ogies< but ,ro"ided e-,$asis in a ?e0 area -an0 fe*t $ad been neg*ected b0 ot$er -et$odo*ogies: de*iberate iterati"e ris? ana*0sis< ,articu*ar*0 suited to *arge-sca*e co-,*e1 s0ste-s #$e S,ira* is "isua*iDed as a ,rocess ,assing t$roug$ so-e nu-ber of iterations< wit$ t$e four @uadrant diagra- re,resentati"e of t$e fo**owing acti"ities: 1 for-u*ate ,*ans to: identif0 software targets< se*ected to i-,*e-ent t$e ,rogra-< c*arif0 t$e ,roject de"e*o,-ent restrictionsG 2 5is? ana*0sis: an ana*0tica* assess-ent of se*ected ,rogra-s< to consider $ow to identif0 and e*i-inate ris?G 3 t$e i-,*e-entation of t$e ,roject: t$e i-,*e-entation of software de"e*o,-ent and "erificationG 5is?-dri"en s,ira* -ode*< e-,$asiDing t$e conditions of o,tions and constraints in order to su,,ort software reuse< software @ua*it0 can $e*, as a s,ecia* goa* of integration into t$e ,roduct de"e*o,-ent ;owe"er< t$e s,ira* -ode* $as so-e restricti"e conditions< as fo**ows: 1 #$e s,ira* -ode* e-,$asiDes ris? ana*0sis< and t$us re@uires custo-ers to acce,t t$is ana*0sis and act on it #$is re@uires bot$ trust in t$e de"e*o,er as we** as t$e wi**ingness to s,end -ore to fi1 t$e issues< w$ic$ is t$e reason w$0 t$is -ode* is often used for *arge-sca*e interna* software de"e*o,-ent 2 !f t$e i-,*e-entation of ris? ana*0sis wi** great*0 affect t$e ,rofits of t$e ,roject< t$e s,ira* -ode* s$ou*d not be used 3 Software de"e*o,ers $a"e to acti"e*0 *oo? for ,ossib*e ris?s< and ana*0De it accurate*0 for t$e s,ira* -ode* to wor? #$e first stage is to for-u*ate a ,*an to ac$ie"e t$e objecti"es wit$ t$ese constraints< and t$en stri"e to find and re-o"e a** ,otentia* ris?s t$roug$ carefu* ana*0sis and< if necessar0< b0 constructing a ,rotot0,e !f so-e ris?s can not be ru*ed out< t$e custo-er $as to decide w$et$er to ter-inate t$e ,roject or to ignore t$e ris?s and continue an0wa0 Aina**0< t$e resu*ts are e"a*uated and t$e design of t$e ne1t ,$ase begins #terative and incremental development !terati"e de"e*o,-ent ,rescribes t$e construction of initia**0 s-a** but e"er-*arger ,ortions of a software ,roject to $e*, a** t$ose in"o*"ed to unco"er i-,ortant issues ear*0 before ,rob*e-s or fau*t0 assu-,tions can *ead to disaster - 33 -

Object-Oriented Software Engineering (CS350) %gile development >gi*e software de"e*o,-ent uses iterati"e de"e*o,-ent as a basis but ad"ocates a *ig$ter and -ore ,eo,*e-centric "iew,oint t$an traditiona* a,,roac$es >gi*e ,rocesses use feedbac?< rat$er t$an ,*anning< as t$eir ,ri-ar0 contro* -ec$anis- #$e feedbac? is dri"en b0 regu*ar tests and re*eases of t$e e"o*"ing software #$ere are -an0 "ariations of agi*e ,rocesses: !n E1tre-e %rogra--ing (T%)< t$e ,$ases are carried out in e1tre-e*0 s-a** (or HcontinuousH) ste,s co-,ared to t$e o*der< Hbatc$H ,rocesses #$e (intentiona**0 inco-,*ete) first ,ass t$roug$ t$e ste,s -ig$t ta?e a da0 or a wee?< rat$er t$an t$e -ont$s or 0ears of eac$ co-,*ete ste, in t$e 3aterfa** -ode* Airst< one writes auto-ated tests< to ,ro"ide concrete goa*s for de"e*o,-ent Ne1t is coding (b0 a ,air of ,rogra--ers)< w$ic$ is co-,*ete w$en a** t$e tests ,ass< and t$e ,rogra--ers can4t t$in? of an0 -ore tests t$at are needed 8esign and arc$itecture e-erge out of refactoring< and co-e after coding #$e sa-e ,eo,*e w$o do t$e coding do design (On*0 t$e *ast feature X -erging design and code X is co--on to all t$e ot$er agi*e ,rocesses ) #$e inco-,*ete but functiona* s0ste- is de,*o0ed or de-onstrated for (so-e subset of) t$e users (at *east one of w$ic$ is on t$e de"e*o,-ent tea-) >t t$is ,oint< t$e ,ractitioners start again on writing tests for t$e ne1t -ost i-,ortant ,art of t$e s0ste Scru 80na-ic s0ste-s de"e*o,-ent -et$od Code and fi$ HCode and fi1H de"e*o,-ent is not so -uc$ a de*iberate strateg0 as an artifact of nai"ete and sc$edu*e ,ressure on software de"e*o,ers 3it$out -uc$ of a design in t$e wa0< ,rogra--ers i--ediate*0 begin ,roducing code >t so-e ,oint< testing begins (often *ate in t$e de"e*o,-ent c0c*e)< and t$e ine"itab*e bugs -ust t$en be fi1ed before t$e ,roduct can be s$i,,ed See a*so: Continuous integration and Cowbo0 coding

3e-use
>d $oc code reuse $as been ,racticed fro- t$e ear*iest da0s of ,rogra--ing %rogra--ers $a"e a*wa0s reused sections of code< te-,*ates< functions< and ,rocedures Software reuse as a recogniDed area of stud0 in software engineering< $owe"er< dates on*0 fro- 1&() w$en 8oug*as /c!*ro0 of +e** .aboratories ,ro,osed basing t$e software industr0 on reusab*e co-,onents Code reuse is t$e idea t$at a ,artia* co-,uter ,rogra- written at one ti-e can be< s$ou*d be< or is being used in anot$er ,rogra- written at a *ater ti-e #$e reuse of ,rogra--ing code is a co--on tec$ni@ue w$ic$ atte-,ts to sa"e ti-e and energ0 b0 reducing redundant wor? #$e software *ibrar0 is a good e1a-,*e of code reuse %rogra--ers -a0 decide to create interna* abstractions so t$at certain ,arts of t$eir ,rogra- can be reused< or -a0 create custo- *ibraries for t$eir own use So-e c$aracteristics t$at -a?e software -ore easi*0 reusab*e are -odu*arit0< *oose cou,*ing< $ig$ co$esion< infor-ation $iding and se,aration of concerns

- 3' -

Course Notes: Aor new*0 written code to use a ,iece of e1isting code< so-e ?ind of interface< or -eans of co--unication< -ust be defined #$ese co--on*0 inc*ude a Hca**H or use of a subroutine< object< c*ass< or ,rotot0,e !n organiDations< suc$ ,ractices are for-a*iDed and standardiDed b0 do-ain engineering a?a software ,roduct *ine engineering #$e genera* ,ractice of using a ,rior "ersion of an e1tant ,rogra- as a starting ,oint for t$e ne1t "ersion< is a*so a for- of code reuse So-e so-ca**ed code HreuseH in"o*"es si-,*0 co,0ing so-e or a** of t$e code fro- an e1isting ,rograinto a new one 3$i*e organiDations can rea*iDe ti-e to -ar?et benefits for a new ,roduct wit$ t$is a,,roac$< t$e0 can subse@uent*0 be sadd*ed wit$ -an0 of t$e sa-e code du,*ication ,rob*e-s caused b0 cut and ,aste ,rogra--ing /an0 researc$ers $a"e wor?ed to -a?e reuse faster< easier< -ore s0ste-atic< and an integra* ,art of t$e nor-a* ,rocess of ,rogra--ing #$ese are so-e of t$e -ain goa*s be$ind t$e in"ention of objectoriented ,rogra--ing< w$ic$ beca-e one of t$e -ost co--on for-s of for-a*iDed reuse > so-ew$at *ater in"ention is generic ,rogra--ing >not$er< newer -eans is to use software HgeneratorsH< ,rogra-s w$ic$ can create new ,rogra-s of a certain t0,e< based on a set of ,ara-eters t$at users c$oose Aie*ds of stud0 about suc$ s0ste-s are generati"e ,rogra--ing and -eta,rogra--ing "ypes of reuse Concerning -oti"ation and dri"ing factors< reuse can be: O,,ortunistic - 3$i*e getting read0 to begin a ,roject< t$e tea- rea*iDes t$at t$ere are e1isting co-,onents t$at t$e0 can reuse %*anned - > tea- strategica**0 designs co-,onents so t$at t$e04** be reusab*e in future ,rojects !nterna* reuse - > tea- reuses its own co-,onents #$is -a0 be a business decision< since t$e tea- -a0 want to contro* a co-,onent critica* to t$e ,roject E1terna* reuse - > tea- -a0 c$oose to *icense a t$ird-,art0 co-,onent .icensing a t$ird-,art0 co-,onent t0,ica**0 costs t$e tea- 1 to 20 ,ercent of w$at it wou*d cost to de"e*o, interna**0 #$e tea- -ust a*so consider t$e ti-e it ta?es to find< *earn and integrate t$e co-,onent Concerning for- or structure of reuse< code can be: 5eferenced - #$e c*ient code contains a reference to reused code< and t$us t$e0 $a"e distinct *ife c0c*es and can $a"e distinct "ersions Aor?ed - #$e c*ient code contains a *oca* or ,ri"ate co,0 of t$e reused code< and t$us t$e0 s$are a sing*e *ife c0c*e and a sing*e "ersion Aor?-reuse is often discouraged because it4s a for- of code du,*ication< w$ic$ re@uires t$at e"er0 bug is corrected in eac$ co,0< and en$ance-ents -ade to reused code need to be -anua**0 -erged in e"er0 co,0 or t$e0 beco-e out-of-date ;owe"er< for?-reuse can $a"e benefits suc$ as iso*ation< f*e1ibi*it0 to c$ange t$e reused code< easier ,ac?aging< de,*o0-ent and "ersion -anage-ent

O,,ortunistic reuse can be categoriDed furt$er:

- 35 -

Object-Oriented Software Engineering (CS350) E$amples Software libraries > "er0 co--on e1a-,*e of code reuse is t$e tec$ni@ue of using a software *ibrar0 /an0 co--on o,erations< suc$ as con"erting infor-ation a-ong different we**-?nown for-ats< accessing e1terna* storage< interfacing wit$ e1terna* ,rogra-s< or -ani,u*ating infor-ation (nu-bers< words< na-es< *ocations< dates< etc ) in co--on wa0s< are needed b0 -an0 different ,rogra-s >ut$ors of new ,rogra-s can use t$e code in a software *ibrar0 to ,erfor- t$ese tas?s< instead of Hre-in"enting t$e w$ee*H< b0 writing fu**0 new code direct*0 in a ,rogra- to ,erfor- an o,eration .ibrar0 i-,*e-entations often $a"e t$e benefit of being we**-tested< and co"ering unusua* or arcane cases 8isad"antages inc*ude t$e inabi*it0 to twea? detai*s w$ic$ -a0 affect ,erfor-ance or t$e desired out,ut< and t$e ti-e and cost of ac@uiring< *earning< and configuring t$e *ibrar0 6esign +atterns > design ,attern is a genera* so*ution to a recurring ,rob*e- 8esign ,atterns are -ore conce,tua* t$an tangib*e and can be -odified to fit t$e e1act need ;owe"er< abstract c*asses and interfaces can be reused to i-,*e-ent certain ,atterns Fra,ewor7s 8e"e*o,ers genera**0 reuse *arge ,ieces of software "ia t$ird-,art0 a,,*ications and fra-ewor?s #$oug$ fra-ewor?s are usua**0 do-ain-s,ecific and a,,*icab*e on*0 to fa-i*ies of a,,*ications S/ste,atic software reuse S0ste-atic software reuse is sti** t$e -ost ,ro-ising strateg0 for increasing ,roducti"it0 and i-,ro"ing @ua*it0 in t$e software industr0 >*t$oug$ it is si-,*e in conce,t< successfu* software reuse i-,*e-entation is difficu*t in ,ractice > reason ,ut forward for t$is is t$e de,endence of software reuse on t$e conte1t in w$ic$ it is i-,*e-ented So-e ,rob*e-atic issues t$at needs to be addressed re*ated to s0ste-atic software reuse are: a c*ear and we**-defined ,roduct "ision is an essentia* foundation to an S%. an e"o*utionar0 i-,*e-entation strateg0 wou*d be a -ore ,rag-atic strateg0 for t$e co-,an0 t$ere e1ist a need for continuous -anage-ent su,,ort and *eaders$i, to ensure success

- 3( -

Course Notes: an a,,ro,riate organiDationa* structure is needed to su,,ort S%. engineering t$e c$ange of -indset fro- a ,roject-centric co-,an0 to a ,roduct-oriented co-,an0 is essentia*

%rocess iteration
Iterative and Incremental development is at t$e $eart of a c0c*ic software de"e*o,-ent ,rocess de"e*o,ed in res,onse to t$e wea?nesses of t$e waterfa** -ode* !t starts wit$ an initia* ,*anning and ends wit$ de,*o0-ent wit$ t$e c0c*ic interactions in between !terati"e and incre-enta* de"e*o,-ent are essentia* ,arts of t$e 5ationa* =nified %rocess< E1tre-e %rogra--ing and genera**0 t$e "arious agi*e software de"e*o,-ent fra-ewor?s !t fo**ows a si-i*ar ,rocess to t$e ,*an-do-c$ec?-act c0c*e of business ,rocess i-,ro"e-ent "he basic idea #$e basic idea be$ind t$e agi*e -et$od is to de"e*o, a s0ste- t$roug$ re,eated c0c*es (iterati"e) and in s-a**er ,ortions at a ti-e (incre-enta*)< a**owing software de"e*o,ers to ta?e ad"antage of w$at was *earned during de"e*o,-ent of ear*ier ,arts or "ersions of t$e s0ste- .earning co-es fro- bot$ t$e de"e*o,-ent and use of t$e s0ste-< w$ere ,ossib*e ?e0 ste,s in t$e ,rocess start wit$ a si-,*e i-,*e-entation of a subset of t$e software re@uire-ents and iterati"e*0 en$ance t$e e"o*"ing "ersions unti* t$e fu** s0ste- is i-,*e-ented >t eac$ iteration< design -odifications are -ade and new functiona* ca,abi*ities are added #$e ,rocedure itse*f consists of t$e initia*iDation ste,< t$e iteration ste,< and t$e %roject Contro* .ist #$e initia*iDation ste, creates a base "ersion of t$e s0ste- #$e goa* for t$is initia* i-,*e-entation is to create a ,roduct to w$ic$ t$e user can react !t s$ou*d offer a sa-,*ing of t$e ?e0 as,ects of t$e ,rob*e- and ,ro"ide a so*ution t$at is si-,*e enoug$ to understand and i-,*e-ent easi*0 #o guide t$e iteration ,rocess< a ,roject contro* *ist is created t$at contains a record of a** tas?s t$at need to be ,erfor-ed !t inc*udes suc$ ite-s as new features to be i-,*e-ented and areas of redesign of t$e e1isting so*ution #$e contro* *ist is constant*0 being re"ised as a resu*t of t$e ana*0sis ,$ase #$e iteration in"o*"es t$e redesign and i-,*e-entation of a tas? fro- t$e ,roject contro* *ist< and t$e ana*0sis of t$e current "ersion of t$e s0ste- #$e goa* for t$e design and i-,*e-entation of an0 iteration is to be si-,*e< straig$tforward< and -odu*ar< su,,orting redesign at t$at stage or as a tas? added to t$e ,roject contro* *ist #$e *e"e* of design detai* is not dictated b0 t$e interacti"e a,,roac$ !n a *ig$t-weig$t iterati"e ,roject t$e code -a0 re,resent t$e -ajor source of docu-entation of t$e s0ste-G $owe"er< in a critica* iterati"e ,roject a for-a* Software 8esign 8ocu-ent -a0 be used #$e ana*0sis of an iteration is based u,on user feedbac?< and t$e ,rogra- ana*0sis faci*ities a"ai*ab*e !t in"o*"es ana*0sis of t$e structure< -odu*arit0< usabi*it0< re*iabi*it0< efficienc0< 9 ac$ie"e-ent of goa*s #$e ,roject contro* *ist is -odified in *ig$t of t$e ana*0sis resu*ts Phases

- 32 -

Object-Oriented Software Engineering (CS350) !ncre-enta* de"e*o,-ent s*ices t$e s0ste- functiona*it0 into incre-ents (,ortions) !n eac$ incre-ent< a s*ice of functiona*it0 is de*i"ered t$roug$ crossdisci,*ine wor?< fro- t$e re@uire-ents to t$e de,*o0-ent #$e unified ,rocess grou,s incre-entsFiterations into ,$ases: ince,tion< e*aboration< construction< and transition !nce,tion identifies ,roject sco,e< re@uire-ents (functiona* and nonfunctiona*) and ris?s at a $ig$ *e"e* but in enoug$ detai* t$at wor? can be esti-ated E*aboration de*i"ers a wor?ing arc$itecture t$at -itigates t$e to, ris?s and fu*fi**s t$e nonfunctiona* re@uire-ents Construction incre-enta**0 fi**s-in t$e arc$itecture wit$ ,roduction-read0 code ,roduced froana*0sis< design< i-,*e-entation< and testing of t$e functiona* re@uire-ents #ransition de*i"ers t$e s0ste- into t$e ,roduction o,erating en"iron-ent

Eac$ of t$e ,$ases -a0 be di"ided into 1 or -ore iterations< w$ic$ are usua**0 ti-e-bo1ed rat$er t$an feature-bo1ed >rc$itects and ana*0sts wor? one iteration a$ead of de"e*o,ers and testers to ?ee, t$eir wor?-,roduct bac?*og fu** -sage /an0 e1a-,*es of ear*0 usage are ,ro"ided in Craig .ar-an and :ictor +asi*i4s artic*e H!terati"e and !ncre-enta* 8e"e*o,-ent: > +rief ;istor0H< wit$ one of t$e ear*iest being N>S>4s 1&(0s %roject /ercur0 >not$er is an Hear*0 and stri?ing e1a-,*e of a -ajor !!8 success is t$e "er0 $eart of N>S>Os s,ace s$utt*e softwareXt$e ,ri-ar0 a"ionics software s0ste-< w$ic$ AS8 bui*t fro- 1&22 to 1&)0 #$e teaa,,*ied !!8 in a series of 12 iterations o"er 31 -ont$s< a"eraging around eig$t wee?s ,er iteration #$eir -oti"ation for a"oiding t$e waterfa** *ife c0c*e was t$at t$e s$utt*e ,rogra-Os re@uire-ents c$anged during t$e software de"e*o,-ent ,rocessH So-e organiDations< suc$ as t$e =S 8e,art-ent of 8efense< $a"e a ,reference for iterati"e -et$odo*ogies< starting wit$ /!.-S#8-'&) Hc*ear*0 encouraging e"o*utionar0 ac@uisition and !!8H #$e current 8o8 Standard 5000 2< re*eased in 2000< states a c*ear ,reference for !!8: H#$ere are two a,,roac$es< e"o*utionar0 and sing*e ste, Jwaterfa**W< to fu** ca,abi*it0 >n e"o*utionar0 a,,roac$ is ,referred V J!n t$isW a,,roac$< t$e u*ti-ate ca,abi*it0 de*i"ered to t$e user is di"ided into two or -ore b*oc?s< wit$ increasing incre-ents of ca,abi*it0 software de"e*o,-ent s$a** fo**ow an iterati"e s,ira* de"e*o,-ent ,rocess in w$ic$ continua**0 e1,anding software "ersions are based on *earning froear*ier de"e*o,-ent H it can a*so be done in ,$ases

- 3) -

Course Notes: Contrast with .aterfall development 3aterfa** de"e*o,-ent co-,*etes t$e ,roject-wide wor?-,roducts of eac$ disci,*ine in one ste, before -o"ing on to t$e ne1t disci,*ine in t$e ne1t ste, +usiness "a*ue is de*i"ered a** at once< and on*0 at t$e "er0 end of t$e ,roject +ac?trac?ing is ,ossib*e in an iterati"e a,,roac$ #mplementation guidelines 7uide*ines t$at dri"e t$e i-,*e-entation and ana*0sis inc*ude: >n0 difficu*t0 in design< coding and testing a -odification s$ou*d signa* t$e need for redesign or re-coding /odifications s$ou*d fit easi*0 into iso*ated and eas0-to-find -odu*es !f t$e0 do not< so-e redesign is ,ossib*0 needed /odifications to tab*es s$ou*d be es,ecia**0 eas0 to -a?e !f an0 tab*e -odification is not @uic?*0 and easi*0 done< redesign is indicated /odifications s$ou*d beco-e easier to -a?e as t$e iterations ,rogress !f t$e0 are not< t$ere is a basic ,rob*e- suc$ as a design f*aw or a ,ro*iferation of ,atc$es %atc$es s$ou*d nor-a**0 be a**owed to e1ist for on*0 one or two iterations %atc$es -a0 be necessar0 to a"oid redesigning during an i-,*e-entation ,$ase #$e e1isting i-,*e-entation s$ou*d be ana*0Ded fre@uent*0 to deter-ine $ow we** it -easures u, to ,roject goa*s %rogra- ana*0sis faci*ities s$ou*d be used w$ene"er a"ai*ab*e to aid in t$e ana*0sis of ,artia* i-,*e-entations =ser reaction s$ou*d be so*icited and ana*0Ded for indications of deficiencies in t$e current i-,*e-entation

Specification
!n co-,uter science< a formal specification is a -at$e-atica* descri,tion of software or $ardware t$at -a0 be used to de"e*o, an i-,*e-entation !t describes what t$e s0ste- s$ou*d do< not (necessari*0) how t$e s0ste- s$ou*d do it 7i"en suc$ a s,ecification< it is ,ossib*e to use for-a* "erification tec$ni@ues to de-onstrate t$at a candidate s0ste- design is correct wit$ res,ect to t$e s,ecification #$is $as t$e ad"antage t$at incorrect candidate s0ste- designs can be re"ised before a -ajor in"est-ent $as been -ade in actua**0 i-,*e-enting t$e design >n a*ternati"e a,,roac$ is to use ,ro"ab*0 correct refine-ent ste,s to transfor- a s,ecification into a design< and u*ti-ate*0 into an actua* i-,*e-entation< t$at is correct b0 construction > design (or i-,*e-entation) cannot e"er be dec*ared QcorrectR in iso*ation< but on*0 Qcorrect wit$ res,ect to a gi"en s,ecificationR 3$et$er t$e for-a* s,ecification correct*0 describes t$e ,rob*e- to be so*"ed is a se,arate issue !t is a*so a difficu*t issue to address< since it u*ti-ate*0 concerns t$e ,rob*econstructing abstracted for-a* re,resentations of an infor-a* concrete ,rob*e- do-ain< and suc$ an abstraction ste, is not a-enab*e to for-a* ,roof ;owe"er< it is ,ossib*e to "a*idate a s,ecification b0 ,ro"ing Qc$a**engeR t$eore-s concerning ,ro,erties t$at t$e s,ecification is e1,ected to e1$ibit !f correct< t$ese t$eore-s reinforce t$e s,ecifier4s understanding of t$e s,ecification and its re*ations$i, wit$ t$e under*0ing ,rob*e- do-ain !f not< t$e s,ecification ,robab*0 needs to be c$anged to better - 3& -

Object-Oriented Software Engineering (CS350) ref*ect t$e do-ain understanding of t$ose in"o*"ed wit$ ,roducing (and i-,*e-enting) t$e s,ecification #$e Y notation is an e1a-,*e of a *eading for-a* s,ecification *anguage Ot$ers inc*ude t$e S,ecification .anguage(:8/-S.) of t$e :ienna 8e"e*o,-ent /et$od and t$e >bstract /ac$ine Notation (>/N) of t$e +-/et$od !n t$e 3eb ser"ices area< for-a* s,ecification is often used to describe non-functiona* ,ro,erties (3eb ser"ices Eua*it0 of Ser"ice)

Design ) #mplementation
&oft%are design is a ,rocess of ,rob*e- so*"ing and ,*anning for a software so*ution >fter t$e ,ur,ose and s,ecifications of software are deter-ined< software de"e*o,ers wi** design or e-,*o0 designers to de"e*o, a ,*an for a so*ution !t inc*udes *ow-*e"e* co-,onent and a*gorit$i-,*e-entation issues as we** as t$e arc$itectura* "iew

O#er#iew
#$e software re@uire-ents ana*0sis (S5>) ste, of a software de"e*o,-ent ,rocess 0ie*ds s,ecifications t$at are used in software engineering !f t$e software is Hse-i-auto-atedH or user centered< software design -a0 in"o*"e user e1,erience design 0ie*ding a stor0 board to $e*, deter-ine t$ose s,ecifications !f t$e software is co-,*ete*0 auto-ated (-eaning no user or user interface)< a software design -a0 be as si-,*e as a f*ow c$art or te1t describing a ,*anned se@uence of e"ents #$ere are a*so se-i-standard -et$ods *i?e =nified /ode*ing .anguage and Aunda-enta* -ode*ing conce,ts !n eit$er case so-e docu-entation of t$e ,*an is usua**0 t$e ,roduct of t$e design > software design -a0 be ,*atfor--inde,endent or ,*atfor--s,ecific< de,ending on t$e a"ai*abi*it0 of t$e tec$no*og0 ca**ed for b0 t$e design Software design can be considered as ,utting so*ution to t$e ,rob*e-(s) in $and using t$e a"ai*ab*e ca,abi*ities ;ence t$e -ain difference between Software ana*0sis and design is t$at t$e out,ut of t$e ana*0sis of a software ,rob*e- wi** be s-a**er ,rob*e-s to so*"e and it s$ou*d not de"iate so -uc$ e"en if it is conducted b0 different tea- -e-bers or e"en b0 entire*0 different grou,s +ut since design de,ends on t$e ca,abi*ities< we can $a"e different designs for t$e sa-e ,rob*e- de,ending on t$e ca,abi*ities of t$e en"iron-ent t$at wi** $ost t$e so*ution (w$et$er it is so-e OS< web< -obi*e or e"en t$e new c*oud co-,uting ,aradig-) #$e so*ution wi** de,end a*so on t$e used de"e*o,-ent en"iron-ent (3$et$er 0ou bui*d a so*ution fro- scratc$ or using re*iab*e fra-ewor?s or at *east i-,*e-ent so-e suitab*e design ,atterns)

Software design to+ics


Design concepts #$e design conce,ts ,ro"ide t$e software designer wit$ a foundation fro- w$ic$ -ore so,$isticated -et$ods can be a,,*ied > set of funda-enta* design conce,ts $as e"o*"ed #$e0 are:

- '0 -

Course Notes: 1 >bstraction - >bstraction is t$e ,rocess or resu*t of genera*iDation b0 reducing t$e infor-ation content of a conce,t or an obser"ab*e ,$eno-enon< t0,ica**0 in order to retain on*0 infor-ation w$ic$ is re*e"ant for a ,articu*ar ,ur,ose 2 5efine-ent - !t is t$e ,rocess of e*aboration > $ierarc$0 is de"e*o,ed b0 deco-,osing a -acrosco,ic state-ent of function in a ste,wise fas$ion unti* ,rogra--ing *anguage state-ents are reac$ed !n eac$ ste,< one or se"era* instructions of a gi"en ,rogra- are deco-,osed into -ore detai*ed instructions >bstraction and 5efine-ent are co-,*e-entar0 c 3 /odu*arit0 - Software arc$itecture is di"ided into co-,onents ca**ed -odu*es ' Software >rc$itecture - !t refers to t$e o"era** structure of t$e software and t$e wa0s in w$ic$ t$at structure ,ro"ides conce,tua* integrit0 for a s0ste- > good software arc$itecture wi** 0ie*d a good return on in"est-ent wit$ res,ect to t$e desired outco-e of t$e ,roject< e g in ter-s of ,erfor-ance< @ua*it0< sc$edu*e and cost 5 Contro* ;ierarc$0 - > ,rogra- structure t$at re,resents t$e organiDation of a ,rograco-,onent and i-,*ies a $ierarc$0 of contro* ( Structura* %artitioning - #$e ,rogra- structure can be di"ided bot$ $oriDonta**0 and "ertica**0 ;oriDonta* ,artitions define se,arate branc$es of -odu*ar $ierarc$0 for eac$ -ajor ,rografunction :ertica* ,artitioning suggests t$at contro* and wor? s$ou*d be distributed to, down in t$e ,rogra- structure 2 8ata Structure - !t is a re,resentation of t$e *ogica* re*ations$i, a-ong indi"idua* e*e-ents of data ) Software %rocedure - !t focuses on t$e ,rocessing of eac$ -odu*es indi"idua**0 & !nfor-ation ;iding - /odu*es s$ou*d be s,ecified and designed so t$at infor-ation contained wit$in a -odu*e is inaccessib*e to ot$er -odu*es t$at $a"e no need for suc$ infor-ation Design considerations #$ere are -an0 as,ects to consider in t$e design of a ,iece of software #$e i-,ortance of eac$ s$ou*d ref*ect t$e goa*s t$e software is tr0ing to ac$ie"e So-e of t$ese as,ects are: !ompatibility - #$e software is ab*e to o,erate wit$ ot$er ,roducts t$at are designed for intero,erabi*it0 wit$ anot$er ,roduct Aor e1a-,*e< a ,iece of software -a0 be bac?wardco-,atib*e wit$ an o*der "ersion of itse*f Extensibility - New ca,abi*ities can be added to t$e software wit$out -ajor c$anges to t$e under*0ing arc$itecture 'ault(tolerance - #$e software is resistant to and ab*e to reco"er fro- co-,onent fai*ure )aintainability - > -easure of $ow easi*0 -odified t$e software is t$roug$ bug fi1es or functiona* -odifications ;ig$ -aintainabi*it0 can be t$e ,roduct of -odu*arit0 and e1tensibi*it0 )odularity - t$e resu*ting software co-,rises we** defined< inde,endent co-,onents #$at *eads to better -aintainabi*it0 #$e co-,onents cou*d be t$en i-,*e-ented and tested in iso*ation before being integrated to for- a desired software s0ste- #$is a**ows di"ision of wor? in a software de"e*o,-ent ,roject

- '1 -

Object-Oriented Software Engineering (CS350) ac*aging - %rinted -ateria* suc$ as t$e bo1 and -anua*s s$ou*d -atc$ t$e st0*e designated for t$e target -ar?et and s$ou*d en$ance usabi*it0 >** co-,atibi*it0 infor-ation s$ou*d be "isib*e on t$e outside of t$e ,ac?age >** co-,onents re@uired for use s$ou*d be inc*uded in t$e ,ac?age or s,ecified as a re@uire-ent on t$e outside of t$e ,ac?age Reliability - #$e software is ab*e to ,erfor- a re@uired function under stated conditions for a s,ecified ,eriod of ti-e Reusability - t$e software is ab*e to add furt$er features and -odification wit$ s*ig$t or no -odification Robustness - #$e software is ab*e to o,erate under stress or to*erate un,redictab*e or in"a*id in,ut Aor e1a-,*e< it can be designed wit$ a resi*ience to *ow -e-or0 conditions &ecurity - #$e software is ab*e to wit$stand $osti*e acts and inf*uences Usability - #$e software user interface -ust be usab*e for its target userFaudience 8efau*t "a*ues for t$e ,ara-eters -ust be c$osen so t$at t$e0 are a good c$oice for t$e -ajorit0 of t$e users

Modeling language > -ode*ing *anguage is an0 artificia* *anguage t$at can be used to e1,ress infor-ation or ?now*edge or s0ste-s in a structure t$at is defined b0 a consistent set of ru*es #$e ru*es are used for inter,retation of t$e -eaning of co-,onents in t$e structure > -ode*ing *anguage can be gra,$ica* or te1tua* E1a-,*es of gra,$ica* -ode*ing *anguages for software design are: +usiness %rocess /ode*ing Notation (+%/N) is an e1a-,*e of a %rocess /ode*ing *anguage ET%5ESS and ET%5ESS-7 (!SO 10303-11) is an internationa* standard genera*-,ur,ose data -ode*ing *anguage E1tended Enter,rise /ode*ing .anguage (EE/.) is co--on*0 used for business ,rocess -ode*ing across a nu-ber of *a0ers A*owc$art is a sc$e-atic re,resentation of an a*gorit$- or a ste,wise ,rocess< Aunda-enta* /ode*ing Conce,ts (A/C) -ode*ing *anguage for software-intensi"e s0ste-s !8EA is a fa-i*0 of -ode*ing *anguages< t$e -ost notab*e of w$ic$ inc*ude !8EA0 for functiona* -ode*ing< !8EA1T for infor-ation -ode*ing< and !8EA5 for -ode*ing onto*ogies Iac?son Structured %rogra--ing (IS%) is a -et$od for structured ,rogra--ing based on corres,ondences between data strea- structure and ,rogra- structure .e%=S3 is an object-oriented "isua* 8esign 8escri,tion .anguage and a for-a* s,ecification *anguage t$at is suitab*e ,ri-ari*0 for -ode*ing *arge object-oriented (Ia"a< CBB< CU) ,rogra-s and design ,atterns =nified /ode*ing .anguage (=/.) is a genera* -ode*ing *anguage to describe software bot$ structura**0 and be$a"iora**0 !t $as a gra,$ica* notation and a**ows for e1tension wit$ a %rofi*e (=/.) >**o0 (s,ecification *anguage) is a genera* ,ur,ose s,ecification *anguage for e1,ressing co-,*e1 structura* constraints and be$a"ior in a software s0ste- !t ,ro"ides a concise *anguage based on first-order re*ationa* *ogic S0ste-s /ode*ing .anguage (S0s/.) is a new genera*-,ur,ose -ode*ing *anguage for s0ste-s engineering - '2 -

Course Notes: Design patterns > software designer or arc$itect -a0 identif0 a design ,rob*e- w$ic$ $as been so*"ed b0 ot$ers before > te-,*ate or ,attern describing a so*ution to a co--on ,rob*e- is ?nown as a design ,attern #$e reuse of suc$ ,atterns can s,eed u, t$e software de"e*o,-ent ,rocess< $a"ing been tested and ,ro"en in t$e ,ast -sage Software design docu-entation -a0 be re"iewed or ,resented to a**ow constraints< s,ecifications and e"en re@uire-ents to be adjusted ,rior to ,rogra--ing 5edesign -a0 occur after re"iew of a ,rogra--ed si-u*ation or ,rotot0,e !t is ,ossib*e to design software in t$e ,rocess of ,rogra--ing< wit$out a ,*an or re@uire-ent ana*0sis< but for -ore co-,*e1 ,rojects t$is wou*d not be considered a ,rofessiona* a,,roac$ > se,arate design ,rior to ,rogra--ing a**ows for -u*tidisci,*inar0 designers and Subject /atter E1,erts (S/Es) to co**aborate wit$ $ig$*0-s?i**ed ,rogra--ers for software t$at is bot$ usefu* and tec$nica**0 sound

!alidation ) Evolution
!n software ,roject -anage-ent< software testing< and software engineering< verification and validation (+,+) is t$e ,rocess of c$ec?ing t$at a software s0ste- -eets s,ecifications and t$at it fu*fi**s its intended ,ur,ose !t -a0 a*so be referred to as software @ua*it0 contro* !t is nor-a**0 t$e res,onsibi*it0 of software testers as ,art of t$e software de"e*o,-ent *ifec0c*e

Definitions
:a*idation c$ec?s t$at t$e ,roduct design satisfies or fits t$e intended usage ($ig$-*e"e* c$ec?ing)< i e t$e software -eets t$e user re@uire-ent #$is is done t$roug$ d0na-ic testing and ot$er for-s of re"iew >ccording to t$e Ca,abi*it0 /aturit0 /ode* (C//!-S3 "1 1)< :erification: #$e ,rocess of e"a*uating software to deter-ine w$et$er t$e ,roducts of a gi"en de"e*o,-ent ,$ase satisf0 t$e conditions i-,osed at t$e start of t$at ,$ase J!EEE-S#8-(10W :a*idation: #$e ,rocess of e"a*uating software during or at t$e end of t$e de"e*o,-ent ,rocess to deter-ine w$et$er it satisfies s,ecified re@uire-ents J!EEE-S#8-(10W !n ot$er words< "a*idation ensures t$at t$e ,roduct actua**0 -eets t$e user4s needs< and t$at t$e s,ecifications were correct in t$e first ,*ace< w$i*e "erification is ensuring t$at t$e ,roduct $as been bui*t according to t$e re@uire-ents and design s,ecifications :a*idation ensures t$at H0ou bui*t t$e rig$t t$ingH :erification ensures t$at H0ou bui*t it rig$tH :a*idation confir-s t$at t$e ,roduct< as ,ro"ided< wi** fu*fi** its intended use Aro- testing ,ers,ecti"e: Aau*t C wrong or -issing function in t$e code Aai*ure C t$e -anifestation of a fau*t during e1ecution - '3 -

Object-Oriented Software Engineering (CS350) /a*function C according to its s,ecification t$e s0ste- does not -eet its s,ecified functiona*it0 3it$in t$e -ode*ing and si-u*ation co--unit0< t$e definitions of "a*idation< "erification and accreditation are si-i*ar: :a*idation is t$e ,rocess of deter-ining t$e degree to w$ic$ a -ode*< si-u*ation< or federation of -ode*s and si-u*ations< and t$eir associated data are accurate re,resentations of t$e rea* wor*d fro- t$e ,ers,ecti"e of t$e intended use(s) >ccreditation is t$e for-a* certification t$at a -ode* or si-u*ation is acce,tab*e to be used for a s,ecific ,ur,ose :erification is t$e ,rocess of deter-ining t$at a co-,uter -ode*< si-u*ation< or federation of -ode*s and si-u*ations i-,*e-entations and t$eir associated data accurate*0 re,resents t$e de"e*o,er4s conce,tua* descri,tion and s,ecifications

3elated conce+ts
+ot$ "erification and "a*idation are re*ated to t$e conce,ts of @ua*it0 and of software @ua*it0 assurance +0 t$e-se*"es< "erification and "a*idation do not guarantee software @ua*it0G ,*anning< traceabi*it0< configuration -anage-ent and ot$er as,ects of software engineering are re@uired

Classification of ,et$ods
!n -ission-critica* s0ste-s w$ere f*aw*ess ,erfor-ance is abso*ute*0 necessar0< for-a* -et$ods can be used to ensure t$e correct o,eration of a s0ste- ;owe"er< often for non--ission-critica* s0ste-s< for-a* -et$ods ,ro"e to be "er0 cost*0 and an a*ternati"e -et$od of :9: -ust be soug$t out !n t$is case< s0ntactic -et$ods are often used "est cases > test case is a too* used in t$e ,rocess #est cases are ,re,ared for "erification: to deter-ine if t$e ,rocess t$at was fo**owed to de"e*o, t$e fina* ,roduct is rig$t #est cases are e1ecuted for "a*idation: if t$e ,roduct is bui*t according to t$e re@uire-ents of t$e user Ot$er -et$ods< suc$ as re"iews< are used w$en used ear*0 in t$e Software 8e"e*o,-ent .ife C0c*e ,ro"ide for "a*idation

"nde+endent 8erification and 8alidation


:erification and "a*idation often is carried out b0 a se,arate grou, fro- t$e de"e*o,-ent tea-G in t$is case< t$e ,rocess is ca**ed Hindependent verification and validationH< or I+,+

+egulatory environment

- '' -

Course Notes: :erification and "a*idation -ust -eet t$e co-,*iance re@uire-ents of *aw regu*ated industries< w$ic$ is often guided b0 go"ern-ent agencies or industria* ad-inistrati"e aut$orities e g #$e A8> re@uires software "ersions and ,atc$es to be "a*idated &oft%are evolution is t$e ter- used in software engineering (s,ecifica**0 software -aintenance) to refer to t$e ,rocess of de"e*o,ing software initia**0< t$en re,eated*0 u,dating it for "arious reasons

5eneral introduction
Ared +roo?s< in $is ?e0 boo? The Mythical Man#Month< states t$at o"er &0N of t$e costs of a t0,ica* s0ste- arise in t$e -aintenance ,$ase< and t$at an0 successfu* ,iece of software wi** ine"itab*0 be -aintained !n fact< >gi*e -et$ods ste- fro- -aintenance *i?e acti"ities in and around web based tec$no*ogies< w$ere t$e bu*? of t$e ca,abi*it0 co-es fro- fra-ewor?s and standards Software -aintenance address bug fi1es and -inor en$ance-ents and software e"o*ution focus on ada,tation and -igration

",+act of software e#olution


#$e ai- of software e"o*ution wou*d be i-,*e-enting (and re"a*idate) t$e ,ossib*e -ajor c$anges to t$e s0ste- wit$out being ab*e a ,riori to ,redict $ow user re@uire-ents wi** e"o*"e J1W #$e e1isting *arger s0ste- is ne"er co-,*ete and continues to e"o*"e J2W >s it e"o*"es< t$e co-,*e1it0 of t$e s0stewi** grow un*ess t$ere is a better so*ution a"ai*ab*e to so*"e t$ese issues #$e -ain objecti"es of software e"o*ution are ensuring t$e re*iabi*it0 and f*e1ibi*it0 of t$e s0ste- 8uring t$e 20 0ears ,asted< t$e *ifes,an of a s0ste- cou*d be in a"erage (-10 0ears ;owe"er< recent*0 found t$at a s0ste- s$ou*d be e"o*"ed once few -ont$s to ensure it is co-,ro-ised to t$e rea*-wor*d en"iron-ent #$is is due to t$e ra,id growt$ of 3or*d 3ide 3eb and !nternet 5esources t$at -a?e users easier to find re*ated infor-ation #$e idea of software e"o*ution *eads to o,en source de"e*o,-ent as an0bod0 cou*d down*oad t$e source codes and $ence -odif0 it #$e ,ositi"e i-,act in t$is case is *arge a-ounts of new ideas wou*d be disco"ered and generated t$at ai-s t$e s0ste- to $a"e better i-,ro"e-ent in "ariet0 c$oices ;owe"er< t$e negati"e i-,act is t$ere is no co,0rig$t if a software ,roduct $as been ,ub*is$ed as o,en source

C$anges in Software E#olution .odels and $eories


O"er ti-e< software s0ste-s< ,rogra-s as we** as a,,*ications continue to de"e*o, #$ese c$anges wi** re@uire new *aws and t$eories to be created and justified So-e -ode*s as we** wou*d re@uire additiona* as,ects in de"e*o,ing future ,rogra-s !nno"ations and i-,ro"e-ents do increase une1,ected for- of software de"e*o,-ent #$e -aintenance issues a*so wou*d ,robab*0 c$anged as to ada,t to t$e e"o*ution of t$e future software Software ,rocess and de"e*o,-ent are an ongoing e1,erience t$at $as a ne"er-ending c0c*e >fter going t$roug$ *earning and refine-ents< it is a*wa0s an arguab*e issue w$en it co-es to -atter of efficienc0 and effecti"eness of t$e ,rogra-s Jaedd0G ref: =nderstanding O,en Source Software E"o*ution 3a*t Scacc$i !nstitute for Software 5esearc$W

- '5 -

Object-Oriented Software Engineering (CS350)

/+es of software ,aintenance


E + Swanson initia**0 identified t$ree categories of -aintenance: correcti"e< ada,ti"e< and ,erfecti"e Aour categories of software were t$en cata*ogued b0 .ientD and Swanson (1&)0) #$ese $a"e since been u,dated and nor-a*iDed internationa**0 in t$e !SOF!EC 1'2(':200(: .orrective maintenance: 5eacti"e -odification of a software ,roduct ,erfor-ed after de*i"er0 to correct disco"ered ,rob*e-sG da!tive maintenance: /odification of a software ,roduct ,erfor-ed after de*i"er0 to ?ee, a software ,roduct usab*e in a c$anged or c$anging en"iron-entG /erfective maintenance: /odification of a software ,roduct after de*i"er0 to i-,ro"e ,erfor-ance or -aintainabi*it0G /reventive maintenance: /odification of a software ,roduct after de*i"er0 to detect and correct *atent fau*ts in t$e software ,roduct before t$e0 beco-e effecti"e fau*ts >** of t$e ,receding ta?e ,*ace w$en t$ere is a ?nown re@uire-ent for c$ange >*t$oug$ t$ese categories were su,,*e-ented b0 -an0 aut$ors *i?e 3arren et a* (1&&&) and C$a,in (2001)< t$e !SOF!EC 1'2(':200( internationa* standard $as ?e,t t$e basic four categories /ore recent*0 t$e descri,tion of software -aintenance and e"o*ution $as been done using onto*ogies (Sitc$e-$a- et a* (1&&&)< 8erider (2002)< :iDcaZno 2003< 8ias (2003)< and 5uiD (200'))< w$ic$ enric$ t$e descri,tion of t$e -an0 e"o*ution acti"ities

Stage ,odel
Current trends and ,ractices are ,rojected forward using a new -ode* of software e"o*ution ca**ed t$e staged -ode* J1W Staged -ode* was introduced to re,*ace con"entiona* ana*0sis w$ic$ is *ess suitab*e for -odern software de"e*o,-ent is ra,id c$anging due to its difficu*ties of $ard to contribute in software e"o*ution #$ere are fi"e distinct stages contribute in si-,*e staged -ode* (!nitia* de"e*o,-ent< E"o*ution< Ser"icing< %$ase-out< and C*ose-down) >ccording to S ; +ennett and : # 5aj*ic$ J1W< t$e ?e0 contribution is to se,arate t$e 4-aintenance4 ,$ase into an e"o*ution stage fo**owed b0 a ser"icing and ,$ase out stages #$e first "ersion of software s0ste- w$ic$ is *ac?ing so-e features wi** be de"e*o,ed during initia* de"e*o,-ent or a*so ?nown as a*,$a stage J2W ;owe"er< t$e arc$itecture $as a*read0 been ,ossessed during t$is stage wi** bring for an0 future c$anges or a-end-ents /ost references in t$is stage wi** base on scenarios or case stud0 Snow*edge $as defined as anot$er i-,ortant outco-e of initia* de"e*o,-ent Suc$ ?now*edge inc*uding t$e ?now*edge of a,,*ication do-ain< user re@uire-ents< business ru*es< ,o*icies< so*utions< a*gorit$-< etc Snow*edge a*so see-s as t$e i-,ortant factor for t$e subse@uent ,$ase of e"o*ution Once t$e ,re"ious stage co-,*eted successfu**0 (and -ust be co-,*eted successfu**0 before entering ne1t stage)< t$e ne1t stage wou*d be e"o*ution =sers tend to c$ange t$eir re@uire-ents as we** as t$e0 ,refer to see so-e i-,ro"e-ents or c$anges 8ue to t$is factor< t$e software industr0 is facing t$e c$a**enges of ra,id c$anges en"iron-ent ;ence t$e goa* of e"o*ution is to ada,t t$e a,,*ication to t$e e"er-c$anging user re@uire-ents and o,erating en"iron-ent J1W 8uring t$e ,re"ious stage< t$e first "ersion a,,*ication created -ig$t contain a *ot of fau*ts< and - '( -

Course Notes: t$ose fau*ts wi** be fi1ed during e"o*ution stage based on -ore s,ecified and accurate re@uire-ents due to t$e case stud0 or scenarios #$e software wi** continuous*0 e"o*"e unti* it is no *onger e"o*"ab*e and t$en enter stage of ser"icing (a*so ?nown as software -aturit0) 8uring t$is stage< on*0 -inor c$anges wi** be done Ne1t stage w$ic$ is ,$ase-out< t$ere is no -ore ser"icing a"ai*ab*e for t$at ,articu*ar software ;owe"er< t$e software sti** in ,roduction .ast*0< c*ose-down #$e software use is disconnected or discontinue and t$e users are directed towards a re,*ace-ent

-e$,an2s -aws of Software E#olution


%rof /eir / .e$-an< w$o wor?ed at !-,eria* Co**ege .ondon fro- 1&22 to 2002< and $is co**eagues $a"e identified a set of be$a"iors in t$e e"o*ution of ,ro,rietar0 software #$ese be$a"iors (or obser"ations) are ?nown as .e$-an4s .aws< and t$ere are eig$t of t$e-: 1 2 3 ' 5 ( 2 ) Continuing C$ange !ncreasing Co-,*e1it0 .arge %rogra- E"o*ution !n"ariant 3or?-5ate Conser"ation of Aa-i*iarit0 Continuing 7rowt$ 8ec*ining Eua*it0 Aeedbac? S0ste-

!t is wort$ -entioning t$at t$e *aws are be*ie"ed to a,,*0 -ain*0 to -ono*it$ic< ,ro,rietar0 software Aor e1a-,*e< so-e e-,irica* obser"ations co-ing fro- t$e stud0 of o,en source software de"e*o,-ent a,,ear to c$a**enge so-e of t$e *aws #$e *aws ,redict t$at c$ange is ine"itab*e and not a conse@uence of bad ,rogra--ing and t$at t$ere are *i-its to w$at a software e"o*ution tea- can ac$ie"e in ter-s of safe*0 i-,*e-enting c$anges and new functiona*it0 /aturit0 /ode*s s,ecific to software e"o*ution $a"e been de"e*o,ed to i-,ro"e ,rocesses< and $e*, to ensure continuous reju"enation of t$e software as it e"o*"es iterati"e*0 #$e Hg*oba* ,rocessH t$at is -ade b0 t$e -an0 sta?e$o*ders (e g de"e*o,ers< users< t$eir -anagers) $as -an0 feedbac? *oo,s #$e e"o*ution s,eed is a function of t$e feedbac? *oo, structure and ot$er c$aracteristics of t$e g*oba* s0ste- %rocess si-u*ation tec$ni@ues< suc$ as s0ste- d0na-ics can be usefu* in understanding and -anaging suc$ g*oba* ,rocess Software e"o*ution is not *i?e*0 to be 8arwinian< .a-arc?ian or +a*dwinian< but an i-,ortant ,$eno-enon on its own 7i"en t$e increasing de,endence on software at a** *e"e*s of societ0 and econo-0< t$e successfu* e"o*ution of software is beco-ing increasing*0 critica* #$is is an i-,ortant to,ic of researc$ t$at $asn4t recei"ed -uc$ attention #$e e"o*ution of software< because of its ra,id ,at$ in co-,arison to ot$er -an--ade entities< was seen b0 .e$-an as t$e Hfruit f*0H of t$e stud0 of t$e e"o*ution of artificia* s0ste-s - '2 -

Object-Oriented Software Engineering (CS350)

Pro'ect management
&oft%are project management is t$e art and science of ,*anning and *eading software ,rojects !t is a sub-disci,*ine of ,roject -anage-ent in w$ic$ software ,rojects are ,*anned< -onitored and contro**ed

9istor/
Co-,anies @uic?*0 understood t$e re*ati"e ease of use t$at software ,rogra--ing $ad o"er $ardware circuitr0< and t$e software industr0 grew "er0 @uic?*0 in t$e 1&20s and 1&)0s #o -anage new de"e*o,-ent efforts< co-,anies a,,*ied ,ro"en ,roject -anage-ent -et$ods< but ,roject sc$edu*es s*i,,ed during test runs< es,ecia**0 w$en confusion occurred in t$e gra0 Done between t$e user s,ecifications and t$e de*i"ered software #o be ab*e to a"oid t$ese ,rob*e-s< software ,roject -anage-ent -et$ods focused on -atc$ing user re@uire-ents to de*i"ered ,roducts< in a -et$od ?nown now as t$e waterfa** -ode* Since t$en< ana*0sis of software ,roject -anage-ent fai*ures $as s$own t$at t$e fo**owing are t$e -ost co--on causes: 1 =nrea*istic or unarticu*ated ,roject goa*s 2 !naccurate esti-ates of needed resources 3 +ad*0 defined s0ste- re@uire-ents ' %oor re,orting of t$e ,roject4s status 5 =n-anaged ris?s ( %oor co--unication a-ong custo-ers< de"e*o,ers< and users 2 =se of i--ature tec$no*og0 ) !nabi*it0 to $and*e t$e ,roject4s co-,*e1it0 & S*o,,0 de"e*o,-ent ,ractices 10 %oor ,roject -anage-ent 11 Sta?e$o*der ,o*itics 12 Co--ercia* ,ressures #$e first t$ree ite-s in t$e *ist abo"e s$ow t$e difficu*ties articu*ating t$e needs of t$e c*ient in suc$ a wa0 t$at ,ro,er resources can de*i"er t$e ,ro,er ,roject goa*s S,ecific software ,roject -anage-ent too*s are usefu* and often necessar0< but t$e true art in software ,roject -anage-ent is a,,*0ing t$e correct -et$od and t$en using too*s to su,,ort t$e -et$od 3it$out a -et$od< too*s are wort$*ess Since t$e 1&(0s< se"era* ,ro,rietar0 software ,roject -anage-ent -et$ods $a"e been de"e*o,ed b0 software -anufacturers for t$eir own use< w$i*e co-,uter consu*ting fir-s $a"e a*so de"e*o,ed si-i*ar -et$ods for t$eir c*ients #oda0 software ,roject -anage-ent -et$ods are sti** e"o*"ing< but t$e current trend *eads awa0 fro- t$e waterfa** -ode* to a -ore c0c*ic ,roject de*i"er0 -ode* t$at i-itates a Software re*ease *ife c0c*e

Software de#elo+,ent +rocess


> software de"e*o,-ent ,rocess is concerned ,ri-ari*0 wit$ t$e ,roduction as,ect of software de"e*o,-ent< as o,,osed to t$e tec$nica* as,ect< suc$ as software too*s #$ese ,rocesses e1ist ,ri-ari*0 for su,,orting t$e -anage-ent of software de"e*o,-ent< and are genera**0 s?ewed toward addressing - ') -

Course Notes: business concerns /an0 software de"e*o,-ent ,rocesses can be run in a si-i*ar wa0 to genera* ,roject -anage-ent ,rocesses E1a-,*es are: 5is? -anage-ent is t$e ,rocess of -easuring or assessing ris? and t$en de"e*o,ing strategies to -anage t$e ris? !n genera*< t$e strategies e-,*o0ed inc*ude transferring t$e ris? to anot$er ,art0< a"oiding t$e ris?< reducing t$e negati"e effect of t$e ris?< and acce,ting so-e or a** of t$e conse@uences of a ,articu*ar ris? 5is? -anage-ent in software ,roject -anage-ent begins wit$ t$e business case for starting t$e ,roject< w$ic$ inc*udes a cost-benefit ana*0sis as we** as a *ist of fa**bac? o,tions for ,roject fai*ure< ca**ed a contingenc0 ,*an > subset of ris? -anage-ent t$at is gaining -ore and -ore attention is O,,ortunit0 /anage-ent< w$ic$ -eans t$e sa-e t$ing< e1ce,t t$at t$e ,otentia* ris? outco-e wi** $a"e a ,ositi"e< rat$er t$an a negati"e i-,act #$oug$ t$eoretica**0 $and*ed in t$e sa-e wa0< using t$e ter- Ho,,ortunit0H rat$er t$an t$e so-ew$at negati"e ter- Hris?H $e*,s to ?ee, a tea- focused on ,ossib*e ,ositi"e outco-es of an0 gi"en ris? register in t$eir ,rojects< suc$ as s,in-off ,rojects< windfa**s< and free e1tra resources 5e@uire-ents -anage-ent is t$e ,rocess of identif0ing< e*iciting< docu-enting< ana*0Ding< tracing< ,rioritiDing and agreeing on re@uire-ents and t$en contro**ing c$ange and co--unicating to re*e"ant sta?e$o*ders New or a*tered co-,uter s0ste- 5e@uire-ents -anage-ent< w$ic$ inc*udes 5e@uire-ents ana*0sis< is an i-,ortant ,art of t$e software engineering ,rocessG w$ereb0 business ana*0sts or software de"e*o,ers identif0 t$e needs or re@uire-ents of a c*ientG $a"ing identified t$ese re@uire-ents t$e0 are t$en in a ,osition to design a so*ution C$ange -anage-ent is t$e ,rocess of identif0ing< docu-enting< ana*0Ding< ,rioritiDing and agreeing on c$anges to sco,e (,roject -anage-ent) and t$en contro**ing c$anges and co--unicating to re*e"ant sta?e$o*ders C$ange i-,act ana*0sis of new or a*tered sco,e< w$ic$ inc*udes 5e@uire-ents ana*0sis at t$e c$ange *e"e*< is an i-,ortant ,art of t$e software engineering ,rocessG w$ereb0 business ana*0sts or software de"e*o,ers identif0 t$e a*tered needs or re@uire-ents of a c*ientG $a"ing identified t$ese re@uire-ents t$e0 are t$en in a ,osition to re-design or -odif0 a so*ution #$eoretica**0< eac$ c$ange can i-,act t$e ti-e*ine and budget of a software ,roject< and t$erefore b0 definition -ust inc*ude ris?-benefit ana*0sis before a,,ro"a* Software configuration -anage-ent is t$e ,rocess of identif0ing< and docu-enting t$e sco,e itse*f< w$ic$ is t$e software ,roduct underwa0< inc*uding a** sub-,roducts and c$anges and enab*ing co--unication of t$ese to re*e"ant sta?e$o*ders !n genera*< t$e ,rocesses e-,*o0ed inc*ude "ersion contro*< na-ing con"ention (,rogra--ing)< and software arc$i"a* agree-ents 5e*ease -anage-ent is t$e ,rocess of identif0ing< docu-enting< ,rioritiDing and agreeing on re*eases of software and t$en contro**ing t$e re*ease sc$edu*e and co--unicating to re*e"ant sta?e$o*ders /ost software ,rojects $a"e access to t$ree software en"iron-ents to w$ic$ software can be re*easedG 8e"e*o,-ent< #est< and %roduction !n "er0 *arge ,rojects< w$ere distributed tea-s need to integrate t$eir wor? before re*ease to users< t$ere wi** often be -ore en"iron-ents for testing< ca**ed unit testing< s0ste- testing< or integration testing< before re*ease to =ser acce,tance testing (=>#)

- '& -

Object-Oriented Software Engineering (CS350) > subset of re*ease -anage-ent t$at is gaining -ore and -ore attention is 8ata /anage-ent< as ob"ious*0 t$e users can on*0 test based on data t$at t$e0 ?now< and Hrea*H data is on*0 in t$e software en"iron-ent ca**ed H,roductionH !n order to test t$eir wor?< ,rogra--ers -ust t$erefore a*so often create Hdu--0 dataH or Hdata stubsH #raditiona**0< o*der "ersions of a ,roduction s0ste- were once used for t$is ,ur,ose< but as co-,anies re*0 -ore and -ore on outside contributors for software de"e*o,-ent< co-,an0 data -a0 not be re*eased to de"e*o,-ent tea-s !n co-,*e1 en"iron-ents< datasets -a0 be created t$at are t$en -igrated across test en"iron-ents according to a test re*ease sc$edu*e< -uc$ *i?e t$e o"era** software re*ease sc$edu*e

%roject +lanning: ,onitoring and control


#$e ,ur,ose of ,roject ,*anning is to identif0 t$e sco,e of t$e ,roject< esti-ate t$e wor? in"o*"ed< and create a ,roject sc$edu*e %roject ,*anning begins wit$ re@uire-ents t$at define t$e software to be de"e*o,ed #$e ,roject ,*an is t$en de"e*o,ed to describe t$e tas?s t$at wi** *ead to co-,*etion #$e ,ur,ose of ,roject -onitoring and contro* is to ?ee, t$e tea- and -anage-ent u, to date on t$e ,roject4s ,rogress !f t$e ,roject de"iates fro- t$e ,*an< t$en t$e ,roject -anager can ta?e action to correct t$e ,rob*e- %roject -onitoring and contro* in"o*"es status -eetings to gat$er status fro- t$e tea- 3$en c$anges need to be -ade< c$ange contro* is used to ?ee, t$e ,roducts u, to date

"ssue
!n co-,uting< t$e ter- issue is a unit of wor? to acco-,*is$ an i-,ro"e-ent in a s0ste- >n issue cou*d be a bug< a re@uested feature< tas?< -issing docu-entation< and so fort$ #$e word HissueH is ,o,u*ar*0 -isused in *ieu of H,rob*e- H #$is usage is ,robab*0 re*ated Aor e1a-,*e< O,enOffice org used to ca** t$eir -odified "ersion of +ugYi**a !ssueYi**a >s of Se,te-ber 2010< t$e0 ca** t$eir s0ste- !ssue #rac?er %rob*e-s occur fro- ti-e to ti-e and fi1ing t$e- in a ti-e*0 fas$ion is essentia* to ac$ie"e correctness of a s0ste- and a"oid de*a0ed de*i"eries of ,roducts Severity levels !ssues are often categoriDed in ter-s of severity levels 8ifferent co-,anies $a"e different definitions of se"erities< but so-e of t$e -ost co--on ones are: Critica* ;ig$ #$e bug or issue affects a crucia* ,art of a s0ste-< and -ust be fi1ed in order for it to resu-e nor-a* o,eration /ediu#$e bug or issue affects a -inor ,art of a s0ste-< but $as so-e i-,act on its o,eration #$is se"erit0 *e"e* is assigned w$en a non-centra* re@uire-ent of a s0ste- is affected .ow

- 50 -

Course Notes: #$e bug or issue affects a -inor ,art of a s0ste-< and $as "er0 *itt*e i-,act on its o,eration #$is se"erit0 *e"e* is assigned w$en a non-centra* re@uire-ent of a s0ste- (and wit$ *ower i-,ortance) is affected Cos-etic #$e s0ste- wor?s correct*0< but t$e a,,earance does not -atc$ t$e e1,ected one Aor e1a-,*e: wrong co*ors< too -uc$ or too *itt*e s,acing between contents< incorrect font siDes< t0,os< etc #$is is t$e *owest se"erit0 issue !n -an0 software co-,anies< issues are often in"estigated b0 Eua*it0 >ssurance >na*0sts w$en t$e0 "erif0 a s0ste- for correctness< and t$en assigned to t$e de"e*o,er(s) t$at are res,onsib*e for reso*"ing t$e- #$e0 can a*so be assigned b0 s0ste- users during t$e =ser >cce,tance #esting (=>#) ,$ase !ssues are co--on*0 co--unicated using !ssue or 8efect #rac?ing S0ste-s !n so-e ot$er cases< e-ai*s or instant -essengers are used

%$iloso+$/
>s a subdisci,*ine of ,roject -anage-ent< so-e regard t$e -anage-ent of software de"e*o,-ent a?in to t$e -anage-ent of -anufacturing< w$ic$ can be ,erfor-ed b0 so-eone wit$ -anage-ent s?i**s< but no ,rogra--ing s?i**s Io$n C 5e0no*ds rebuts t$is "iew< and argues t$at software de"e*o,-ent is entire*0 design wor?< and co-,ares a -anager w$o cannot ,rogra- to t$e -anaging editor of a news,a,er w$o cannot write

Milestones ) deliverables
3it$in t$e fra-ewor? of ,roject -anage-ent< a milestone is an e"ent t$at recei"es s,ecia* attention !t is often fa*se*0 ,ut at t$e end of a stage to -ar? t$e co-,*etion of a wor? ,ac?age or ,$ase +ut -i*estones are rat$er to be ,ut before t$e end of a ,$ase so t$at correcti"e actions in case of ,rob*e-s can sti** be -et and t$e de*i"erab*e can be co-,*eted in ti-e !n addition to signa*ing t$e co-,*etion of a ?e0 de*i"erab*e< a -i*estone -a0 a*so signif0 an i-,ortant decision or t$e deri"ation of a critica* ,iece of infor-ation< w$ic$ out*ines or affects t$e future of a ,roject !n t$is sense< a -i*estone not on*0 signifies distance traveled (?e0 stages in a ,roject) but a*so indicates direction of travel since ?e0 decisions -ade at -i*estones -a0 a*ter t$e route t$roug$ t$e ,roject ,*an

;sing ,ilestones in sc$eduling


/i*estones can add significant "a*ue to ,roject sc$edu*ing 3$en co-bined wit$ a sc$edu*ing -et$odo*og0 suc$ as %rogra- E"a*uation and 5e"iew #ec$ni@ue (%E5#) or t$e Critica* %at$ /et$od (C%/)< -i*estones a**ow ,roject -anage-ent to -uc$ -ore accurate*0 deter-ine w$et$er or not t$e ,roject is on sc$edu*e +0 constraining t$e dates associated wit$ -i*estones< t$e critica* ,at$ can be deter-ined for -ajor sc$edu*e inter"a*s in addition to t$e entire ,roject S*ac?Ff*oat can a*so be ca*cu*ated on eac$ sc$edu*e inter"a* #$is seg-entation of t$e ,roject sc$edu*e into inter"a*s a**ows ear*ier indication of sc$edu*e ,rob*e-s and a better "iew into t$e acti"ities w$ose co-,*etion is critica* - 51 -

Object-Oriented Software Engineering (CS350) /i*estones are fre@uent*0 used to -onitor ,rogress< but t$ere are *i-itations to t$eir effecti"eness #$e0 usua**0 s$ow ,rogress on*0 on t$e critica* ,at$< and ignore non-critica* acti"ities !t is co--on for resources to be -o"ed fro- non-critica* acti"ities to critica* acti"ities to ensure t$at -i*estones are -et #$is gi"es t$e i-,ression t$at t$e ,roject is on sc$edu*e w$en actua**0 so-e acti"ities are being ignored Deliverable is a ter- used in ,roject -anage-ent to describe a tangib*e or intangib*e object ,roduced as a resu*t of t$e ,roject t$at is intended to be de*i"ered to a custo-er (eit$er interna* or e1terna*) > de*i"erab*e cou*d be a re,ort< a docu-ent< a ser"er u,grade or an0 ot$er bui*ding b*oc? of an o"era** ,roject > de*i"erab*e -a0 be co-,osed of -u*ti,*e s-a**er de*i"erab*es !t -a0 be eit$er an outco-e to be ac$ie"ed (as in H#$e cor,oration sa0s t$at -a?ing a ,rofit t$is 0ear is a de*i"erab*e H) or a ,roduct to be ,ro"ided (as in H#$e de*i"erab*e for t$e co-,*eted ,roject consists of a s,ecia*-,ur,ose e*ectronic de"ice and its contro**ing software H) > de*i"erab*e differs fro- a ,roject -i*estone in t$at a -i*estone is a -easure-ent of ,rogress toward an outco-e w$ereas t$e de*i"erab*e is t$e resu*t of t$e ,rocess Aor a t0,ica* ,roject< a -i*estone -ig$t be t$e co-,*etion of a ,roduct design w$i*e t$e de*i"erab*e -ig$t be t$e tec$nica* diagra- of t$e ,roduct !n tec$nica* ,rojects< de*i"erab*es can furt$er be c*assified as $ardware< software< or design docu-ents !n t$e =nited States 8e,art-ent of 8efense< a de*i"erab*e is an0 ite- de*i"ered to t$e go"ern-ent under a contract< w$et$er it is a ,$0sica* ,roduct or an ite- of data > Qnonse"erab*e de*i"erab*eR -eans a de*i"erab*e ite- t$at is a sing*e end ,roduct or underta?ing< entire in nature< t$at cannot be feasib*0 subdi"ided into discrete e*e-ents or ,$ases wit$out *osing its identit0

Scheduling
!n ,roject -anage-ent< a schedule consists of a *ist of a ,roject4s ter-ina* e*e-ents wit$ intended start and finis$ dates #er-ina* e*e-ents are t$e *owest e*e-ent in a sc$edu*e< w$ic$ is not furt$er subdi"ided #$ose ite-s are often esti-ated in ter-s of resource re@uire-ents< budget and duration< *in?ed b0 de,endencies and sc$edu*ed e"ents

O#er#iew
+efore a ,roject sc$edu*e can be created< t$e sc$edu*e -a?er s$ou*d $a"e a wor? brea?down structure (3+S)< an effort esti-ate for eac$ tas?< and a resource *ist wit$ a"ai*abi*it0 for eac$ resource !f t$ese co-,onents for t$e sc$edu*e are not a"ai*ab*e< t$e0 can be created wit$ a consensus-dri"en esti-ation -et$od *i?e 3ideband 8e*,$i #$e reason for t$is is t$at a sc$edu*e itse*f is an esti-ate: eac$ date in t$e sc$edu*e is esti-ated< and if t$ose dates do not $a"e t$e bu0-in of t$e ,eo,*e w$o are going to do t$e wor?< t$e sc$edu*e wi** be inaccurate !n -an0 industries< suc$ as engineering and construction< t$e de"e*o,-ent and -aintenance of t$e ,roject sc$edu*e is t$e res,onsibi*it0 of a fu** ti-e sc$edu*er or tea- of sc$edu*ers< de,ending on t$e siDe of t$e ,roject #$oug$ t$e tec$ni@ues of sc$edu*ing are we** de"e*o,ed< t$e0 are inconsistent*0 a,,*ied t$roug$out industr0 StandardiDation and ,ro-otion of sc$edu*ing best ,ractices are being - 52 -

Course Notes: ,ursued b0 t$e >ssociation for t$e >d"ance-ent of Cost Engineering (>>CE)< t$e %roject /anage-ent !nstitute (%/!) !t s$ou*d be noted t$at ,roject -anage-ent is not *i-ited to industr0< t$e a"erage ,erson can use it to organiDe t$eir own *ife So-e e1a-,*es are: ;o-eowner reno"ation ,roject See,ing trac? of a** t$e fa-i*0 acti"ities Coac$ing a tea%*anning a "acation %*anning a wedding

So-e ,roject -anage-ent software ,rogra-s ,ro"ide te-,*ates< *ists< and e1a-,*e sc$edu*es to $e*, t$eir users get a$ead wit$ creating t$eir sc$edu*e !n order for a ,roject sc$edu*e to be $ea*t$0< t$e fo**owing criteria -ust be -et: #$e sc$edu*e -ust be constant*0 (wee?*0 wor?s best) u,dated #$e E>C (Esti-ation at Co-,*etion) "a*ue -ust be e@ua* to t$e base*ine "a*ue #$e re-aining effort -ust be a,,ro,riate*0 distributed a-ong tea- -e-bers (ta?ing "acations into consideration)

C%SE "ools
!omputer(aided soft%are engineering (!$&E) is t$e scientific a,,*ication of a set of too*s and -et$ods to a software s0ste- w$ic$ is -eant to resu*t in $ig$-@ua*it0< defect-free< and -aintainab*e software ,roducts !t a*so refers to -et$ods for t$e de"e*o,-ent of infor-ation s0ste-s toget$er wit$ auto-ated too*s t$at can be used in t$e software de"e*o,-ent ,rocess

9istor/
#$e !S8OS ,roject at t$e =ni"ersit0 of /ic$igan initiated a great dea* of interest in t$e w$o*e conce,t of using co-,uter s0ste-s to $e*, ana*0sts in t$e "er0 difficu*t ,rocess of ana*0sing re@uire-ents and de"e*o,ing s0ste-s Se"era* ,a,ers b0 8anie* #eic$roew fired a w$o*e generation of ent$usiasts wit$ t$e ,otentia* of auto-ated s0ste-s de"e*o,-ent ;is %S.F%S> too* was a C>SE too* a*t$oug$ it ,redated t$e ter- ;is insig$ts into t$e ,ower of -eta--eta--ode*s was ins,iring< ,articu*ar*0 to a for-er student< 8r ;asan Sa0ani< current*0 %rofessor< %rogra- 8irector at =ni"ersit0 of /ar0*and =ni"ersit0 Co**ege >not$er -ajor t$read e-erged as a *ogica* e1tension to t$e 8+/S director0 +0 e1tending t$e range of -eta-data $e*d< t$e attributes of an a,,*ication cou*d be $e*d wit$in a dictionar0 and used at runti-e #$is Hacti"e dictionar0H beca-e t$e ,recursor to t$e -ore -odern H-ode* dri"en e1ecutionH (/8E) ca,abi*it0 ;owe"er< t$e acti"e dictionar0 did not ,ro"ide a gra,$ica* re,resentation of an0 of t$e -etadata !t was t$e *in?ing of t$e conce,t of a dictionar0 $o*ding ana*0sts4 -eta-data< as deri"ed fro- t$e use of an integrated set of tec$ni@ues< toget$er wit$ t$e gra,$ica* re,resentation of suc$ data t$at ga"e rise to t$e ear*ier "ersions of !-C>SE

- 53 -

Object-Oriented Software Engineering (CS350) #$e ter- C>SE was origina**0 coined b0 software co-,an0 Nastec Cor,oration of Sout$fie*d< /ic$igan in 1&)2 wit$ t$eir origina* integrated gra,$ics and te1t editor 7ra,$i#e1t< w$ic$ a*so was t$e first -icroco-,uter-based s0ste- to use $0,er*in?s to cross-reference te1t strings in docu-entsXan ear*0 forerunner of toda04s web ,age *in? 7ra,$i#e1t4s successor ,roduct< 8esign>id< was t$e first -icro,rocessor-based too* to *ogica**0 and se-antica**0 e"a*uate software and s0ste- design diagra-s and bui*d a data dictionar0 =nder t$e direction of >*bert A Case< Ir "ice ,resident for ,roduct -anage-ent and consu*ting< and :aug$n Aric?< director of ,roduct -anage-ent< t$e 8esign>id ,roduct suite was e1,anded to su,,ort ana*0sis of a wide range of structured ana*0sis and design -et$odo*ogies< notab*0 Ed Pourdon and #o8e/arco< C$ris 7ane 9 #ris$ Sarson< 3ard-/e**or (rea*-ti-e) S>FS8 and 3arnier-Orr (data dri"en) #$e ne1t entrant into t$e -ar?et was E1ce*erator fro- !nde1 #ec$no*og0 in Ca-bridge< /ass 3$i*e 8esign>id ran on Con"ergent #ec$no*ogies and *ater +urroug$s Ngen networ?ed -icroco-,uters< !nde1 *aunc$ed E1ce*erator on t$e !+/ %CF># ,*atfor- 3$i*e< at t$e ti-e of *aunc$< and for se"era* 0ears< t$e !+/ ,*atfor- did not su,,ort networ?ing or a centra*iDed database as did t$e Con"ergent #ec$no*ogies or +urroug$s -ac$ines< t$e a**ure of !+/ was strong< and E1ce*erator ca-e to ,ro-inence ;ot on t$e $ee*s of E1ce*erator were a ras$ of offerings fro- co-,anies suc$ as Snow*edgeware (Ia-es /artin< Aran #ar?enton and 8on >ddington)< #e1as !nstru-ent4s !EA and >ccenture4s AO=N8>#!ON too*set (/E#;O8F1< 8ES!7NF1< !NS#>..F1< AC%) C>SE too*s were at t$eir ,ea? in t$e ear*0 1&&0s >t t$e ti-e !+/ $ad ,ro,osed >8FC0c*e< w$ic$ was an a**iance of software "endors centered around !+/4s Software re,ositor0 using !+/ 8+2 in -ainfra-e and OSF2: The a!!lication develo!ment tools can be from several sources- from *BM0 from vendors0 and from the customers themselves% *BM has entered into relationshi!s with Bachman *nformation Systems0 *nde" Technology .or!oration0 and 1nowledgeware0 *nc% wherein selected !roducts from these vendors will be mar&eted through an *BM com!lementary mar&eting !rogram to !rovide offerings that will hel! to achieve com!lete life#cycle coverage J3W 3it$ t$e dec*ine of t$e -ainfra-e< >8FC0c*e and t$e +ig C>SE too*s died off< o,ening t$e -ar?et for t$e -ainstrea- C>SE too*s of toda0 Near*0 a** of t$e *eaders of t$e C>SE -ar?et of t$e ear*0 1&&0s ended u, being ,urc$ased b0 Co-,uter >ssociates< inc*uding !E3< !EA< >83< Ca0enne< and .ear-ont$ 9 +urc$ett /anage-ent S0ste-s (.+/S)

Co,+onents
1 2 3 ' 8iagra--atic #oo*s !nfor-ation 5e,ositor0 !nterface 7enerators /anage-ent #oo*s

Su++orting software
>*fonso Auggetta c*assified C>SE into 3 categories: 1 Tools su,,ort on*0 s,ecific tas?s in t$e software ,rocess - 5' -

Course Notes: 2 (or&benches su,,ort on*0 one or a few acti"ities 3 Environments su,,ort (a *arge ,art of) t$e software ,rocess 3or?benc$es and en"iron-ents are genera**0 bui*t as co**ections of too*s #oo*s can t$erefore be eit$er stand a*one ,roducts or co-,onents of wor?benc$es and en"iron-ents "ools C>SE too*s are a c*ass of software t$at auto-ate -an0 of t$e acti"ities in"o*"ed in "arious *ife c0c*e ,$ases Aor e1a-,*e< w$en estab*is$ing t$e functiona* re@uire-ents of a ,ro,osed a,,*ication< ,rotot0,ing too*s can be used to de"e*o, gra,$ic -ode*s of a,,*ication screens to assist end users to "isua*iDe $ow an a,,*ication wi** *oo? after de"e*o,-ent Subse@uent*0< s0ste- designers can use auto-ated design too*s to transfor- t$e ,rotot0,ed functiona* re@uire-ents into detai*ed design docu-ents %rogra--ers can t$en use auto-ated code generators to con"ert t$e design docu-ents into code >uto-ated too*s can be used co**ecti"e*0< as -entioned< or indi"idua**0 Aor e1a-,*e< ,rotot0,ing too*s cou*d be used to define a,,*ication re@uire-ents t$at get ,assed to design tec$nicians w$o con"ert t$e re@uire-ents into detai*ed designs in a traditiona* -anner using f*owc$arts and narrati"e docu-ents< wit$out t$e assistance of auto-ated design software #0,es of too*s are: +usiness ,rocess engineering too*s %rocess -ode*ing and -anage-ent too*s %roject ,*anning too*s 5is? ana*0sis too*s %roject -anage-ent too*s 5e@uire-ent tracing too*s /etrics -anage-ent too*s 8ocu-entation too*s S0ste- software too*s Eua*it0 assurance too*s 8atabase -anage-ent too*s Software configuration -anage-ent too*s >na*0sis and design too*s %5OFS!/ too*s !nterface design and de"e*o,-ent too*s ,rotot0,ing too*s ,rogra--ing too*s 3eb de"e*o,-ent too*s !ntegration and testing too*s Static ana*0sis too*s 80na-ic ana*0sis too*s #est -anage-ent too*s C*ientFSer"er testing too*s 5e-engineering too*s - 55 -

Object-Oriented Software Engineering (CS350) E1isting C>SE too*s can be c*assified a*ong ' different di-ensions: 1 2 3 ' .ife-c0c*e su,,ort !ntegration di-ension Construction di-ension Snow*edge-based C>SE di-ension

.et us ta?e t$e -eaning of t$ese di-ensions a*ong wit$ t$eir e1a-,*es one b0 one: .ife-C0c*e +ased C>SE #oo*s #$is di-ension c*assifies C>SE #oo*s on t$e basis of t$e acti"ities t$e0 su,,ort in t$e infor-ation s0ste-s *ife c0c*e #$e0 can be c*assified as =,,er or .ower C>SE too*s =,,er C>SE #oo*s su,,ort strategic ,*anning and construction of conce,t-*e"e* ,roducts and ignore t$e design as,ect #$e0 su,,ort traditiona* diagra--atic *anguages suc$ as E5 diagra-s< 8ata f*ow diagra-< Structure c$arts< 8ecision #rees< 8ecision tab*es< etc .ower C>SE #oo*s concentrate on t$e bac? end acti"ities of t$e software *ife c0c*e< suc$ as ,$0sica* design< debugging< construction< testing< co-,onent integration< -aintenance< reengineering and re"erse engineering !ntegration di-ension #$ree -ain C>SE !ntegration di-ensions $a"e been ,ro,osed: 1 C>SE Ara-ewor? 2 !C>SE #oo*s 3 !ntegrated %roject Su,,ort En"iron-ent(!%SE) .or/benches 3or?benc$es integrate se"era* C>SE too*s into one a,,*ication to su,,ort s,ecific software-,rocess acti"ities ;ence t$e0 ac$ie"e: a $o-ogeneous and consistent interface (,resentation integration) eas0 in"ocation of too*s and too* c$ains (contro* integration) C>SE wor?benc$es can be furt$er c*assified into fo**owing ) c*asses: 1 2 3 ' 5 ( 2 ) +usiness ,*anning and -ode*ing >na*0sis and design =ser-interface de"e*o,-ent %rogra--ing :erification and "a*idation /aintenance and re"erse engineering Configuration -anage-ent %roject -anage-ent

- 5( -

Course Notes: Environments >n en"iron-ent is a co**ection of C>SE too*s and wor?benc$es t$at su,,orts t$e software ,rocess C>SE en"iron-ents are c*assified based on t$e focusFbasis of integration 1 2 3 ' 5 #oo*?its .anguage-centered !ntegrated Aourt$ generation %rocess-centered

ool7its #oo*?its are *oose*0 integrated co**ections of ,roducts easi*0 e1tended b0 aggregating different too*s and wor?benc$es #0,ica**0< t$e su,,ort ,ro"ided b0 a too*?it is *i-ited to ,rogra--ing< configuration -anage-ent and ,roject -anage-ent >nd t$e too*?it itse*f is en"iron-ents e1tended fro- basic sets of o,erating s0ste- too*s< for e1a-,*e< t$e =ni1 %rogra--er4s 3or? +enc$ and t$e :/S :>T Set !n addition< too*?its4 *oose integration re@uires user to acti"ate too*s b0 e1,*icit in"ocation or si-,*e contro* -ec$anis-s #$e resu*ting fi*es are unstructured and cou*d be in different for-at< t$erefore t$e access of fi*e fro- different too*s -a0 re@uire e1,*icit fi*e for-at con"ersion ;owe"er< since t$e on*0 constraint for adding a new co-,onent is t$e for-ats of t$e fi*es< too*?its can be easi*0 and incre-enta**0 e1tended -anguage-centered #$e en"iron-ent itse*f is written in t$e ,rogra--ing *anguage for w$ic$ it was de"e*o,ed< t$us enab*ing users to reuse< custo-iDe and e1tend t$e en"iron-ent !ntegration of code in different *anguages is a -ajor issue for *anguage-centered en"iron-ents .ac? of ,rocess and data integration is a*so a ,rob*e- #$e strengt$s of t$ese en"iron-ents inc*ude good *e"e* of ,resentation and contro* integration !nter*is,< S-a**ta*?< 5ationa*< and SEE are e1a-,*es of *anguage-centered en"iron-ents "ntegrated #$ese en"iron-ents ac$ie"e ,resentation integration b0 ,ro"iding unifor-< consistent< and co$erent too* and wor?benc$ interfaces 8ata integration is ac$ie"ed t$roug$ t$e re!ository conce,t: t$e0 $a"e a s,ecia*iDed database -anaging a** infor-ation ,roduced and accessed in t$e en"iron-ent E1a-,*es of integrated en"iron-ent are t$e !C. C>8ES s0ste-< !+/ >8FC0c*e and 8EC Co$esion Fourt$-generation Aourt$-generation en"iron-ents were t$e first integrated en"iron-ents #$e0 are sets of too*s and wor?benc$es su,,orting t$e de"e*o,-ent of a s,ecific c*ass of ,rogra-: e*ectronic data ,rocessing and business-oriented a,,*ications !n genera*< t$e0 inc*ude ,rogra--ing too*s< si-,*e configuration -anage-ent too*s< docu-ent $and*ing faci*ities and< so-eti-es< a code generator to ,roduce code in *ower *e"e* *anguages !nfor-i1 '7.< and Aocus fa** into t$is categor0

- 52 -

Object-Oriented Software Engineering (CS350) %rocess-centered En"iron-ents in t$is categor0 focus on ,rocess integration wit$ ot$er integration di-ensions as starting ,oints > ,rocess-centered en"iron-ent o,erates b0 inter,reting a ,rocess -ode* created b0 s,ecia*iDed too*s #$e0 usua**0 consist of too*s $and*ing two functions: %rocess--ode* e1ecution %rocess--ode* ,roduction E1a-,*es are East< Enter,rise !!< %rocess 3ise< %rocess 3ea"er< and >rcadia

<++lications
>** as,ects of t$e software de"e*o,-ent *ife c0c*e can be su,,orted b0 software too*s< and so t$e use of too*s fro- across t$e s,ectru- can< arguab*0< be described as C>SEG fro- ,roject -anage-ent software t$roug$ too*s for business and functiona* ana*0sis< s0ste- design< code storage< co-,i*ers< trans*ation too*s< test software< and so on ;owe"er< too*s t$at are concerned wit$ ana*0sis and design< and wit$ using design infor-ation to create ,arts (or a**) of t$e software ,roduct< are -ost fre@uent*0 t$oug$t of as C>SE too*s C>SE a,,*ied< for instance< to a database software ,roduct< -ig$t nor-a**0 in"o*"e: /ode*ing business F rea*-wor*d ,rocesses and data f*ow 8e"e*o,-ent of data -ode*s in t$e for- of entit0-re*ations$i, diagra-s 8e"e*o,-ent of ,rocess and function descri,tions

3is7s and associated controls


Co--on C>SE ris?s and associated contro*s inc*ude: *nade2uate standardi$ation: .in?ing C>SE too*s fro- different "endors (design too* froCo-,an0 T< ,rogra--ing too* fro- Co-,an0 P) -a0 be difficu*t if t$e ,roducts do not use standardiDed code structures and data c*assifications Ai*e for-ats can be con"erted< but usua**0 not econo-ica**0 Contro*s inc*ude using too*s fro- t$e sa-e "endor< or using too*s based on standard ,rotoco*s and insisting on de-onstrated co-,atibi*it0 >dditiona**0< if organiDations obtain too*s for on*0 a ,ortion of t$e de"e*o,-ent ,rocess< t$e0 s$ou*d consider ac@uiring t$efro- a "endor t$at $as a fu** *ine of ,roducts to ensure future co-,atibi*it0 if t$e0 add -ore too*s 3nrealistic e"!ectations: OrganiDations often i-,*e-ent C>SE tec$no*ogies to reduce de"e*o,-ent costs !-,*e-enting C>SE strategies usua**0 in"o*"es $ig$ start-u, costs 7enera**0< -anage-ent -ust be wi**ing to acce,t a *ong-ter- ,a0bac? ,eriod Contro*s inc*ude re@uiring senior -anagers to define t$eir ,ur,ose and strategies for i-,*e-enting C>SE tec$no*ogies Slow im!lementation: !-,*e-enting C>SE tec$no*ogies can in"o*"e a significant c$ange frotraditiona* de"e*o,-ent en"iron-ents #0,ica**0< organiDations s$ou*d not use C>SE too*s t$e first ti-e on critica* ,rojects or ,rojects wit$ s$ort dead*ines because of t$e *engt$0 training ,rocess >dditiona**0< organiDations s$ou*d consider using t$e too*s on s-a**er< *ess co-,*e1 - 5) -

Course Notes: ,rojects and gradua**0 i-,*e-enting t$e too*s to a**ow -ore training ti-e (ea& re!ository controls: Aai*ure to ade@uate*0 contro* access to C>SE re,ositories -a0 resu*t in securit0 breac$es or da-age to t$e wor? docu-ents< s0ste- designs< or code -odu*es stored in t$e re,ositor0 Contro*s inc*ude ,rotecting t$e re,ositories wit$ a,,ro,riate access< "ersion< and bac?u, contro*s

+is/ management
Ris* management is t$e identification< assess-ent< and ,rioritiDation of ris?s (defined in !SO 31000 as the effect of uncertainty on ob4ectives< w$et$er ,ositi"e or negati"e) fo**owed b0 coordinated and econo-ica* a,,*ication of resources to -ini-iDe< -onitor< and contro* t$e ,robabi*it0 andFor i-,act of unfortunate e"ents or to -a1i-iDe t$e rea*iDation of o,,ortunities 5is?s can co-e fro- uncertaint0 in financia* -ar?ets< ,roject fai*ures (at an0 ,$ase in design< de"e*o,-ent< ,roduction< or sustain-ent *ife-c0c*es)< *ega* *iabi*ities< credit ris?< accidents< natura* causes and disasters as we** as de*iberate attac? fro- an ad"ersar0< or e"ents of uncertain or un,redictab*e root-cause Se"era* ris? -anage-ent standards $a"e been de"e*o,ed inc*uding t$e %roject /anage-ent !nstitute< t$e Nationa* !nstitute of Standards and #ec$no*og0< actuaria* societies< and !SO standards /et$ods< definitions and goa*s "ar0 wide*0 according to w$et$er t$e ris? -anage-ent -et$od is in t$e conte1t of ,roject -anage-ent< securit0< engineering< industria* ,rocesses< financia* ,ortfo*ios< actuaria* assess-ents< or ,ub*ic $ea*t$ and safet0 #$e strategies to -anage ris? t0,ica**0 inc*ude transferring t$e ris? to anot$er ,art0< a"oiding t$e ris?< reducing t$e negati"e effect or ,robabi*it0 of t$e ris?< or e"en acce,ting so-e or a** of t$e ,otentia* or actua* conse@uences of a ,articu*ar ris? Certain as,ects of -an0 of t$e ris? -anage-ent standards $a"e co-e under criticis- for $a"ing no -easurab*e i-,ro"e-ent on ris?< w$et$er t$e confidence in esti-ates and decisions see- to increase

"ntroduction
#$e "ocabu*ar0 of ris? -anage-ent is defined in !SO 7uide 23< H5is? -anage-ent :ocabu*ar0 H !n idea* ris? -anage-ent< a ,rioritiDation ,rocess is fo**owed w$ereb0 t$e ris?s wit$ t$e greatest *oss (or i-,act) and t$e greatest ,robabi*it0 of occurring are $and*ed first< and ris?s wit$ *ower ,robabi*it0 of occurrence and *ower *oss are $and*ed in descending order !n ,ractice t$e ,rocess of assessing o"era** ris? can be difficu*t< and ba*ancing resources used to -itigate between ris?s wit$ a $ig$ ,robabi*it0 of occurrence but *ower *oss "ersus a ris? wit$ $ig$ *oss but *ower ,robabi*it0 of occurrence can often be -is$and*ed !ntangib*e ris? -anage-ent identifies a new t0,e of a ris? t$at $as a 100N ,robabi*it0 of occurring but is ignored b0 t$e organiDation due to a *ac? of identification abi*it0 Aor e1a-,*e< w$en deficient ?now*edge is a,,*ied to a situation< a ?now*edge ris? -ateria*iDes 5e*ations$i, ris? a,,ears w$en ineffecti"e co**aboration occurs %rocess-engage-ent ris? -a0 be an issue w$en ineffecti"e o,erationa* ,rocedures are a,,*ied #$ese ris?s direct*0 reduce t$e ,roducti"it0 of ?now*edge wor?ers< decrease cost effecti"eness< ,rofitabi*it0< ser"ice< @ua*it0< re,utation< brand "a*ue< and earnings @ua*it0 !ntangib*e ris? -anage-ent a**ows ris? -anage-ent to create - 5& -

Object-Oriented Software Engineering (CS350) i--ediate "a*ue fro- t$e identification and reduction of ris?s t$at reduce ,roducti"it0 5is? -anage-ent a*so faces difficu*ties in a**ocating resources #$is is t$e idea of o,,ortunit0 cost 5esources s,ent on ris? -anage-ent cou*d $a"e been s,ent on -ore ,rofitab*e acti"ities >gain< idea* ris? -anage-ent -ini-iDes s,ending (or -an,ower or ot$er resources) and a*so -ini-iDes t$e negati"e effects of ris?s Method Aor t$e -ost ,art< t$ese -et$ods consist of t$e fo**owing e*e-ents< ,erfor-ed< -ore or *ess< in t$e fo**owing order 1 identif0< c$aracteriDe< and assess t$reats 2 assess t$e "u*nerabi*it0 of critica* assets to s,ecific t$reats 3 deter-ine t$e ris? (i e t$e e1,ected *i?e*i$ood and conse@uences of s,ecific t0,es of attac?s on s,ecific assets) ' identif0 wa0s to reduce t$ose ris?s 5 ,rioritiDe ris? reduction -easures based on a strateg0 Principles of ris/ management #$e !nternationa* OrganiDation for StandardiDation (!SO) identifies t$e fo**owing ,rinci,*es of ris? -anage-ent: 5is? -anage-ent s$ou*d: create "a*ue C resources e1,ended to -itigate ris? s$ou*d be *ess t$an t$e conse@uence of inaction< or (as in "a*ue engineering)< t$e gain s$ou*d e1ceed t$e ,ain be an integra* ,art of organiDationa* ,rocesses be ,art of decision -a?ing e1,*icit*0 address uncertaint0 and assu-,tions be s0ste-atic and structured be based on t$e best a"ai*ab*e infor-ation be tai*orab*e ta?e $u-an factors into account be trans,arent and inc*usi"e be d0na-ic< iterati"e and res,onsi"e to c$ange be ca,ab*e of continua* i-,ro"e-ent and en$ance-ent be continua**0 or ,eriodica**0 re-assessed

%rocess
>ccording to t$e standard !SO 31000 H5is? -anage-ent C %rinci,*es and guide*ines on i-,*e-entation<H t$e ,rocess of ris? -anage-ent consists of se"era* ste,s as fo**ows: Establishing the conte$t - (0 -

Course Notes: #$is in"o*"es: 1 identification of ris? in a se*ected do-ain of interest 2 ,*anning t$e re-ainder of t$e ,rocess 3 -a,,ing out t$e fo**owing: t$e socia* sco,e of ris? -anage-ent t$e identit0 and objecti"es of sta?e$o*ders t$e basis u,on w$ic$ ris?s wi** be e"a*uated< constraints ' defining a fra-ewor? for t$e acti"it0 and an agenda for identification 5 de"e*o,ing an ana*0sis of ris?s in"o*"ed in t$e ,rocess ( -itigation or so*ution of ris?s using a"ai*ab*e tec$no*ogica*< $u-an and organiDationa* resources #dentification >fter estab*is$ing t$e conte1t< t$e ne1t ste, in t$e ,rocess of -anaging ris? is to identif0 ,otentia* ris?s 5is?s are about e"ents t$at< w$en triggered< cause ,rob*e-s ;ence< ris? identification can start wit$ t$e source of ,rob*e-s< or wit$ t$e ,rob*e- itse*f Source ana*0sis - 5is? sources -a0 be interna* or e1terna* to t$e s0ste- t$at is t$e target of ris? -anage-ent E1a-,*es of ris? sources are: sta?e$o*ders of a ,roject< e-,*o0ees of a co-,an0 or t$e weat$er o"er an air,ort %rob*e- ana*0sis - 5is?s are re*ated to identified t$reats Aor e1a-,*e: t$e t$reat of *osing -one0< t$e t$reat of abuse of confidentia* infor-ation or t$e t$reat of accidents and casua*ties #$e t$reats -a0 e1ist wit$ "arious entities< -ost i-,ortant wit$ s$are$o*ders< custo-ers and *egis*ati"e bodies suc$ as t$e go"ern-ent 3$en eit$er source or ,rob*e- is ?nown< t$e e"ents t$at a source -a0 trigger or t$e e"ents t$at can *ead to a ,rob*e- can be in"estigated Aor e1a-,*e: sta?e$o*ders wit$drawing during a ,roject -a0 endanger funding of t$e ,rojectG confidentia* infor-ation -a0 be sto*en b0 e-,*o0ees e"en wit$in a c*osed networ?G *ig$tning stri?ing an aircraft during ta?eoff -a0 -a?e a** ,eo,*e on board i--ediate casua*ties #$e c$osen -et$od of identif0ing ris?s -a0 de,end on cu*ture< industr0 ,ractice and co-,*iance #$e identification -et$ods are for-ed b0 te-,*ates or t$e de"e*o,-ent of te-,*ates for identif0ing source< ,rob*e- or e"ent Co--on ris? identification -et$ods are: Objecti"es-based ris? identification - OrganiDations and ,roject tea-s $a"e objecti"es >n0 e"ent t$at -a0 endanger ac$ie"ing an objecti"e ,art*0 or co-,*ete*0 is identified as ris? Scenario-based ris? identification - !n scenario ana*0sis different scenarios are created #$e scenarios -a0 be t$e a*ternati"e wa0s to ac$ie"e an objecti"e< or an ana*0sis of t$e interaction of forces in< for e1a-,*e< a -ar?et or batt*e >n0 e"ent t$at triggers an undesired scenario a*ternati"e is identified as ris? C see Autures Studies for -et$odo*og0 used b0 Auturists #a1ono-0-based ris? identification - #$e ta1ono-0 in ta1ono-0-based ris? identification is a brea?down of ,ossib*e ris? sources +ased on t$e ta1ono-0 and ?now*edge of best ,ractices< a - (1 -

Object-Oriented Software Engineering (CS350) @uestionnaire is co-,i*ed #$e answers to t$e @uestions re"ea* ris?s Co--on-ris? c$ec?ing - !n se"era* industries< *ists wit$ ?nown ris?s are a"ai*ab*e Eac$ ris? in t$e *ist can be c$ec?ed for a,,*ication to a ,articu*ar situation 5is? c$arting - #$is -et$od co-bines t$e abo"e a,,roac$es b0 *isting resources at ris?< t$reats to t$ose resources< -odif0ing factors w$ic$ -a0 increase or decrease t$e ris? and conse@uences it is wis$ed to a"oid Creating a -atri1 under t$ese $eadings enab*es a "ariet0 of a,,roac$es One can begin wit$ resources and consider t$e t$reats t$e0 are e1,osed to and t$e conse@uences of eac$ >*ternati"e*0 one can start wit$ t$e t$reats and e1a-ine w$ic$ resources t$e0 wou*d affect< or one can begin wit$ t$e conse@uences and deter-ine w$ic$ co-bination of t$reats and resources wou*d be in"o*"ed to bring t$e- about %ssessment Once ris?s $a"e been identified< t$e0 -ust t$en be assessed as to t$eir ,otentia* se"erit0 of i-,act (genera**0 a negati"e i-,act< suc$ as da-age or *oss) and to t$e ,robabi*it0 of occurrence #$ese @uantities can be eit$er si-,*e to -easure< in t$e case of t$e "a*ue of a *ost bui*ding< or i-,ossib*e to ?now for sure in t$e case of t$e ,robabi*it0 of an un*i?e*0 e"ent occurring #$erefore< in t$e assess-ent ,rocess it is critica* to -a?e t$e best educated decisions in order to ,ro,er*0 ,rioritiDe t$e i-,*e-entation of t$e ris? -anage-ent ,*an E"en a s$ort-ter- ,ositi"e i-,ro"e-ent can $a"e *ong-ter- negati"e i-,acts #a?e t$e Hturn,i?eH e1a-,*e > $ig$wa0 is widened to a**ow -ore traffic /ore traffic ca,acit0 *eads to greater de"e*o,-ent in t$e areas surrounding t$e i-,ro"ed traffic ca,acit0 O"er ti-e< traffic t$ereb0 increases to fi** a"ai*ab*e ca,acit0 #urn,i?es t$ereb0 need to be e1,anded in a see-ing*0 end*ess c0c*es #$ere are -an0 ot$er engineering e1a-,*es w$ere e1,anded ca,acit0 (to do an0 function) is soon fi**ed b0 increased de-and Since e1,ansion co-es at a cost< t$e resu*ting growt$ cou*d beco-e unsustainab*e wit$out forecasting and -anage-ent #$e funda-enta* difficu*t0 in ris? assess-ent is deter-ining t$e rate of occurrence since statistica* infor-ation is not a"ai*ab*e on a** ?inds of ,ast incidents Aurt$er-ore< e"a*uating t$e se"erit0 of t$e conse@uences (i-,act) is often @uite difficu*t for intangib*e assets >sset "a*uation is anot$er @uestion t$at needs to be addressed #$us< best educated o,inions and a"ai*ab*e statistics are t$e ,ri-ar0 sources of infor-ation Ne"ert$e*ess< ris? assess-ent s$ou*d ,roduce suc$ infor-ation for t$e -anage-ent of t$e organiDation t$at t$e ,ri-ar0 ris?s are eas0 to understand and t$at t$e ris? -anage-ent decisions -a0 be ,rioritiDed #$us< t$ere $a"e been se"era* t$eories and atte-,ts to @uantif0 ris?s Nu-erous different ris? for-u*ae e1ist< but ,er$a,s t$e -ost wide*0 acce,ted for-u*a for ris? @uantification is: 5ate (or ,robabi*it0) of occurrence -u*ti,*ied b0 t$e i-,act of t$e e"ent e@ua*s ris? -agnitude Co,+osite 3is7 "nde0 #$e abo"e for-u*a can a*so be re-written in ter-s of a Co-,osite 5is? !nde1< as fo**ows: !omposite Ris* Index - Impact of Ris* event x robability of .ccurrence

- (2 -

Course Notes: #$e i-,act of t$e ris? e"ent is co--on*0 assessed on a sca*e of 1 to 5< w$ere 1 and 5 re,resent t$e -ini-u- and -a1i-u- ,ossib*e i-,act of an occurrence of a ris? (usua**0 in ter-s of financia* *osses) ;owe"er< t$e 1 to 5 sca*e can be arbitrar0 and need not be on a *inear sca*e #$e ,robabi*it0 of occurrence is *i?ewise co--on*0 assessed on a sca*e fro- 1 to 5< w$ere 1 re,resents a "er0 *ow ,robabi*it0 of t$e ris? e"ent actua**0 occurring w$i*e 5 re,resents a "er0 $ig$ ,robabi*it0 of occurrence #$is a1is -a0 be e1,ressed in eit$er -at$e-atica* ter-s (e"ent occurs once a 0ear< once in ten 0ears< once in 100 0ears etc ) or -a0 be e1,ressed in H,*ain eng*is$H C e"ent $as occurred $ere "er0 oftenG e"ent $as been ?nown to occur $ereG e"ent $as been ?nown to occur in t$e industr0 etc ) >gain< t$e 1 to 5 sca*e can be arbitrar0 or non-*inear de,ending on decisions b0 subject--atter e1,erts #$e Co-,osite !nde1 t$us can ta?e "a*ues ranging (t0,ica**0) fro- 1 t$roug$ 25< and t$is range is usua**0 arbitrari*0 di"ided into t$ree sub-ranges #$e o"era** ris? assess-ent is t$en .ow< /ediu- or ;ig$< de,ending on t$e sub-range containing t$e ca*cu*ated "a*ue of t$e Co-,osite !nde1 Aor instance< t$e t$ree sub-ranges cou*d be defined as 1 to )< & to 1( and 12 to 25 Note t$at t$e ,robabi*it0 of ris? occurrence is difficu*t to esti-ate< since t$e ,ast data on fre@uencies are not readi*0 a"ai*ab*e< as -entioned abo"e >fter a**< ,robabi*it0 does not i-,*0 certaint0 .i?ewise< t$e i-,act of t$e ris? is not eas0 to esti-ate since it is often difficu*t to esti-ate t$e ,otentia* *oss in t$e e"ent of ris? occurrence Aurt$er< bot$ t$e abo"e factors can c$ange in -agnitude de,ending on t$e ade@uac0 of ris? a"oidance and ,re"ention -easures ta?en and due to c$anges in t$e e1terna* business en"iron-ent ;ence it is abso*ute*0 necessar0 to ,eriodica**0 re-assess ris?s and intensif0Fre*a1 -itigation -easures< or as necessar0 C$anges in ,rocedures< tec$no*og0< sc$edu*es< budgets< -ar?et conditions< ,o*itica* en"iron-ent< or ot$er factors t0,ica**0 re@uire re-assess-ent of ris?s 3is7 O+tions 5is? -itigation -easures are usua**0 for-u*ated according to one or -ore of t$e fo**owing -ajor ris? o,tions< w$ic$ are: 1 8esign a new business ,rocess wit$ ade@uate bui*t-in ris? contro* and contain-ent -easures fro- t$e start 2 %eriodica**0 re-assess ris?s t$at are acce,ted in ongoing ,rocesses as a nor-a* feature of business o,erations and -odif0 -itigation -easures 3 #ransfer ris?s to an e1terna* agenc0 (e g an insurance co-,an0) ' >"oid ris?s a*toget$er (e g b0 c*osing down a ,articu*ar $ig$-ris? business area) .ater researc$ $as s$own t$at t$e financia* benefits of ris? -anage-ent are *ess de,endent on t$e for-u*a used but are -ore de,endent on t$e fre@uenc0 and $ow ris? assess-ent is ,erfor-ed !n business it is i-,erati"e to be ab*e to ,resent t$e findings of ris? assess-ents in financia*< -ar?et< or sc$edu*e ter-s 5obert Courtne0 Ir (!+/< 1&20) ,ro,osed a for-u*a for ,resenting ris?s in financia* ter-s #$e Courtne0 for-u*a was acce,ted as t$e officia* ris? ana*0sis -et$od for t$e =S go"ern-enta* agencies #$e for-u*a ,ro,oses ca*cu*ation of >.E (annua*iDed *oss e1,ectanc0) and co-,ares t$e e1,ected *oss "a*ue to t$e securit0 contro* i-,*e-entation costs (cost-benefit ana*0sis)

- (3 -

Object-Oriented Software Engineering (CS350) %otential ris7 treat,ents Once ris?s $a"e been identified and assessed< a** tec$ni@ues to -anage t$e ris? fa** into one or -ore of t$ese four -ajor categories: >"oidance (e*i-inate< wit$draw fro- or not beco-e in"o*"ed) 5eduction (o,ti-iDe C -itigate) S$aring (transfer C outsource or insure) 5etention (acce,t and budget)

!dea* use of t$ese strategies -a0 not be ,ossib*e So-e of t$e- -a0 in"o*"e trade-offs t$at are not acce,tab*e to t$e organiDation or ,erson -a?ing t$e ris? -anage-ent decisions >not$er source< frot$e =S 8e,art-ent of 8efense (see *in?)< 8efense >c@uisition =ni"ersit0< ca**s t$ese categories >C>#< for >"oid< Contro*< >cce,t< or #ransfer #$is use of t$e >C># acron0- is re-iniscent of anot$er >C># (for >c@uisition Categor0) used in =S 8efense industr0 ,rocure-ents< in w$ic$ 5is? /anage-ent figures ,ro-inent*0 in decision -a?ing and ,*anning 3is7 a#oidance #$is inc*udes not ,erfor-ing an acti"it0 t$at cou*d carr0 ris? >n e1a-,*e wou*d be not bu0ing a ,ro,ert0 or business in order to not ta?e on t$e *ega* *iabi*it0 t$at co-es wit$ it >not$er wou*d be not f*0ing in order not to ta?e t$e ris? t$at t$e air,*ane were to be $ijac?ed >"oidance -a0 see- t$e answer to a** ris?s< but a"oiding ris?s a*so -eans *osing out on t$e ,otentia* gain t$at acce,ting (retaining) t$e ris? -a0 $a"e a**owed Not entering a business to a"oid t$e ris? of *oss a*so a"oids t$e ,ossibi*it0 of earning ,rofits 9a=ard %re#ention ;aDard ,re"ention refers to t$e ,re"ention of ris?s in an e-ergenc0 #$e first and -ost effecti"e stage of $aDard ,re"ention is t$e e*i-ination of $aDards !f t$is ta?es too *ong< is too cost*0< or is ot$erwise i-,ractica*< t$e second stage is -itigation 3is7 reduction 5is? reduction or Ho,ti-iDationH in"o*"es reducing t$e se"erit0 of t$e *oss or t$e *i?e*i$ood of t$e *oss fro- occurring Aor e1a-,*e< s,rin?*ers are designed to ,ut out a fire to reduce t$e ris? of *oss b0 fire #$is -et$od -a0 cause a greater *oss b0 water da-age and t$erefore -a0 not be suitab*e ;a*on fire su,,ression s0ste-s -a0 -itigate t$at ris?< but t$e cost -a0 be ,ro$ibiti"e as a strateg0 >c?now*edging t$at ris?s can be ,ositi"e or negati"e< o,ti-iDing ris?s -eans finding a ba*ance between negati"e ris? and t$e benefit of t$e o,eration or acti"it0G and between ris? reduction and effort a,,*ied +0 an offs$ore dri**ing contractor effecti"e*0 a,,*0ing ;SE /anage-ent in its organiDation< it can o,ti-iDe ris? to ac$ie"e *e"e*s of residua* ris? t$at are to*erab*e /odern software de"e*o,-ent -et$odo*ogies reduce ris? b0 de"e*o,ing and de*i"ering software incre-enta**0 Ear*0 -et$odo*ogies suffered fro- t$e fact t$at t$e0 on*0 de*i"ered software in t$e fina* ,$ase of de"e*o,-entG an0 ,rob*e-s encountered in ear*ier ,$ases -eant cost*0 rewor? and often jeo,ardiDed t$e w$o*e ,roject +0 de"e*o,ing in iterations< software ,rojects can *i-it effort wasted to - (' -

Course Notes: a sing*e iteration Outsourcing cou*d be an e1a-,*e of ris? reduction if t$e outsourcer can de-onstrate $ig$er ca,abi*it0 at -anaging or reducing ris?s Aor e1a-,*e< a co-,an0 -a0 outsource on*0 its software de"e*o,-ent< t$e -anufacturing of $ard goods< or custo-er su,,ort needs to anot$er co-,an0< w$i*e $and*ing t$e business -anage-ent itse*f #$is wa0< t$e co-,an0 can concentrate -ore on business de"e*o,-ent wit$out $a"ing to worr0 as -uc$ about t$e -anufacturing ,rocess< -anaging t$e de"e*o,-ent tea-< or finding a ,$0sica* *ocation for a ca** center 3is7 s$aring +rief*0 defined as Hs$aring wit$ anot$er ,art0 t$e burden of *oss or t$e benefit of gain< fro- a ris?< and t$e -easures to reduce a ris? H #$e ter- of 4ris? transfer4 is often used in ,*ace of ris? s$aring in t$e -ista?en be*ief t$at 0ou can transfer a ris? to a t$ird ,art0 t$roug$ insurance or outsourcing !n ,ractice if t$e insurance co-,an0 or contractor go ban?ru,t or end u, in court< t$e origina* ris? is *i?e*0 to sti** re"ert to t$e first ,art0 >s suc$ in t$e ter-ino*og0 of ,ractitioners and sc$o*ars a*i?e< t$e ,urc$ase of an insurance contract is often described as a Htransfer of ris? H ;owe"er< tec$nica**0 s,ea?ing< t$e bu0er of t$e contract genera**0 retains *ega* res,onsibi*it0 for t$e *osses HtransferredH< -eaning t$at insurance -a0 be described -ore accurate*0 as a ,ost-e"ent co-,ensator0 -ec$anis- Aor e1a-,*e< a ,ersona* injuries insurance ,o*ic0 does not transfer t$e ris? of a car accident to t$e insurance co-,an0 #$e ris? sti** *ies wit$ t$e ,o*ic0 $o*der na-e*0 t$e ,erson w$o $as been in t$e accident #$e insurance ,o*ic0 si-,*0 ,ro"ides t$at if an accident (t$e e"ent) occurs in"o*"ing t$e ,o*ic0 $o*der t$en so-e co-,ensation -a0 be ,a0ab*e to t$e ,o*ic0 $o*der t$at is co--ensurate to t$e sufferingFda-age So-e wa0s of -anaging ris? fa** into -u*ti,*e categories 5is? retention ,oo*s are tec$nica**0 retaining t$e ris? for t$e grou,< but s,reading it o"er t$e w$o*e grou, in"o*"es transfer a-ong indi"idua* -e-bers of t$e grou, #$is is different fro- traditiona* insurance< in t$at no ,re-iu- is e1c$anged between -e-bers of t$e grou, u, front< but instead *osses are assessed to a** -e-bers of t$e grou, 3is7 retention !n"o*"es acce,ting t$e *oss< or benefit of gain< fro- a ris? w$en it occurs #rue se*f insurance fa**s in t$is categor0 5is? retention is a "iab*e strateg0 for s-a** ris?s w$ere t$e cost of insuring against t$e ris? wou*d be greater o"er ti-e t$an t$e tota* *osses sustained >** ris?s t$at are not a"oided or transferred are retained b0 defau*t #$is inc*udes ris?s t$at are so *arge or catastro,$ic t$at t$e0 eit$er cannot be insured against or t$e ,re-iu-s wou*d be infeasib*e 3ar is an e1a-,*e since -ost ,ro,ert0 and ris?s are not insured against war< so t$e *oss attributed b0 war is retained b0 t$e insured >*so an0 a-ounts of ,otentia* *oss (ris?) o"er t$e a-ount insured is retained ris? #$is -a0 a*so be acce,tab*e if t$e c$ance of a "er0 *arge *oss is s-a** or if t$e cost to insure for greater co"erage a-ounts is so great it wou*d $inder t$e goa*s of t$e organiDation too -uc$

Create a ris7 ,anage,ent +lan


Se*ect a,,ro,riate contro*s or counter-easures to -easure eac$ ris? 5is? -itigation needs to be a,,ro"ed b0 t$e a,,ro,riate *e"e* of -anage-ent Aor instance< a ris? concerning t$e i-age of t$e - (5 -

Object-Oriented Software Engineering (CS350) organiDation s$ou*d $a"e to, -anage-ent decision be$ind it w$ereas !# -anage-ent wou*d $a"e t$e aut$orit0 to decide on co-,uter "irus ris?s #$e ris? -anage-ent ,*an s$ou*d ,ro,ose a,,*icab*e and effecti"e securit0 contro*s for -anaging t$e ris?s Aor e1a-,*e< an obser"ed $ig$ ris? of co-,uter "iruses cou*d be -itigated b0 ac@uiring and i-,*e-enting anti"irus software > good ris? -anage-ent ,*an s$ou*d contain a sc$edu*e for contro* i-,*e-entation and res,onsib*e ,ersons for t$ose actions >ccording to !SOF!EC 22001< t$e stage i--ediate*0 after co-,*etion of t$e ris? assess-ent ,$ase consists of ,re,aring a 5is? #reat-ent %*an< w$ic$ s$ou*d docu-ent t$e decisions about $ow eac$ of t$e identified ris?s s$ou*d be $and*ed /itigation of ris?s often -eans se*ection of securit0 contro*s< w$ic$ s$ou*d be docu-ented in a State-ent of >,,*icabi*it0< w$ic$ identifies w$ic$ ,articu*ar contro* objecti"es and contro*s fro- t$e standard $a"e been se*ected< and w$0 #mplementation !-,*e-entation fo**ows a** of t$e ,*anned -et$ods for -itigating t$e effect of t$e ris?s %urc$ase insurance ,o*icies for t$e ris?s t$at $a"e been decided to be transferred to an insurer< a"oid a** ris?s t$at can be a"oided wit$out sacrificing t$e entit04s goa*s< reduce ot$ers< and retain t$e rest +eview and evaluation of the plan !nitia* ris? -anage-ent ,*ans wi** ne"er be ,erfect %ractice< e1,erience< and actua* *oss resu*ts wi** necessitate c$anges in t$e ,*an and contribute infor-ation to a**ow ,ossib*e different decisions to be -ade in dea*ing wit$ t$e ris?s being faced 5is? ana*0sis resu*ts and -anage-ent ,*ans s$ou*d be u,dated ,eriodica**0 #$ere are two ,ri-ar0 reasons for t$is: 1 to e"a*uate w$et$er t$e ,re"ious*0 se*ected securit0 contro*s are sti** a,,*icab*e and effecti"e 2 to e"a*uate t$e ,ossib*e ris? *e"e* c$anges in t$e business en"iron-ent Aor e1a-,*e< infor-ation ris?s are a good e1a-,*e of ra,id*0 c$anging business en"iron-ent

-i,itations
%rioritiDing t$e ris& management !rocesses too $ig$*0 cou*d ?ee, an organiDation fro- e"er co-,*eting a ,roject or e"en getting started #$is is es,ecia**0 true if ot$er wor? is sus,ended unti* t$e ris? -anage-ent ,rocess is considered co-,*ete !t is a*so i-,ortant to ?ee, in -ind t$e distinction between ris? and uncertaint0 5is? can be -easured b0 i-,acts 1 ,robabi*it0 !f ris?s are i-,ro,er*0 assessed and ,rioritiDed< ti-e can be wasted in dea*ing wit$ ris? of *osses t$at are not *i?e*0 to occur S,ending too -uc$ ti-e assessing and -anaging un*i?e*0 ris?s can di"ert resources t$at cou*d be used -ore ,rofitab*0 =n*i?e*0 e"ents do occur but if t$e ris? is un*i?e*0 enoug$ to occur it -a0 be better to si-,*0 retain t$e ris? and dea* wit$ t$e resu*t if t$e *oss does in fact occur Eua*itati"e ris? assess-ent is subjecti"e and *ac?s consistenc0 #$e ,ri-ar0 justification for a for-a* ris? assess-ent ,rocess is *ega* and bureaucratic

- (( -

Course Notes:

<reas of ris7 ,anage,ent


>s a,,*ied to cor,orate finance< ris& management is t$e tec$ni@ue for -easuring< -onitoring and contro**ing t$e financia* or o,erationa* ris? on a fir-4s ba*ance s$eet #$e +ase* !! fra-ewor? brea?s ris?s into -ar?et ris? (,rice ris?)< credit ris? and o,erationa* ris? and a*so s,ecifies -et$ods for ca*cu*ating ca,ita* re@uire-ents for eac$ of t$ese co-,onents Enterprise ris/ management !n enter,rise ris? -anage-ent< a ris? is defined as a ,ossib*e e"ent or circu-stance t$at can $a"e negati"e inf*uences on t$e enter,rise in @uestion !ts i-,act can be on t$e "er0 e1istence< t$e resources ($u-an and ca,ita*)< t$e ,roducts and ser"ices< or t$e custo-ers of t$e enter,rise< as we** as e1terna* i-,acts on societ0< -ar?ets< or t$e en"iron-ent !n a financia* institution< enter,rise ris? -anage-ent is nor-a**0 t$oug$t of as t$e co-bination of credit ris?< interest rate ris? or asset *iabi*it0 -anage-ent< -ar?et ris?< and o,erationa* ris? !n t$e -ore genera* case< e"er0 ,robab*e ris? can $a"e a ,re-for-u*ated ,*an to dea* wit$ its ,ossib*e conse@uences (to ensure contingency if t$e ris? beco-es a liability) Aro- t$e infor-ation abo"e and t$e a"erage cost ,er e-,*o0ee o"er ti-e< or cost accrua* ratio< a ,roject -anager can esti-ate: t$e cost associated wit$ t$e ris? if it arises< esti-ated b0 -u*ti,*0ing e-,*o0ee costs ,er unit ti-e b0 t$e esti-ated ti-e *ost (cost im!act< . w$ere . 5 cost accrual ratio 6 S) t$e ,robab*e increase in ti-e associated wit$ a ris? (schedule variance due to ris&< +s w$ere 5s [ % \ S): Sorting on t$is "a*ue ,uts t$e $ig$est ris?s to t$e sc$edu*e first #$is is intended to cause t$e greatest ris?s to t$e ,roject to be atte-,ted first so t$at ris? is -ini-iDed as @uic?*0 as ,ossib*e #$is is s*ig$t*0 -is*eading as schedule variances wit$ a *arge % and s-a** S and "ice "ersa are not e@ui"a*ent (#$e ris? of t$e 5/S Titanic sin?ing "s t$e ,assengers4 -ea*s being ser"ed at s*ig$t*0 t$e wrong ti-e) t$e ,robab*e increase in cost associated wit$ a ris? (cost variance due to ris&< +c w$ere 5c [ %\C [ %\C>5\S [ %\S\C>5) sorting on t$is "a*ue ,uts t$e $ig$est ris?s to t$e budget first see concerns about schedule variance as t$is is a function of it< as i**ustrated in t$e e@uation abo"e 5is? in a ,roject or ,rocess can be due eit$er to S,ecia* Cause :ariation or Co--on Cause :ariation and re@uires a,,ro,riate treat-ent #$at is to re-iterate t$e concern about e1tre-a* cases not being e@ui"a*ent in t$e *ist i--ediate*0 abo"e +is/ management activities as applied to pro'ect management !n ,roject -anage-ent< ris? -anage-ent inc*udes t$e fo**owing acti"ities:

- (2 -

Object-Oriented Software Engineering (CS350) %*anning $ow ris? wi** be -anaged in t$e ,articu*ar ,roject %*ans s$ou*d inc*ude ris? -anage-ent tas?s< res,onsibi*ities< acti"ities and budget >ssigning a ris? officer C a tea- -e-ber ot$er t$an a ,roject -anager w$o is res,onsib*e for foreseeing ,otentia* ,roject ,rob*e-s #0,ica* c$aracteristic of ris? officer is a $ea*t$0 s?e,ticis /aintaining *i"e ,roject ris? database Eac$ ris? s$ou*d $a"e t$e fo**owing attributes: o,ening date< tit*e< s$ort descri,tion< ,robabi*it0 and i-,ortance O,tiona**0 a ris? -a0 $a"e an assigned ,erson res,onsib*e for its reso*ution and a date b0 w$ic$ t$e ris? -ust be reso*"ed Creating anon0-ous ris? re,orting c$anne* Eac$ tea- -e-ber s$ou*d $a"e t$e ,ossibi*it0 to re,ort ris?s t$at $eFs$e foresees in t$e ,roject %re,aring -itigation ,*ans for ris?s t$at are c$osen to be -itigated #$e ,ur,ose of t$e -itigation ,*an is to describe $ow t$is ,articu*ar ris? wi** be $and*ed C w$at< w$en< b0 w$oand $ow wi** it be done to a"oid it or -ini-iDe conse@uences if it beco-es a *iabi*it0 Su--ariDing ,*anned and faced ris?s< effecti"eness of -itigation acti"ities< and effort s,ent for t$e ris? -anage-ent +is/ management for megapro'ects /ega,rojects (so-eti-es a*so ca**ed H-ajor ,rogra-sH) are e1tre-e*0 *arge-sca*e in"est-ent ,rojects< t0,ica**0 costing -ore t$an =S]1 bi**ion ,er ,roject /ega,rojects inc*ude bridges< tunne*s< $ig$wa0s< rai*wa0s< air,orts< sea,orts< ,ower ,*ants< da-s< wastewater ,rojects< coasta* f*ood ,rotection sc$e-es< oi* and natura* gas e1traction ,rojects< ,ub*ic bui*dings< infor-ation tec$no*og0 s0ste-s< aeros,ace ,rojects< and defence s0ste-s /ega,rojects $a"e been s$own to be ,articu*ar*0 ris?0 in ter-s of finance< safet0< and socia* and en"iron-enta* i-,acts 5is? -anage-ent is t$erefore ,articu*ar*0 ,ertinent for -ega,rojects and s,ecia* -et$ods and s,ecia* education $a"e been de"e*o,ed for suc$ ris? -anage-ent +is/ management regarding natural disasters !t is i-,ortant to assess ris? in regard to natura* disasters *i?e f*oods< eart$@ua?es< and so on Outco-es of natura* disaster ris? assess-ent are "a*uab*e w$en considering future re,air costs< business interru,tion *osses and ot$er downti-e< effects on t$e en"iron-ent< insurance costs< and t$e ,ro,osed costs of reducing t$e ris? +is/ management of information technology !nfor-ation tec$no*og0 is increasing*0 ,er"asi"e in -odern *ife in e"er0 sector !# ris? is a ris? re*ated to infor-ation tec$no*og0 #$is is a re*ati"e*0 new ter- due to an increasing awareness t$at infor-ation securit0 is si-,*0 one facet of a -u*titude of ris?s t$at are re*e"ant to !# and t$e rea* wor*d ,rocesses it su,,orts > nu-ber of -et$odo*ogies $a"e been de"e*o,ed to dea* wit$ t$is ?ind of ris? !S>C>4s 5is? !# fra-ewor? ties !# ris? to Enter,rise ris? -anage-ent

- () -

Course Notes: +is/ management techni,ues in petroleum and natural gas Aor t$e offs$ore oi* and gas industr0< o,erationa* ris? -anage-ent is regu*ated b0 t$e safet0 case regi-e in -an0 countries ;aDard identification and ris? assess-ent too*s and tec$ni@ues are described in t$e internationa* standard !SO 1222(:2000< and organisations suc$ as t$e !>8C (!nternationa* >ssociation of 8ri**ing Contractors) ,ub*is$ guide*ines for ;SE Case de"e*o,-ent w$ic$ are based on t$e !SO standard Aurt$er< diagra--atic re,resentations of $aDardous e"ents are often e1,ected b0 go"ern-enta* regu*ators as ,art of ris? -anage-ent in safet0 case sub-issionsG t$ese are ?nown as bo%(tie diagra-s #$e tec$ni@ue is a*so used b0 organisations and regu*ators in -ining< a"iation< $ea*t$< defence< industria* and finance

%ositi#e 3is7 .anage,ent


%ositi"e 5is? /anage-ent is an a,,roac$ t$at recogniDes t$e i-,ortance of t$e $u-an factor and of indi"idua* differences in ,ro,ensit0 for ris? ta?ing !t draws fro- t$e wor? of a nu-ber of acade-ics and ,rofessiona*s w$o $a"e e1,ressed concerns about scientific rigor of t$e wider ris? -anage-ent debate< or w$o $a"e -ade a contribution e-,$asiDing t$e $u-an di-ension of ris? Airst*0< it recogniDes t$at an0 object or situation can be rendered $aDardous b0 t$e in"o*"e-ent of so-eone wit$ an ina,,ro,riate dis,osition towards ris?G w$et$er too ris? ta?ing or too ris? a"erse Second*0< it recogniDes t$at ris? is an ine"itab*e and e"er ,resent e*e-ent t$roug$out *ife: froconce,tion t$roug$ to t$e ,oint at t$e end of *ife w$en we fina**0 *ose our ,ersona* batt*e wit$ *ife t$reatening ris? #$ird*0< it recogniDes t$at e"er0 indi"idua* $as a ,articu*ar orientation towards ris?G w$i*e at one e1tre-e ,eo,*e -a0 b0 nature be ti-id< an1ious and fearfu*< ot$ers wi** be ad"enturous< i-,u*si"e and a*-ost ob*i"ious to danger #$ese differences are e"ident in t$e wa0 we dri"e our cars< in our diets< in our re*ations$i,s< in our careers Aina**0< %ositi"e 5is? /anage-ent recogniDes t$at ris? ta?ing is essentia* to a** enter,rise< creati"it0< $erois-< education< scientific ad"ance C in fact to an0 acti"it0 and a** t$e initiati"es t$at $a"e contributed to our e"o*utionar0 success and ci"i*iDation !t is wort$ noting $ow -an0 enjo0ab*e acti"ities in"o*"e fear and wi**ing*0 e-brace ris? ta?ing 3it$in t$e entire 5is? /anage-ent *iterature (and t$is section of 3i?i,edia) 0ou wi** find *itt*e or no reference to t$e $u-an ,art of t$e ris? e@uation ot$er t$an w$at -ig$t be i-,*ied b0 t$e ter4co-,*iant4 #$is i**ustrates t$e narrow focus t$at is a $a** -ar? of -uc$ current ris? -anage-ent ,ractice #$is situation arises fro- t$e basic ,re-ises of traditiona* ris? -anage-ent and t$e ,ractices associated wit$ $ea*t$ and safet0 wit$in t$e wor?ing en"iron-ent #$ere is a basic *ogic to t$e idea t$at an0 accident -ust ref*ect so-e ?ind of o"ersig$t or situationa* ,redis,osition t$at< if identified< can be rectified +ut< *arge*0 due to an a*-ost institutiona*iDed neg*ect of t$e $u-an factor< t$is situationa**0 focused ,aradig- $as grown tendri*s t$at reac$ into e"er0 corner of -odern *ife and into situations w$ere t$e unintended negati"e conse@uences t$reaten to outweig$ t$e benefits %ositi"e 5is? /anage-ent "iews bot$ ris? ta?ing and ris? a"ersion as co-,*e-entar0 and of e@ua* "a*ue and i-,ortance wit$in t$e a,,ro,riate conte1t >s suc$< it is seen as co-,*e-entar0 to t$e traditiona* ris? -anage-ent ,aradig- !t introduces a -uc$ needed ba*ance to ris? -anage-ent ,ractices and ,uts greater onus on -anage-ent s?i**s and decision -a?ing !t is t$e d0na-ic a,,roac$ - (& -

Object-Oriented Software Engineering (CS350) of t$e footba** -anager w$o a,,reciates t$e offensi"e and defensi"e ta*ents wit$in t$e a"ai*ab*e ,oo* of ,*a0ers E"er0 organiDation $as ro*es better suited to ris? ta?ers and ro*es better suited to t$e ris? a"erse #$e tas? of -anage-ent is to ensure t$at t$e rig$t ,eo,*e are ,*aced in eac$ job #$e gra"e0ard of for-er greats is *ittered wit$ e1a-,*es w$ere t$e ba*ance of ris? went serious*0 awr0G t$e EN5ON and 5+S stories $a"e beco-e iconic references in t$e ,ant$eon of cor,orate go"ernance and cor,orate -orta*it0 East-an Soda? -ig$t be a no-inee for t$e o,,osite ,o*e C t$e cor,orate*0 ris? a"erse %ositi"e 5is? /anage-ent re*ies on t$e abi*it0 to identif0 indi"idua* differences in ,ro,ensit0 for ris? ta?ing #$e science in t$is area $as been de"e*o,ing ra,id*0 o"er t$e ,ast decade wit$in t$e do-ain of ,ersona*it0 assess-ent Once an area of a*-ost triba* a**egiance to different sc$oo*s of t$oug$t< toda0 t$ere is wide s,read consensus about t$e structure of ,ersona*it0 assess-ent and its status wit$in t$e fra-ewor? of t$e cross disci,*inar0 ,rogress being -ade in our understanding of ;u-an Nature #$e Ai"e Aactor /ode* (AA/) of ,ersona*it0 $as been s$own to $a"e re*e"ance across -an0 different cu*tures< to re-ain consistent o"er adu*t wor?ing *ife and to be significant*0 $eritab*e 3it$in t$is fra-ewor? t$ere are -an0 strands w$ic$ $a"e a c*ear re*ations$i, to ris? to*erance and ris? ta?ing Aor e1a-,*e< E0senc? (1&23) re,orts t$at ,ersona*it0 inf*uences w$et$er we focus on w$at -ig$t go wrong or on ,otentia* benefitsG Nic$o*son et a* (2005) re,ort t$at $ig$er e1tro"ersion is re*ated to greater ris? to*eranceG /cCrae and Costa (1&&2) *in? ,ersona*it0 to to*erance of uncertaint0< inno"ation and wi**ingness to t$in? outside t$e bo1G Sowert< 1&&2) *in?s ,ersona*it0 to ad"enturousness< i-agination< t$e searc$ for new e1,eriences and acti"e*0 see?ing out ris? +ui*ding fro- t$ese foundations of we** "a*idated assess-ent ,ractices< -ore s,ecia*iDed assess-ents $a"e been de"e*o,ed< inc*uding assess-ent of 5is? #0,e

3is7 ,anage,ent and business continuit/


5is? -anage-ent is si-,*0 a ,ractice of s0ste-atica**0 se*ecting cost effecti"e a,,roac$es for -ini-iDing t$e effect of t$reat rea*iDation to t$e organiDation >** ris?s can ne"er be fu**0 a"oided or -itigated si-,*0 because of financia* and ,ractica* *i-itations #$erefore a** organiDations $a"e to acce,t so-e *e"e* of residua* ris?s 3$ereas ris? -anage-ent tends to be ,ree-,ti"e< business continuit0 ,*anning (+C%) was in"ented to dea* wit$ t$e conse@uences of rea*iDed residua* ris?s #$e necessit0 to $a"e +C% in ,*ace arises because e"en "er0 un*i?e*0 e"ents wi** occur if gi"en enoug$ ti-e 5is? -anage-ent and +C% are often -ista?en*0 seen as ri"a*s or o"er*a,,ing ,ractices !n fact t$ese ,rocesses are so tig$t*0 tied toget$er t$at suc$ se,aration see-s artificia* Aor e1a-,*e< t$e ris? -anage-ent ,rocess creates i-,ortant in,uts for t$e +C% (assets< i-,act assess-ents< cost esti-ates etc ) 5is? -anage-ent a*so ,ro,oses a,,*icab*e contro*s for t$e obser"ed ris?s #$erefore< ris? -anage-ent co"ers se"era* areas t$at are "ita* for t$e +C% ,rocess ;owe"er< t$e +C% ,rocess goes be0ond ris? -anage-ent4s ,ree-,ti"e a,,roac$ and assu-es t$at t$e disaster %ill $a,,en at so-e ,oint

3is7 co,,unication
5is? co--unication is a co-,*e1 cross-disci,*inar0 acade-ic fie*d %rob*e-s for ris? co--unicators in"o*"e $ow to reac$ t$e intended audience< to -a?e t$e ris? co-,re$ensib*e and re*atab*e to ot$er ris?s< $ow to ,a0 a,,ro,riate res,ect to t$e audience4s "a*ues re*ated to t$e ris?< $ow to ,redict t$e audience4s res,onse to t$e co--unication< etc > -ain goa* of ris? co--unication is to i-,ro"e - 20 -

Course Notes: co**ecti"e and indi"idua* decision -a?ing 5is? co--unication is so-ew$at re*ated to crisis co--unication Seven cardinal rules for the practice of ris/ communication (as first e1,ressed b0 t$e = S En"iron-enta* %rotection >genc0 and se"era* of t$e fie*d4s founders) >cce,t and in"o*"e t$e ,ub*icFot$er consu-ers as *egiti-ate ,artners (e g sta?e$o*ders) %*an carefu**0 and e"a*uate 0our efforts wit$ a focus on 0our strengt$s< wea?nesses< o,,ortunities< and t$reats (S3O#) .isten to t$e sta?e$o*ders s,ecific concerns +e $onest< fran?< and o,en Coordinate and co**aborate wit$ ot$er credib*e sources /eet t$e needs of t$e -edia S,ea? c*ear*0 and wit$ co-,assion

3!

- 21 -

Object-Oriented Software Engineering (CS350)

'! Software re>uire,ents


*unctional vs0 non-functional
!n software engineering< a functional re#uirement defines a function of a software s0ste- or its co-,onent > function is described as a set of in,uts< t$e be$a"ior< and out,uts (see a*so software) Aunctiona* re@uire-ents -a0 be ca*cu*ations< tec$nica* detai*s< data -ani,u*ation and ,rocessing and ot$er s,ecific functiona*it0 t$at define what a s0ste- is su,,osed to acco-,*is$ +e$a"iora* re@uire-ents describing a** t$e cases w$ere t$e s0ste- uses t$e functiona* re@uire-ents are ca,tured in use cases Aunctiona* re@uire-ents are su,,orted b0 non-functiona* re@uire-ents (a*so ?nown as 2uality re2uirements)< w$ic$ i-,ose constraints on t$e design or i-,*e-entation (suc$ as ,erfor-ance re@uire-ents< securit0< or re*iabi*it0) 7enera**0< functiona* re@uire-ents are e1,ressed in t$e forHs0ste- -ust do ^re@uire-ent_H< w$i*e non-functiona* re@uire-ents are Hs0ste- s$a** be ^re@uire-ent_H #$e ,*an for i-,*e-enting functional re@uire-ents is detai*ed in t$e s0ste- design #$e ,*an for i-,*e-enting non#functional re@uire-ents is detai*ed in t$e s0ste- architecture >s defined in re@uire-ents engineering< functiona* re@uire-ents s,ecif0 ,articu*ar resu*ts of a s0ste#$is s$ou*d be contrasted wit$ non-functiona* re@uire-ents w$ic$ s,ecif0 o"era** c$aracteristics suc$ as cost and re*iabi*it0 Aunctiona* re@uire-ents dri"e t$e a!!lication architecture of a s0ste-< w$i*e non-functiona* re@uire-ents dri"e t$e technical architecture of a s0ste!n so-e cases a re@uire-ents ana*0st generates use cases after gat$ering and "a*idating a set of functiona* re@uire-ents #$e $ierarc$0 of functiona* re@uire-ents is: userFsta?e$o*der re@uest -_ feature -_ use case -_ business ru*e Eac$ use case i**ustrates be$a"iora* scenarios t$roug$ one or -ore functiona* re@uire-ents Often< t$oug$< an ana*0st wi** begin b0 e*iciting a set of use cases< fro- w$ic$ t$e ana*0st can deri"e t$e functiona* re@uire-ents t$at -ust be i-,*e-ented to a**ow a user to ,erforeac$ use case

Origin of ter,
> *ogistics conference ,a,er in 1&53 di"ided Hre@uire-ents for data ,rocessing e@ui,-ent into two grou,s: functiona* re@uire-ents and ,erfor-ance re@uire-ents H #$e conce,t of functiona* and nonfunctiona* re@uire-ents was first ,resented in 1&)2 at t$e Co-,uter Software and >,,*ication conference (CO/%S>C) b0 5 # Pe$ Aunctiona* re@uire-ents are a*so addressed in detai* b0 7 C 5o-an in >,ri* 1&)5 edition of .om!uter tit*ed H> ta1ono-0 of current issues in re@uire-ents engineeringH in w$ic$ $e addresses attributes of a functiona* re@uire-ent

%rocess
> t0,ica* functiona* re@uire-ent wi** contain a uni@ue na-e and nu-ber< a brief su--ar0< and a rationa*e #$is infor-ation is used to $e*, t$e reader understand w$0 t$e re@uire-ent is needed< and to trac? t$e re@uire-ent t$roug$ t$e de"e*o,-ent of t$e s0ste#$e cru1 of t$e re@uire-ent is t$e descri,tion of t$e re@uired be$a"ior< w$ic$ -ust be c*ear and - 22 -

Course Notes: readab*e #$e described be$a"ior -a0 co-e fro- organiDationa* or business ru*es< or it -a0 be disco"ered t$roug$ e*icitation sessions wit$ users< sta?e$o*ders< and ot$er e1,erts wit$in t$e organiDation /an0 re@uire-ents -a0 be unco"ered during t$e use case de"e*o,-ent 3$en t$is $a,,ens< t$e re@uire-ents ana*0st -a0 create a ,*ace$o*der re@uire-ent wit$ a na-e and su--ar0< and researc$ t$e detai*s *ater< to be fi**ed in w$en t$e0 are better ?nown !n s0ste-s engineering and re@uire-ents engineering< a non(functional re#uirement is a re@uire-ent t$at s,ecifies criteria t$at can be used to judge t$e o,eration of a s0ste-< rat$er t$an s,ecific be$a"iors #$is s$ou*d be contrasted wit$ functiona* re@uire-ents t$at define s,ecific be$a"ior or functions #$e ,*an for i-,*e-enting functional re@uire-ents is detai*ed in t$e s0ste- design #$e ,*an for i-,*e-enting non#functional re@uire-ents is detai*ed in t$e s0ste- architecture !n genera*< functiona* re@uire-ents define w$at a s0ste- is su,,osed to do w$ereas non-functiona* re@uire-ents define $ow a s0ste- is su,,osed to be Aunctiona* re@uire-ents are usua**0 in t$e for- of Hs0ste- s$a** do ^re@uire-ent_H< w$i*e non-functiona* re@uire-ents are Hs0ste- s$a** be ^re@uire-ent_H Non-functiona* re@uire-ents are often ca**ed #ualities of a s0ste- Ot$er ter-s for non-functiona* re@uire-ents are HconstraintsH< H@ua*it0 attributesH< H@ua*it0 goa*sH< H@ua*it0 of ser"ice re@uire-entsH and Hnon-be$a"iora* re@uire-entsH !nfor-a**0 t$ese are so-eti-es ca**ed t$e Hi*itiesH< fro- attributes *i?e stabi*it0 and ,ortabi*it0 Eua*ities< t$at is non-functiona* re@uire-ents< can be di"ided into two -ain categories: 1 E1ecution @ua*ities< suc$ as securit0 and usabi*it0< w$ic$ are obser"ab*e at run ti-e 2 E"o*ution @ua*ities< suc$ as testabi*it0< -aintainabi*it0< e1tensibi*it0 and sca*abi*it0< w$ic$ are e-bodied in t$e static structure of t$e software s0ste-

Domains
> domain is a fie*d of stud0 t$at defines a set of co--on re@uire-ents< ter-ino*og0< and functiona*it0 for an0 software ,rogra- constructed to so*"e a ,rob*e- in t$e area of co-,uter ,rogra--ing< ?nown as do-ain engineering Domain engineering< a*so ca**ed product line engineering< is t$e entire ,rocess of reusing do-ain ?now*edge in t$e ,roduction of new software s0ste-s !t is a ?e0 conce,t in s0ste-atic software reuse > ?e0 idea in s0ste-atic software reuse is t$e a,,*ication do-ain< a software area t$at contains s0ste-s s$aring co--ona*ities /ost organiDations wor? in on*0 a few do-ains #$e0 re,eated*0 bui*d si-i*ar s0ste-s wit$in a gi"en do-ain wit$ "ariations to -eet different custo-er needs 5at$er t$an bui*ding eac$ new s0ste- "ariant fro- scratc$< significant sa"ings -a0 be ac$ie"ed b0 reusing ,ortions of ,re"ious s0ste-s in t$e do-ain to bui*d new ones #$e ,rocess of identif0ing do-ains< bounding t$e-< and disco"ering co--ona*ities and "ariabi*ities a-ong t$e s0ste-s in t$e do-ain is ca**ed do-ain ana*0sis #$is infor-ation is ca,tured in -ode*s t$at are used in t$e do-ain i-,*e-entation ,$ase to create artifacts suc$ as reusab*e co-,onents< a do-ain-s,ecific *anguage< or a,,*ication generators t$at can be used to bui*d new s0ste-s in t$e do-ain

%ur+ose
- 23 -

Object-Oriented Software Engineering (CS350) 8o-ain engineering is designed to i-,ro"e t$e @ua*it0 of de"e*o,ed software ,roducts t$roug$ reuse of software artifacts 8o-ain engineering s$ows t$at -ost de"e*o,ed software s0ste-s are not new s0ste-s but rat$er "ariants of ot$er s0ste-s wit$in t$e sa-e fie*d >s a resu*t< t$roug$ t$e use of do-ain engineering< businesses can -a1i-iDe ,rofits and reduce ti-e-to--ar?et b0 using t$e conce,ts and i-,*e-entations fro- ,rior software s0ste-s and a,,*0ing t$e- to t$e target s0ste- #$e reduction in cost is e"ident e"en during t$e i-,*e-entation ,$ase One stud0 s$owed t$at t$e use of do-ain-s,ecific *anguages a**owed code siDe< in bot$ nu-ber of -et$ods and nu-ber of s0-bo*s< to be reduced b0 o"er 50N< and t$e tota* nu-ber of *ines of code to be reduced b0 near*0 25N 8o-ain engineering focuses on ca,turing ?now*edge gat$ered during t$e software engineering ,rocess +0 de"e*o,ing reusab*e artifacts< co-,onents can be reused in new software s0ste-s at *ow cost and $ig$ @ua*it0 +ecause t$is a,,*ies to a** ,$ases of t$e software de"e*o,-ent c0c*e< do-ain engineering a*so focuses on t$e t$ree ,ri-ar0 ,$ases: ana*0sis< design< and i-,*e-entation< ,ara**e*ing a,,*ication engineering #$is ,roduces not on*0 a set of software i-,*e-entation co-,onents re*e"ant to t$e do-ain< but a*so reusab*e and configurab*e re@uire-ents and designs

%$ases of do,ain engineering

8o-ain engineering as co-,ared to a,,*ication engineering #$e out,uts of eac$ ,$ase of do-ain engineering feed into bot$ subse@uent ,$ases of do-ain engineering as we** as corres,onding ,$ases in a,,*ication engineering 8o-ain engineering< *i?e a,,*ication engineering< consists of t$ree ,ri-ar0 ,$ases: ana*0sis< design< and i-,*e-entation ;owe"er< w$ere software engineering focuses on a single s0ste-< do-ain engineering focuses on a family of s0ste-s > good do-ain -ode* ser"es as a reference to reso*"e a-biguities *ater in t$e ,rocess< a re,ositor0 of ?now*edge about t$e do-ain c$aracteristics and definition< and a s,ecification to de"e*o,ers of ,roducts w$ic$ are ,art of t$e do-ain Domain analysis 8o-ain ana*0sis is used to define t$e do-ain< co**ect infor-ation about t$e do-ain< and ,roduce a do-ain -ode* #$roug$ t$e use of feature -ode*s (initia**0 concei"ed as ,art of t$e feature-oriented - 2' -

Course Notes: do-ain ana*0sis -et$od)< do-ain ana*0sis ai-s to identif0 t$e co--on ,oints in a do-ain and t$e "ar0ing ,oints in t$e do-ain #$roug$ t$e use of do-ain ana*0sis< t$e de"e*o,-ent of configurable re@uire-ents and arc$itectures< rat$er t$an static configurations w$ic$ wou*d be ,roduced b0 a traditiona* a,,*ication engineering a,,roac$< is ,ossib*e 8o-ain ana*0sis is significant*0 different fro- re@uire-ents engineering< and as suc$< traditiona* a,,roac$es to deri"ing re@uire-ents are ineffecti"e for de"e*o,-ent of configurab*e re@uire-ents as wou*d be ,resent in a do-ain -ode* #o effecti"e*0 a,,*0 do-ain engineering< reuse -ust be considered in t$e ear*ier ,$ases of t$e software de"e*o,-ent *ife c0c*e #$roug$ t$e use of se*ection of features fro- de"e*o,ed feature -ode*s< consideration of reuse of tec$no*og0 is ,erfor-ed "er0 ear*0 and can be ade@uate*0 a,,*ied t$roug$out t$e de"e*o,-ent ,rocess 8o-ain ana*0sis is deri"ed ,ri-ari*0 fro- artifacts ,roduced ,ast e1,erience in t$e do-ain E1isting s0ste-s< t$eir artifacts (suc$ as design docu-ents< re@uire-ent docu-ents and user -anua*s)< standards< and custo-ers are a** ,otentia* sources of do-ain ana*0sis in,ut ;owe"er< un*i?e re@uire-ents engineering< do-ain ana*0sis does not so*e*0 consist of co**ection and for-a*iDation of infor-ationG a creati"e co-,onent e1ists as we** 8uring t$e do-ain ana*0sis ,rocess< engineers ai- to e1tend ?now*edge of t$e do-ain be0ond w$at is a*read0 ?nown and to categoriDe t$e do-ain into si-i*arities and differences to en$ance reconfigurabi*it0 8o-ain ana*0sis ,ri-ari*0 ,roduces a do-ain -ode*< re,resenting t$e co--on and "ar0ing ,ro,erties of s0ste-s wit$in t$e do-ain #$e do-ain -ode* assists wit$ t$e creation of arc$itectures and co-,onents in a configurab*e -anner b0 acting as a foundation u,on w$ic$ to design t$ese co-,onents >n effecti"e do-ain -ode* not on*0 inc*udes t$e "ar0ing and consistent features in a do-ain< but a*so defines t$e "ocabu*ar0 used in t$e do-ain and defines conce,ts< ideas and ,$eno-ena< wit$in t$e s0ste- Aeature -ode*s deco-,ose conce,ts into t$eir re@uired and o,tiona* features to ,roduce a fu**0 for-a*iDed set of configurab*e re@uire-ents Domain design 8o-ain design ta?es t$e do-ain -ode* ,roduced during t$e do-ain ana*0sis ,$ase and ai-s to ,roduce a generic arc$itecture to w$ic$ a** s0ste-s wit$in t$e do-ain can confor- !n t$e sa-e wa0 t$at a,,*ication engineering uses t$e functiona* and non-functiona* re@uire-ents to ,roduce a design< t$e do-ain design ,$ase of do-ain engineering ta?es t$e configurab*e re@uire-ents de"e*o,ed during t$e do-ain ana*0sis ,$ase and ,roduces a configurab*e< standardiDed so*ution for t$e fa-i*0 of s0ste-s 8o-ain design ai-s to ,roduce arc$itectura* ,atterns w$ic$ so*"e a ,rob*e- co--on across t$e s0ste-s wit$in t$e do-ain< des,ite differing re@uire-ent configurations !n addition to t$e de"e*o,-ent of ,atterns during do-ain design< engineers -ust a*so ta?e care to identif0 t$e sco,e of t$e ,attern and t$e *e"e* to w$ic$ conte1t is re*e"ant to t$e ,attern .i-itation of conte1t is crucia*: too -uc$ conte1t resu*ts in t$e ,attern not being a,,*icab*e to -an0 s0ste-s< and too *itt*e conte1t resu*ts in t$e ,attern being insufficient*0 ,owerfu* to be usefu* > usefu* ,attern -ust be bot$ fre@uent*0 recurring and of $ig$ @ua*it0 #$e objecti"e of do-ain design is to satisf0 as -an0 do-ain re@uire-ents as ,ossib*e w$i*e retaining t$e f*e1ibi*it0 offered b0 t$e de"e*o,ed feature -ode* #$e arc$itecture s$ou*d be sufficient*0 f*e1ib*e to satisf0 a** of t$e s0ste-s wit$in t$e do-ain w$i*e rigid enoug$ to ,ro"ide a so*id fra-ewor? u,on w$ic$ to base t$e so*ution - 25 -

Object-Oriented Software Engineering (CS350) Domain implementation 8o-ain i-,*e-entation is t$e creation of a ,rocess and too*s for efficient*0 generating a custo-iDed ,rogra- in t$e do-ain

-ser re,uirements
#$e user re#uirement/s0 document (=58) or user re#uirement/s0 specification is a docu-ent usua**0 used in software engineering t$at s,ecifies t$e re@uire-ents t$e user e1,ects fro- software to be constructed in a software ,roject >n i-,ortant and difficu*t ste, of designing a software ,roduct is deter-ining w$at t$e custo-er actua**0 wants it to do #$is is because often t$e custo-er is not ab*e to co--unicate t$e entiret0 of t$eir needs and wants< and t$e infor-ation t$e0 ,ro"ide -a0 a*so be inco-,*ete< inaccurate and se*fconf*icting #$e res,onsibi*it0 of co-,*ete*0 understanding w$at t$e custo-er wants t$en fa**s on t$e ,ro"iders of t$e ,roduct Once t$e re@uired infor-ation is co-,*ete*0 gat$ered it is docu-ented in a =58< w$ic$ is -eant to s,e** out e1act*0 w$at t$e software -ust do and beco-es ,art of t$e contractua* agree-ent > custo-er cannot de-and features not in t$e =58 wit$out renegotiating and a de"e*o,er cannot c*ai- t$e ,roduct is read0 if it does not -eet an ite- of t$e =58 #$e =58 can be used as a guide to ,*anning cost< ti-etab*es< -i*estones< testing< etc #$e e1,*icit nature of t$e =58 a**ows custo-ers to s$ow it to "arious sta?e$o*ders to -a?e sure a** necessar0 features are described Aor-u*ating a =58 re@uires negotiation to deter-ine w$at is tec$nica**0 and econo-ica**0 feasib*e %re,aring a =58 is one of t$ose s?i**s t$at *ies between a science and an art< re@uiring bot$ software tec$nica* s?i**s and inter,ersona* s?i**s

System re,uirements
#o be used efficient*0< a** co-,uter software needs certain $ardware co-,onents or ot$er software resources to be ,resent on a co-,uter #$ese ,rere@uisites are ?nown as (co-,uter) system re#uirements and are often used as a guide*ine as o,,osed to an abso*ute ru*e /ost software defines two sets of s0ste- re@uire-ents: -ini-u- and reco--ended 3it$ increasing de-and for $ig$er ,rocessing ,ower and resources in newer "ersions of software< s0ste- re@uire-ents tend to increase o"er ti-e !ndustr0 ana*0sts suggest t$at t$is trend ,*a0s a bigger ,art in dri"ing u,grades to e1isting co-,uter s0ste-s t$an tec$no*ogica* ad"ance-ents

3eco,,ended s/ste, re>uire,ents


Oftenti-es -anufacturers of ga-es wi** ,ro"ide t$e consu-er wit$ a set of re@uire-ents t$at are different t$an t$ose t$at are needed to run a software #$ese re@uire-ents are usua**0 ca**ed t$e 5eco--ended 5e@uire-ents #$ese re@uire-ents are a*-ost a*wa0s of a significant*0 $ig$er *e"e* t$at t$e -ini-u- re@uire-ents< and re,resent t$e idea* situation in w$ic$ to run t$e software 7enera**0 s,ea?ing t$is is a better guide*ine t$an -ini-u- s0ste- re@uire-ents in order to $a"e a fu**0 usab*e and enjo0ab*e e1,erience wit$ a software - 2( -

Course Notes:

9ardware re>uire,ents
#$e -ost co--on set of re@uire-ents defined b0 an0 o,erating s0ste- or software a,,*ication is t$e ,$0sica* co-,uter resources< a*so ?nown as $ardware< > $ardware re@uire-ents *ist is often acco-,anied b0 a $ardware co-,atibi*it0 *ist (;C.)< es,ecia**0 in case of o,erating s0ste-s >n ;C. *ists tested< co-,atib*e< and so-eti-es inco-,atib*e $ardware de"ices for a ,articu*ar o,erating s0steor a,,*ication #$e fo**owing sub-sections discuss t$e "arious as,ects of $ardware re@uire-ents %rchitecture >** co-,uter o,erating s0ste-s are designed for a ,articu*ar co-,uter arc$itecture /ost software a,,*ications are *i-ited to ,articu*ar o,erating s0ste-s running on ,articu*ar arc$itectures >*t$oug$ arc$itecture-inde,endent o,erating s0ste-s and a,,*ications e1ist< -ost need to be reco-,i*ed to run on a new arc$itecture See a*so a *ist of co--on o,erating s0ste-s and t$eir su,,orting arc$itectures Processing power #$e ,ower of t$e centra* ,rocessing unit (C%=) is a funda-enta* s0ste- re@uire-ent for an0 software /ost software running on 1)( arc$itecture define ,rocessing ,ower as t$e -ode* and t$e c*oc? s,eed of t$e C%= /an0 ot$er features of a C%= t$at inf*uence its s,eed and ,ower< *i?e bus s,eed< cac$e< and /!%S are often ignored #$is definition of ,ower is often erroneous< as >/8 >t$*on and !nte* %entiu- C%=s at si-i*ar c*oc? s,eed often $a"e different t$roug$,ut s,eeds !nte* %entiu- C%=s $a"e enjo0ed a considerab*e degree of ,o,u*arit0< and are often -entioned in t$is categor0 Memory >** software< w$en run< resides in t$e rando- access -e-or0 (5>/) of a co-,uter /e-or0 re@uire-ents are defined after considering de-ands of t$e a,,*ication< o,erating s0ste-< su,,orting software and fi*es< and ot$er running ,rocesses O,ti-a* ,erfor-ance of ot$er unre*ated software running on a -u*ti-tas?ing co-,uter s0ste- is a*so considered w$en defining t$is re@uire-ent Secondary storage ;ard-dis? re@uire-ents "ar0< de,ending on t$e siDe of software insta**ation< te-,orar0 fi*es created and -aintained w$i*e insta**ing or running t$e software< and ,ossib*e use of swa, s,ace (if 5>/ is insufficient) Display adapter Software re@uiring a better t$an a"erage co-,uter gra,$ics dis,*a0< *i?e gra,$ics editors and $ig$-end ga-es< often define $ig$-end dis,*a0 ada,ters in t$e s0ste- re@uire-ents Peripherals So-e software a,,*ications need to -a?e e1tensi"e andFor s,ecia* use of so-e ,eri,$era*s< de-anding t$e $ig$er ,erfor-ance or functiona*it0 of suc$ ,eri,$era*s Suc$ ,eri,$era*s inc*ude C8-5O/ dri"es< ?e0boards< ,ointing de"ices< networ? de"ices< etc - 22 -

Object-Oriented Software Engineering (CS350)

Software re>uire,ents
Software re@uire-ents dea* wit$ defining software resource re@uire-ents and ,rere@uisites t$at need to be insta**ed on a co-,uter to ,ro"ide o,ti-a* functioning of an a,,*ication #$ese re@uire-ents or ,rere@uisites are genera**0 not inc*uded in t$e software insta**ation ,ac?age and need to be insta**ed se,arate*0 before t$e software is insta**ed Platform !n co-,uting< a platform describes so-e sort of fra-ewor?< eit$er in $ardware or software< w$ic$ a**ows software to run #0,ica* ,*atfor-s inc*ude a co-,uter4s arc$itecture< o,erating s0ste-< or ,rogra--ing *anguages and t$eir runti-e *ibraries O,erating s0ste- is one of t$e first re@uire-ents -entioned w$en defining s0ste- re@uire-ents (software) Software -a0 not be co-,atib*e wit$ different "ersions of sa-e *ine of o,erating s0ste-s< a*t$oug$ so-e -easure of bac?ward co-,atibi*it0 is often -aintained Aor e1a-,*e< -ost software designed for /icrosoft 3indows T% does not run on /icrosoft 3indows &)< a*t$oug$ t$e con"erse is not a*wa0s true Si-i*ar*0< software designed using newer features of .inu1 Serne* "2 ( genera**0 does not run or co-,i*e ,ro,er*0 (or at a**) on .inu1 distributions using Serne* "2 2 or "2 ' %P#s and drivers Software -a?ing e1tensi"e use of s,ecia* $ardware de"ices< *i?e $ig$-end dis,*a0 ada,ters< needs s,ecia* >%! or newer de"ice dri"ers > good e1a-,*e is 8irectT< w$ic$ is a co**ection of >%!s for $and*ing tas?s re*ated to -u*ti-edia< es,ecia**0 ga-e ,rogra--ing< on /icrosoft ,*atfor-s .eb browser /ost web a,,*ications and software de,ending $ea"i*0 on !nternet tec$no*ogies -a?e use of t$e defau*t browser insta**ed on s0ste- /icrosoft !nternet E1,*orer is a fre@uent c$oice of software running on /icrosoft 3indows< w$ic$ -a?es use of >cti"eT contro*s< des,ite t$eir "u*nerabi*ities

Ot$er re>uire,ents
So-e software a*so $as ot$er re@uire-ents for ,ro,er ,erfor-ance !nternet connection (t0,e and s,eed) and reso*ution of t$e dis,*a0 screen are notab*e e1a-,*es

E0a,+les
Ao**owing are a few e1a-,*es of s0ste- re@uire-ent definitions for ,o,u*ar %C ga-es and trend of e"er increasing resource needs: Aor instance< w$i*e Star.raft (1&&)) needed: 3indows &5 or N# or su,erior %entiu- ,rocessor at &0 /;D or $ig$er 1( /+ 5>/ - 2) -

Course Notes: )0 /+ a"ai*ab*e in t$e $ard dis? C8-5O/< 21 or $ig$er 8irectT 3 0 or $ig$er S!ider#Man (2002) needed: 38 ;ardware >cce*erator 3indows &)F2000FN#FT% %entiu- !!! ,rocessor at 500 /;D or $ig$er 12) /+ 5>/ 1 5 7+ a"ai*ab*e in t$e $ard dis? 8irectT ) 1 38 ;ardware >cce*erator - ('/+ of -e-or0 -ini-u3indows 2000FT% %entiu- ' 1 5 7;D or >t$*on T% 1500B ,rocessor or $ig$er 3)' /+ 5>/ )1 S,eed C8-5O/ 2 2 7+ free $ard dis? s,ace 8irectT & 0b co-,atib*e 1(-bit sound card 8irectT & 0b 38 ;ardware >cce*erator - 25(/+ of -e-or0 -ini-u3indows 3indows T% S%3< 3indows :ista S%2< 3indows 2 Core 2 8uo or >t$*on T2 at 2 ' 7;D 2 7+ 5>/ )1 S,eed 8:8-5O/ 23 ) 7+ B 1 7+ Swa, Ai*e $ard dis? s,ace 8irectT & 0c co-,atib*e sound card 8irectT & 0c co-,atib*e "ideo card

,oom 7 (200') needed:

Star (ars- The )orce 3nleashed (200&) needed:

+e,uirements document
!n engineering< a re#uirement is a singu*ar docu-ented ,$0sica* and functiona* need t$at a ,articu*ar ,roduct or ser"ice -ust be or ,erfor- !t is -ost co--on*0 used in a for-a* sense in s0ste-s engineering< software engineering< or enter,rise engineering !t is a state-ent t$at identifies a necessar0 attribute< ca,abi*it0< c$aracteristic< or @ua*it0 of a s0ste- for it to $a"e "a*ue and uti*it0 to a user !n t$e c*assica* engineering a,,roac$< sets of re@uire-ents are used as in,uts into t$e design stages of ,roduct de"e*o,-ent 5e@uire-ents are a*so an i-,ortant in,ut into t$e "erification ,rocess< since tests s$ou*d trace bac? to s,ecific re@uire-ents 5e@uire-ents s$ow w$at e*e-ents and functions are necessar0 for t$e ,articu*ar ,roject #$is is ref*ected in t$e waterfa** -ode* of t$e software *ife-c0c*e - 2& -

Object-Oriented Software Engineering (CS350) ;owe"er< w$en iterati"e -et$ods of software de"e*o,-ent or agi*e -et$ods are used< t$e s0stere@uire-ents are incre-enta**0 de"e*o,ed in ,ara**e* wit$ design and i-,*e-entation 5e@uire-ents engineering is t$e set of acti"ities t$at *ead to t$e deri"ation of t$e s0ste- or software re@uire-ents 5e@uire-ents engineering -a0 in"o*"e a feasibi*it0 stud0< or a conce,tua* ana*0sis ,$ase of t$e ,roject and re@uire-ents e*icitation (gat$ering< understanding< re"iewing< and articu*ating t$e needs of t$e sta?e$o*ders) and re@uire-ents ana*0sis<J1W ana*0sis (c$ec?ing for consistenc0 and co-,*eteness)< s,ecification (docu-enting t$e re@uire-ents) and "a*idation (-a?ing sure t$e s,ecified re@uire-ents are correct) J2WJ3W

Origins of ter,
5e@uire-ent $as been in use in t$e software engineering co--unit0 since at *east t$e 1&(04s 1

%roduct #ersus +rocess re>uire,ents


%rojects are subject to t$ree sorts of re@uire-ents: Business re#uirements describe in business ter-s what -ust be de*i"ered or acco-,*is$ed to ,ro"ide "a*ue roduct re#uirements describe ,ro,erties of a s0ste- or ,roduct (w$ic$ cou*d be one of se"era* wa0s to acco-,*is$ a set of business re@uire-ents ) rocess re#uirements describe acti"ities ,erfor-ed b0 t$e de"e*o,ing organiDation Aor instance< ,rocess re@uire-ents cou*d s,ecif0 s,ecific -et$odo*ogies t$at -ust be fo**owed< and constraints t$at t$e organiDation -ust obe0 %roduct and ,rocess re@uire-ents are c*ose*0 *in?ed %rocess re@uire-ents often s,ecif0 t$e acti"ities t$at wi** be ,erfor-ed to satisf0 a ,roduct re@uire-ent Aor e1a-,*e< a -a1i-u- de"e*o,-ent cost re@uire-ent (a ,rocess re@uire-ent) -a0 be i-,osed to $e*, ac$ie"e a -a1i-u- sa*es ,rice re@uire-ent (a ,roduct re@uire-ent)G a re@uire-ent t$at t$e ,roduct be -aintainab*e (a %roduct re@uire-ent) often is addressed b0 i-,osing re@uire-ents to fo**ow ,articu*ar de"e*o,-ent st0*es (e g < object-oriented ,rogra--ing)< st0*e-guides< or a re"iewFins,ection ,rocess (,rocess re@uire-ents)

3e>uire,ents in s/ste,s and software engineering


!n s0ste-s engineering< a re#uirement can be a descri,tion of what a s0ste- -ust do< referred to as a )unctional +e2uirement #$is t0,e of re@uire-ent s,ecifies so-et$ing t$at t$e de*i"ered s0ste- -ust be ab*e to do >not$er t0,e of re@uire-ent s,ecifies so-et$ing about t$e s0ste- itse*f< and $ow we** it ,erfor-s its functions Suc$ re@uire-ents are often ca**ed non#functional re2uirements< or 4,erfor-ance re@uire-ents4 or 4@ua*it0 of ser"ice re@uire-ents 4 E1a-,*es of suc$ re@uire-ents inc*ude usabi*it0< a"ai*abi*it0< re*iabi*it0< su,,ortabi*it0< testabi*it0 and -aintainabi*it0 > co**ection of re@uire-ents define t$e c$aracteristics or features of t$e desired s0ste- > 4good4 *ist of re@uire-ents as far as ,ossib*e a"oids sa0ing how t$e s0ste- s$ou*d i-,*e-ent t$e re@uire-ents< *ea"ing suc$ decisions to t$e s0ste- designer S,ecif0ing $ow t$e s0ste- s$ou*d be i-,*e-ented is ca**ed Hi-,*e-entation biasH or Hso*ution engineeringH ;owe"er< im!lementation constraints on t$e so*ution -a0 "a*id*0 be e1,ressed b0 t$e future owner< for e1a-,*e for re@uired interfaces to e1terna* - )0 -

Course Notes: s0ste-sG for intero,erabi*it0 wit$ ot$er s0ste-sG and for co--ona*it0 (e g of user interfaces) wit$ ot$er owned ,roducts !n software engineering< t$e sa-e -eanings of re@uire-ents a,,*0< e1ce,t t$at t$e focus of interest is t$e software itse*f

%roduct re>uire,ents
"ypes of product re,uirements 5e@uire-ents are t0,ica**0 ,*aced into t$ese categories: >rc$itectura* re@uire-ents describe w$at -ust be done b0 identif0ing t$e necessar0 s0stearc$itecture of a s0ste-< Aunctiona* re@uire-ents describe t$e functiona*it0 t$at t$e s0ste- is to e1ecuteG for e1a-,*e< for-atting so-e te1t or -odu*ating a signa* #$e0 are so-eti-es ?nown as ca,abi*ities Non-functiona* re@uire-ents describe c$aracteristics of t$e s0ste- t$at t$e user cannot affect or (i--ediate*0) ,ercei"e Nonfunctiona* re@uire-ents are so-eti-es ?nown as @ua*it0 re@uire-ents or i*ities Constraint re@uire-ents i-,ose *i-its u,on t$e design a*ternati"es or ,rojectF,rocess o,erations No -atter $ow t$e ,rob*e- is so*"ed t$e constraint re@uire-ents -ust be ad$ered to J'W Non-functiona* re@uire-ents can be furt$er c*assified according to w$et$er t$e0 are usabi*it0 re@uire-ents< *oo? and fee* re@uire-ents< $u-anit0 re@uire-ents< ,erfor-ance re@uire-ents< -aintainabi*it0 re@uire-ents< o,erationa* re@uire-ents< safet0 re@uire-ents< re*iabi*it0 re@uire-ents< or one of -an0 ot$er t0,es of re@uire-ents !n software engineering t$is categoriDation is usefu* because on*0 functiona* re@uire-ents can be direct*0 i-,*e-ented in software #$e non-functiona* re@uire-ents are contro**ed b0 ot$er as,ects of t$e s0ste- Aor e1a-,*e< in a co-,uter s0ste- re*iabi*it0 is re*ated to $ardware fai*ure rates< and ,erfor-ance is contro**ed b0 C%= and -e-or0 Non-functiona* re@uire-ents can in so-e cases be deco-,osed into functiona* re@uire-ents for software Aor e1a-,*e< a s0ste- *e"e* non-functiona* safet0 re@uire-ent can be deco-,osed into one or -ore functiona* re@uire-ents See A=5%S !n addition< a non-functiona* re@uire-ent -a0 be con"erted into a ,rocess re@uire-ent w$en t$e re@uire-ent is not easi*0 -easurab*e Aor e1a-,*e< a s0ste- *e"e* -aintainabi*it0 re@uire-ent -a0 be deco-,osed into restrictions on software constructs or *i-its on *ines or code Characteristics of good re,uirements #$e c$aracteristics of good re@uire-ents are "arious*0 stated b0 different writers< wit$ eac$ writer genera**0 e-,$asiDing t$e c$aracteristics -ost a,,ro,riate to t$eir genera* discussion or t$e s,ecific tec$no*og0 do-ain being addressed ;owe"er< t$e fo**owing c$aracteristics are genera**0 ac?now*edged J5W J(W

- )1 -

Object-Oriented Software Engineering (CS350) !haracteristic Explanation =nitar0 #$e re@uire-ent addresses one and on*0 one t$ing (Co$esi"e) Co-,*ete #$e re@uire-ent is fu**0 stated in one ,*ace wit$ no -issing infor-ation #$e re@uire-ent does not contradict an0 ot$er re@uire-ent and is fu**0 consistent Consistent wit$ a** aut$oritati"e e1terna* docu-entation #$e re@uire-ent is atomic< i e < it does not contain conjunctions E g < H#$e ,osta* Non-Conjugated code fie*d -ust "a*idate >-erican and Canadian ,osta* codesH s$ou*d be written as (>to-ic) two se,arate re@uire-ents: (1) H#$e ,osta* code fie*d -ust "a*idate >-erican ,osta* codesH and (2) H#$e ,osta* code fie*d -ust "a*idate Canadian ,osta* codesH #$e re@uire-ent -eets a** or ,art of a business need as stated b0 sta?e$o*ders and #raceab*e aut$oritati"e*0 docu-ented Current #$e re@uire-ent $as not been -ade obso*ete b0 t$e ,assage of ti-e Aeasib*e #$e re@uire-ent can be i-,*e-ented wit$in t$e constraints of t$e ,roject #$e re@uire-ent is concise*0 stated wit$out recourse to tec$nica* jargon< acron0-s (un*ess defined e*sew$ere in t$e 5e@uire-ents docu-ent)< or ot$er esoteric "erbiage !t e1,resses objecti"e facts< not subjecti"e o,inions !t is subject to one =na-biguous and on*0 one inter,retation :ague subjects< adjecti"es< ,re,ositions< "erbs and subjecti"e ,$rases are a"oided Negati"e state-ents and co-,ound state-ents are a"oided /an0 re@uire-ents re,resent a sta?e$o*der-defined c$aracteristic t$e absence of S,ecif0 w$ic$ wi** resu*t in a -ajor or e"en fata* deficienc0 Ot$ers re,resent features t$at !-,ortance -a0 be i-,*e-ented if ti-e and budget ,er-its #$e re@uire-ent -ust s,ecif0 a *e"e* of i-,ortance #$e i-,*e-entation of t$e re@uire-ent can be deter-ined t$roug$ basic ,ossib*e :erifiab*e -et$ods: ins,ection< de-onstration< test (instru-ented) or ana*0sis (to inc*ude "a*idated -ode*ing 9 si-u*ation) #$ere are -an0 -ore attributes to consider t$at contribute to t$e @ua*it0 of re@uire-ents !f re@uire-ents are subject to ru*es of data integrit0 (for e1a-,*e) t$en accurac0Fcorrectness and "a*idit0Faut$oriDation are a*so wort$0 attributes #raceabi*it0 confir-s t$at t$e re@uire-ent set satisfies t$e need (no -ore - and no *ess t$an w$at is re@uired) #o t$e abo"e so-e add E1terna**0 Obser"ab*e< t$at is< t$e re@uire-ent s,ecifies a c$aracteristic of t$e ,roduct t$at is e1terna**0 obser"ab*e or e1,erienced b0 t$e user Suc$ ad"ocates argue t$at re@uire-ents t$at s,ecif0 interna* arc$itecture< design< i-,*e-entation< or testing decisions are ,robab*0 constraints< and s$ou*d be c*ear*0 articu*ated in t$e Constraints section of t$e 5e@uire-ents docu-ent #$e contrasting "iew is t$at t$is ,ers,ecti"e fai*s on two ,oints Airst< t$e ,ers,ecti"e does not recogniDe t$at t$e user e1,erience -a0 be su,,orted b0 re@uire-ents not ,ercei"ab*e b0 t$e user Aor e1a-,*e< a re@uire-ent to ,resent geocoded infor-ation to t$e user -a0 be su,,orted b0 a re@uire-ent for an interface wit$ an e1terna* t$ird ,art0 business ,artner #$e interface wi** be i-,erce,tib*e to t$e user< t$oug$ t$e ,resentation of infor-ation obtained t$roug$ t$e interface certain*0 wou*d not Second< a constraint *i-its design a*ternati"es< w$ereas a re@uire-ent s,ecifies design c$aracteristics #o continue t$e e1a-,*e< a re@uire-ent se*ecting a web ser"ice interface is - )2 -

Course Notes: different fro- a constraint *i-iting design a*ternati"es to -et$ods co-,atib*e wit$ a Sing*e Sign-On arc$itecture 8erification >** re@uire-ents s$ou*d be "erifiab*e #$e -ost co--on -et$od is b0 test !f t$is is not t$e case< anot$er "erification -et$od s$ou*d be used instead (e g ana*0sis< de-onstration or ins,ection or re"iew of design) Certain re@uire-ents< b0 t$eir "er0 structure< are not "erifiab*e #$ese inc*ude re@uire-ents t$at sa0 t$e s0ste- -ust never or always e1$ibit a ,articu*ar ,ro,ert0 %ro,er testing of t$ese re@uire-ents wou*d re@uire an infinite testing c0c*e Suc$ re@uire-ents -ust be rewritten to be "erifiab*e >s stated abo"e a** re@uire-ents -ust be "erifiab*e Non-functiona* re@uire-ents< w$ic$ are un"erifiab*e at t$e software *e"e*< -ust sti** be ?e,t as a docu-entation of custo-er intent ;owe"er< t$e0 -a0 be traced to ,rocess re@uire-ents t$at are deter-ined to be a ,ractica* wa0 of -eeting t$e- Aor e1a-,*e< a non-functiona* re@uire-ent to be free fro- bac?doors -a0 be satisfied b0 re,*acing it wit$ a ,rocess re@uire-ent to use ,air ,rogra--ing Ot$er non-functiona* re@uire-ents wi** trace to ot$er s0ste- co-,onents and be "erified at t$at *e"e* Aor e1a-,*e s0ste- re*iabi*it0 is often "erified b0 ana*0sis at t$e s0ste- *e"e* >"ionics software wit$ its co-,*icated safet0 re@uire-ents -ust fo**ow t$e 8O-12)+ de"e*o,-ent ,rocess 3e>uire,ents anal/sis or re>uire,ents engineering 5e@uire-ents are ,rone to issues of a-biguit0< inco-,*eteness< and inconsistenc0 #ec$ni@ues suc$ as rigorous ins,ection $a"e been s$own to $e*, dea* wit$ t$ese issues >-biguities< inco-,*eteness< and inconsistencies t$at can be reso*"ed in t$e re@uire-ents ,$ase t0,ica**0 cost orders of -agnitude *ess to correct t$an w$en t$ese sa-e issues are found in *ater stages of ,roduct de"e*o,-ent 5e@uire-ents ana*0sis stri"es to address t$ese issues #$ere is an engineering trade off to consider between re@uire-ents w$ic$ are too "ague< and t$ose w$ic$ are so detai*ed t$at t$e0 1 ta?e a *ong ti-e to ,roduce - so-eti-es to t$e ,oint of being obso*ete once co-,*eted 2 *i-it t$e i-,*e-entation o,tions a"ai*ab*e 3 are cost*0 to ,roduce Documenting re,uirements 5e@uire-ents are usua**0 written as a -eans for co--unication between t$e different sta?e$o*ders #$is -eans t$at t$e re@uire-ents s$ou*d be eas0 to understand bot$ for nor-a* users and for de"e*o,ers One co--on wa0 to docu-ent a re@uire-ent is stating w$at t$e s0ste- -ust do E1a-,*e: 4#$e contractor -ust de*i"er t$e ,roduct no *ater t$an 10D date Ot$er -et$ods inc*ude use cases and user stories Changes in re,uirements 5e@uire-ents genera**0 c$ange wit$ ti-e Once defined and a,,ro"ed< re@uire-ents s$ou*d fa** under - )3 -

Object-Oriented Software Engineering (CS350) c$ange contro* Aor -an0 ,rojects< re@uire-ents are a*tered before t$e s0ste- is co-,*ete #$is is ,art*0 due to t$e co-,*e1it0 of co-,uter software and t$e fact t$at users don4t ?now w$at t$e0 want before t$e0 see it #$is c$aracteristic of re@uire-ents $as *ed to re@uire-ents -anage-ent studies and ,ractices

"ssues
Competing views #$ere are se"era* co-,eting "iews of w$at re@uire-ents are and $ow t$e0 s$ou*d be -anaged and used #wo *eading bodies in t$e industr0 are t$e !EEE and t$e !!+> +ot$ of t$ese grou,s $a"e different but si-i*ar definitions of w$at a re@uire-ent is #$e 8uide to the Business nalysis Body of 1nowledge9 "ersion 2 fro- !!+> defines a re@uire-ent as: 1 > condition or ca,abi*it0 needed b0 a sta?e$o*der to so*"e a ,rob*e- or ac$ie"e an objecti"e 2 > condition or ca,abi*it0 t$at -ust be -et or ,ossessed b0 a so*ution or so*ution co-,onent to satisf0 a contract< standard< s,ecification< or ot$er for-a**0 i-,osed docu-ents 3 > docu-ented re,resentation of a condition or ca,abi*it0 as in (1) or (2) J2W #$is definition is based on !EEE (10 12-1&&0: !EEE Standard 7*ossar0 of Software Engineering #er-ino*og0 +e,uirements ta$onomy #$ere are -u*ti,*e ta1ono-ies for re@uire-ents de,ending on w$ic$ fra-ewor? one is o,erating under Disputes regarding the necessity of rigor in software re,uirements /ost agi*e software de"e*o,-ent -et$odo*ogies @uestion t$e need for rigorous*0 describing software re@uire-ents u,front< w$ic$ t$e0 consider a -o"ing target !nstead< e1tre-e ,rogra--ing for e1a-,*e describes re@uire-ents infor-a**0 using user stories (s$ort su--aries fitting on an inde1 card e1,*aining one as,ect of w$at t$e s0ste- s$ou*d do)< and considers it t$e de"e*o,er4s dut0 to direct*0 as? t$e custo-er for c*arification >gi*e -et$odo*ogies a*so t0,ica**0 ca,ture re@uire-ents in a series of auto-ated acce,tance tests

- )' -

Course Notes:

5! Object-oriented design tools


#$e co-,uter-based too*s t$at are intended to assist t$e software *ife c0c*e ,rocesses

-M1 Diagrams
Unified )odeling 1anguage (U)1) is a standardiDed genera*-,ur,ose -ode*ing *anguage in t$e fie*d of object-oriented software engineering #$e standard is -anaged< and was created< b0 t$e Object /anage-ent 7rou, !t was first added to t$e *ist of O/7 ado,ted tec$no*ogies in 1&&2< and $as since beco-e t$e industr0 standard for -ode*ing software-intensi"e s0ste-s J1W =/. inc*udes a set of gra,$ic notation tec$ni@ues to create "isua* -ode*s of object-oriented softwareintensi"e s0ste-s =/. is used to s,ecif0< "isua*iDe< -odif0< construct and docu-ent t$e artifacts of an object-oriented software-intensi"e s0ste- under de"e*o,-ent J2W =/. offers a standard wa0 to "isua*iDe a s0ste-4s arc$itectura* b*ue,rints< inc*uding e*e-ents suc$ as: acti"ities actors business ,rocesses database sc$e-as (*ogica*) co-,onents ,rogra--ing *anguage state-ents reusab*e software co-,onents J3W

=/. co-bines tec$ni@ues fro- data -ode*ing (entit0 re*ations$i, diagra-s)< business -ode*ing (wor? f*ows)< object -ode*ing< and co-,onent -ode*ing !t can be used wit$ a** ,rocesses< t$roug$out t$e software de"e*o,-ent *ife c0c*e< and across different i-,*e-entation tec$no*ogies J'W =/. $as s0nt$esiDed t$e notations of t$e +ooc$ -et$od< t$e Object--ode*ing tec$ni@ue (O/#) and Objectoriented software engineering (OOSE) b0 fusing t$e- into a sing*e< co--on and wide*0 usab*e -ode*ing *anguage =/. ai-s to be a standard -ode*ing *anguage w$ic$ can -ode* concurrent and distributed s0ste-s =/. is a de facto industr0 standard< and is e"o*"ing under t$e contro* of t$e Object /anage-ent 7rou, (O/7) =/. -ode*s -a0 be auto-atica**0 transfor-ed to ot$er re,resentations (e g Ia"a) b0 -eans of E:#*i?e transfor-ation *anguages =/. is e1tensib*e< wit$ two -ec$anis-s for custo-iDation: ,rofi*es and stereot0,es

9istor/

- )5 -

Object-Oriented Software Engineering (CS350)

;istor0 of object-oriented -et$ods and notation &efore -M1 20$ >fter 5ationa* Software Cor,oration $ired Ia-es 5u-baug$ fro- 7enera* E*ectric in 1&&'< t$e co-,an0 beca-e t$e source for t$e two -ost ,o,u*ar object-oriented -ode*ing a,,roac$es of t$e da0: 5u-baug$4s Object--ode*ing tec$ni@ue (O/#)< w$ic$ was better for object-oriented ana*0sis (OO>)< and 7rad0 +ooc$4s +ooc$ -et$od< w$ic$ was better for object-oriented design (OO8) #$e0 were soon assisted in t$eir efforts b0 !"ar Iacobson< t$e creator of t$e object-oriented software engineering (OOSE) -et$od Iacobson joined 5ationa* in 1&&5< after $is co-,an0< Objector0 >+<J5W was ac@uired b0 5ationa* #$e t$ree -et$odo*ogists were co**ecti"e*0 referred to as t$e Three migos !n 1&&(< 5ationa* conc*uded t$at t$e abundance of -ode*ing *anguages was s*owing t$e ado,tion of object tec$no*og0< so re,ositioning t$e wor? on a unified -et$od< t$e0 tas?ed t$e #$ree >-igos wit$ t$e de"e*o,-ent of a non-,ro,rietar0 =nified /ode*ing .anguage 5e,resentati"es of co-,eting object tec$no*og0 co-,anies were consu*ted during OO%S.> 4&(G t$e0 c$ose bo"es for re,resenting c*asses rat$er t$an t$e cloud s0-bo*s t$at were used in +ooc$4s notation =nder t$e tec$nica* *eaders$i, of t$e #$ree >-igos< an internationa* consortiu- ca**ed t$e =/. %artners was organiDed in 1&&( to co-,*ete t$e 3nified Modeling :anguage (3M:) s,ecification< and ,ro,ose it as a res,onse to t$e O/7 5A% #$e =/. %artners4 =/. 1 0 s,ecification draft was ,ro,osed to t$e O/7 in Ianuar0 1&&2 8uring t$e sa-e -ont$ t$e =/. %artners for-ed a Se-antics #as? Aorce< c$aired b0 Cris Sobr0n and ad-inistered b0 Ed E0?$o*t< to fina*iDe t$e se-antics of t$e s,ecification and integrate it wit$ ot$er standardiDation efforts #$e resu*t of t$is wor?< =/. 1 1< was sub-itted to t$e O/7 in >ugust 1&&2 and ado,ted b0 t$e O/7 in No"e-ber 1&&2 J(W -M1 20$ >s a -ode*ing notation< t$e inf*uence of t$e O/# notation do-inates (e g < using rectang*es for c*asses and objects) #$oug$ t$e +ooc$ Hc*oudH notation was dro,,ed< t$e +ooc$ ca,abi*it0 to s,ecif0 *ower-*e"e* design detai* was e-braced #$e use case notation fro- Objector0 and t$e co-,onent notation fro- +ooc$ were integrated wit$ t$e rest of t$e notation< but t$e se-antic integration was re*ati"e*0 wea? in =/. 1 1< and was not rea**0 fi1ed unti* t$e =/. 2 0 -ajor re"ision - )( -

Course Notes: Conce,ts fro- -an0 ot$er OO -et$ods were a*so *oose*0 integrated wit$ =/. wit$ t$e intent t$at =/. wou*d su,,ort a** OO -et$ods /an0 ot$ers a*so contributed< wit$ t$eir a,,roac$es f*a"ouring t$e -an0 -ode*s of t$e da0< inc*uding: #on0 3asser-an and %eter %irc$er wit$ t$e HObject-Oriented Structured 8esign (OOS8)H notation (not a -et$od)< 5a0 +u$r4s HS0ste-s 8esign wit$ >daH< >rc$ie +owen4s use case and ti-ing ana*0sis< %au* 3ard4s data ana*0sis and 8a"id ;are*4s HStatec$artsHG as t$e grou, tried to ensure broad co"erage in t$e rea*-ti-e s0ste-s do-ain >s a resu*t< =/. is usefu* in a "ariet0 of engineering ,rob*e-s< fro- sing*e ,rocess< sing*e user a,,*ications to concurrent< distributed s0ste-s< -a?ing =/. ric$ but a*so *arge #$e =nified /ode*ing .anguage is an internationa* standard: !SOF!EC 1&501:2005 !nfor-ation tec$no*og0 C O,en 8istributed %rocessing C =nified /ode*ing .anguage (=/.) :ersion 1 ' 2 -M1 30$ =/. $as -atured significant*0 since =/. 1 1 Se"era* -inor re"isions (=/. 1 3< 1 '< and 1 5) fi1ed s$ortco-ings and bugs wit$ t$e first "ersion of =/.< fo**owed b0 t$e =/. 2 0 -ajor re"ision t$at was ado,ted b0 t$e O/7 in 2005 J2W >*t$oug$ =/. 2 1 was ne"er re*eased as a for-a* s,ecification< "ersions 2 1 1 and 2 1 2 a,,eared in 2002< fo**owed b0 =/. 2 2 in Aebruar0 200& =/. 2 3 was for-a**0 re*eased in /a0 2010 J)W =/. 2 ' 1 was for-a**0 re*eased in >ugust 2011 J&W #$ere are four ,arts to t$e =/. 2 1 s,ecification: 1 #$e Su,erstructure t$at defines t$e notation and se-antics for diagra-s and t$eir -ode* e*e-ents 2 #$e !nfrastructure t$at defines t$e core -eta-ode* on w$ic$ t$e Su,erstructure is based 3 #$e Object Constraint .anguage (OC.) for defining ru*es for -ode* e*e-ents ' #$e =/. 8iagra- !nterc$ange t$at defines $ow =/. 2 diagra- *a0outs are e1c$anged #$e current "ersions of t$ese standards fo**ow: =/. Su,erstructure "ersion 2 ' 1< =/. !nfrastructure "ersion 2 ' 1< OC. "ersion 2 3 1< and =/. 8iagra- !nterc$ange "ersion 1 0 J10W >*t$oug$ -an0 =/. too*s su,,ort so-e of t$e new features of =/. 2 1< t$e O/7 ,ro"ides no test suite to objecti"e*0 test co-,*iance wit$ its s,ecifications

o+ics
Software development methods =/. is not a de"e*o,-ent -et$od b0 itse*fGJ11W $owe"er< it was designed to be co-,atib*e wit$ t$e *eading object-oriented software de"e*o,-ent -et$ods of its ti-e (for e1a-,*e O/#< +ooc$ -et$od< Objector0) Since =/. $as e"o*"ed< so-e of t$ese -et$ods $a"e been recast to ta?e ad"antage of t$e new notations (for e1a-,*e O/#)< and new -et$ods $a"e been created based on =/.< suc$ as !+/ 5ationa* =nified %rocess (5=%) Ot$ers inc*ude >bstraction /et$od and 80na-ic S0ste-s 8e"e*o,-ent /et$od - )2 -

Object-Oriented Software Engineering (CS350) Modeling !t is i-,ortant to distinguis$ between t$e =/. -ode* and t$e set of diagra-s of a s0ste- > diagra- is a ,artia* gra,$ic re,resentation of a s0ste-4s -ode* #$e -ode* a*so contains docu-entation t$at dri"es t$e -ode* e*e-ents and diagra-s (suc$ as written use cases) =/. diagra-s re,resent two different "iews of a s0ste- -ode*:J12W Static (or structural) "iew: e-,$asiDes t$e static structure of t$e s0ste- using objects< attributes< o,erations and re*ations$i,s #$e structura* "iew inc*udes c*ass diagra-s and co-,osite structure diagra-s 80na-ic (or behavioral) "iew: e-,$asiDes t$e d0na-ic be$a"ior of t$e s0ste- b0 s$owing co**aborations a-ong objects and c$anges to t$e interna* states of objects #$is "iew inc*udes se@uence diagra-s< acti"it0 diagra-s and state -ac$ine diagra-s =/. -ode*s can be e1c$anged a-ong =/. too*s b0 using t$e T/! interc$ange for-at Diagrams overview U)1 diagrams &tructural U)1 diagrams C*ass diagraCo-,onent diagraCo-,osite structure diagra8e,*o0-ent diagraObject diagra%ac?age diagra%rofi*e diagraBehavioural U)1 diagrams >cti"it0 diagraCo--unication diagra!nteraction o"er"iew diagraSe@uence diagraState diagra#i-ing diagra=se case diagra=/. 2 2 $as 1' t0,es of diagra-s di"ided into two categories J13W Se"en diagra- t0,es re,resent structural infor-ation< and t$e ot$er se"en re,resent genera* t0,es of behavior< inc*uding four t$at re,resent different as,ects of interactions #$ese diagra-s can be categoriDed $ierarc$ica**0 as s$own in t$e fo**owing c*ass diagra-:

- )) -

Course Notes:

=/. does not restrict =/. e*e-ent t0,es to a certain diagra- t0,e !n genera*< e"er0 =/. e*e-ent -a0 a,,ear on a*-ost a** t0,es of diagra-sG t$is f*e1ibi*it0 $as been ,artia**0 restricted in =/. 2 0 =/. ,rofi*es -a0 define additiona* diagra- t0,es or e1tend e1isting diagra-s wit$ additiona* notations !n ?ee,ing wit$ t$e tradition of engineering drawings< a co--ent or note e1,*aining usage< constraint< or intent is a**owed in a =/. diagraStructure diagra,s Structure diagra-s e-,$asiDe t$e t$ings t$at -ust be ,resent in t$e s0ste- being -ode*ed Since structure diagra-s re,resent t$e structure< t$e0 are used e1tensi"e*0 in docu-enting t$e software arc$itecture of software s0ste-s C*ass diagra-: describes t$e structure of a s0ste- b0 s$owing t$e s0ste-4s c*asses< t$eir attributes< and t$e re*ations$i,s a-ong t$e c*asses Co-,onent diagra-: describes $ow a software s0ste- is s,*it u, into co-,onents and s$ows t$e de,endencies a-ong t$ese co-,onents Co-,osite structure diagra-: describes t$e interna* structure of a c*ass and t$e co**aborations t$at t$is structure -a?es ,ossib*e 8e,*o0-ent diagra-: describes t$e $ardware used in s0ste- i-,*e-entations and t$e e1ecution en"iron-ents and artifacts de,*o0ed on t$e $ardware Object diagra-: s$ows a co-,*ete or ,artia* "iew of t$e structure of an e1a-,*e -ode*ed s0ste- at a s,ecific ti-e %ac?age diagra-: describes $ow a s0ste- is s,*it u, into *ogica* grou,ings b0 s$owing t$e de,endencies a-ong t$ese grou,ings %rofi*e diagra-: o,erates at t$e -eta-ode* *e"e* to s$ow stereot0,es as c*asses wit$ t$e ^^stereot0,e__ stereot0,e< and ,rofi*es as ,ac?ages wit$ t$e ^^,rofi*e__ stereot0,e #$e e1tension re*ation (so*id *ine wit$ c*osed< fi**ed arrow$ead) indicates w$at -eta-ode* e*e-ent a gi"en stereot0,e is e1tending - )& -

Object-Oriented Software Engineering (CS350)

C*ass diagra-

Co-,onent diagra-

Co-,osite structure diagra-

8e,*o0-ent diagra-

- &0 -

Course Notes: Object diagra-

%ac?age diagra*e$a#ior diagra,s +e$a"ior diagra-s e-,$asiDe w$at -ust $a,,en in t$e s0ste- being -ode*ed Since be$a"ior diagra-s i**ustrate t$e be$a"ior of a s0ste-< t$e0 are used e1tensi"e*0 to describe t$e functiona*it0 of software s0ste-s >cti"it0 diagra-: describes t$e business and o,erationa* ste,-b0-ste, wor?f*ows of co-,onents in a s0ste- >n acti"it0 diagra- s$ows t$e o"era** f*ow of contro* =/. state -ac$ine diagra-: describes t$e states and state transitions of t$e s0ste =se Case 8iagra-: describes t$e functiona*it0 ,ro"ided b0 a s0ste- in ter-s of actors< t$eir goa*s re,resented as use cases< and an0 de,endencies a-ong t$ose use cases

=/. >cti"it0 8iagra-

State /ac$ine diagra-

- &1 -

Object-Oriented Software Engineering (CS350)

=se Case 8iagra"nteraction diagra,s !nteraction diagra-s< a subset of be$a"ior diagra-s< e-,$asiDe t$e f*ow of contro* and data a-ong t$e t$ings in t$e s0ste- being -ode*ed: Co--unication diagra-: s$ows t$e interactions between objects or ,arts in ter-s of se@uenced -essages #$e0 re,resent a co-bination of infor-ation ta?en fro- C*ass< Se@uence< and =se Case 8iagra-s describing bot$ t$e static structure and d0na-ic be$a"ior of a s0ste !nteraction o"er"iew diagra-: ,ro"ides an o"er"iew in w$ic$ t$e nodes re,resent co--unication diagra-s Se@uence diagra-: s$ows $ow objects co--unicate wit$ eac$ ot$er in ter-s of a se@uence of -essages >*so indicates t$e *ifes,ans of objects re*ati"e to t$ose -essages #i-ing diagra-s: a s,ecific t0,e of interaction diagra- w$ere t$e focus is on ti-ing constraints

Co--unication diagra-

!nteraction o"er"iew diagra-

- &2 -

Course Notes:

Se@uence diagra#$e %rotoco* State /ac$ine is a sub-"ariant of t$e State /ac$ine !t -a0 be used to -ode* networ? co--unication ,rotoco*s Meta modeling

!**ustration of t$e /eta-Object Aaci*it0 #$e Object /anage-ent 7rou, (O/7) $as de"e*o,ed a -eta-ode*ing arc$itecture to define t$e =nified /ode*ing .anguage (=/.)< ca**ed t$e /eta-Object Aaci*it0 (/OA) #$e /eta-Object Aaci*it0 is a standard for -ode*-dri"en engineering< designed as a four-*a0ered arc$itecture< as s$own in t$e i-age at rig$t !t ,ro"ides a -eta--eta -ode* at t$e to, *a0er< ca**ed t$e /3 *a0er #$is /3--ode* is t$e *anguage used b0 /eta-Object Aaci*it0 to bui*d -eta-ode*s< ca**ed /2--ode*s #$e -ost ,ro-inent e1a-,*e of a .a0er 2 /eta-Object Aaci*it0 -ode* is t$e =/. -eta-ode*< t$e -ode* t$at describes t$e =/. itse*f #$ese /2--ode*s describe e*e-ents of t$e /1-*a0er< and t$us /1--ode*s #$ese wou*d be< for e1a-,*e< -ode*s written in =/. #$e *ast *a0er is t$e /0-*a0er or data *a0er !t is used to describe runti-e instance of t$e s0ste-

- &3 -

Object-Oriented Software Engineering (CS350) +e0ond t$e /3--ode*< t$e /eta-Object Aaci*it0 describes t$e -eans to create and -ani,u*ate -ode*s and -eta-ode*s b0 defining CO5+> interfaces t$at describe t$ose o,erations +ecause of t$e si-i*arities between t$e /eta-Object Aaci*it0 /0--ode* and =/. structure -ode*s< /eta-Object Aaci*it0 -eta-ode*s are usua**0 -ode*ed as =/. c*ass diagra-s > su,,orting standard of t$e /etaObject Aaci*it0 is T/!< w$ic$ defines an T/.-based e1c$ange for-at for -ode*s on t$e /3-< /2-< or /1-.a0er

Criticis,s
>*t$oug$ =/. is a wide*0 recogniDed and used -ode*ing standard< it is fre@uent*0 criticiDed for t$e fo**owing: Standards b*oat +ertrand /e0er< in a satirica* essa0 fra-ed as a student4s re@uest for a grade c$ange< a,,arent*0 criticiDed =/. as of 1&&2 for being unre*ated to object-oriented software de"e*o,-entG a disc*ai-er was added *ater ,ointing out t$at $is co-,an0 ne"ert$e*ess su,,orts =/. J1'W !"ar Iacobson< a co-arc$itect of =/.< said t$at objections to =/. 2 04s siDe were "a*id enoug$ to consider t$e a,,*ication of inte**igent agents to t$e ,rob*e- J15W !t contains -an0 diagra-s and constructs t$at are redundant or infre@uent*0 used %rob*e-s in *earning and ado,ting #$e ,rob*e-s cited in t$is section -a?e *earning and ado,ting =/. ,rob*e-atic< es,ecia**0 w$en re@uired of engineers *ac?ing t$e ,rere@uisite s?i**s J1(W !n ,ractice< ,eo,*e often draw diagra-s wit$ t$e s0-bo*s ,ro"ided b0 t$eir C>SE too*< but wit$out t$e -eanings t$ose s0-bo*s are intended to ,ro"ide Si-,*e user narrati"es e g Hw$at ! do at wor? H $a"e s$own to be -uc$ si-,*er to record and -ore i--ediate*0 usefu* .inguistic inco$erence #$e standards $a"e been cited as being a-biguous and inconsistent J12WJ1)WJ1&W #$e =/. 2 0 standard sti** suffers -an0 issues J20WJ21W Ca,abi*ities of =/. and i-,*e-entation *anguage -is-atc$ #0,ica* of ot$er notationa* s0ste-s< =/. is ab*e to re,resent so-e s0ste-s -ore concise*0 or efficient*0 t$an ot$ers #$us a de"e*o,er gra"itates toward so*utions t$at reside at t$e intersection of t$e ca,abi*ities of =/. and t$e i-,*e-entation *anguage #$is ,rob*e- is ,articu*ar*0 ,ronounced if t$e i-,*e-entation *anguage does not ad$ere to ort$odo1 object-oriented doctrine< since t$e intersection set between =/. and i-,*e-entation *anguage -a0 be t$at -uc$ s-a**er 80sfunctiona* interc$ange for-at 3$i*e t$e T/! (T/. /etadata !nterc$ange) standard is designed to faci*itate t$e interc$ange of =/. -ode*s< it $as been *arge*0 ineffecti"e in t$e ,ractica* interc$ange of =/. 2 1 -ode*s #$is intero,erabi*it0 ineffecti"eness is attributab*e to se"era* reasons Airst*0< T/! 2 1 is *arge and co-,*e1 in its own rig$t< since it ,ur,orts to address a tec$nica* ,rob*e- -ore a-bitious t$an e1c$anging =/. 2 1 -ode*s !n ,articu*ar< it atte-,ts to ,ro"ide a -ec$anis- for faci*itating t$e e1c$ange of an0 arbitrar0 -ode*ing *anguage defined b0 t$e O/74s /eta-Object Aaci*it0 (/OA) Second*0< t$e =/. 2 1 8iagra- !nterc$ange s,ecification *ac?s sufficient detai* to faci*itate re*iab*e interc$ange of =/. 2 1 notations between -ode*ing too*s Since =/. is a "isua* -ode*ing *anguage< t$is s$ortco-ing is substantia* for -ode*ers w$o don4t want to redraw t$eir diagra-s J1W #$is s$ortco-ing is being addressed b0 t$e 8iagra- 8efinition O/7 ,roject - &' -

Course Notes: for w$ic$ a ,ro,osed standard is a*read0 a"ai*ab*e J22WJnot in citation givenW Cardina*it0 Notation >s wit$ database E5 diagra-s< c*ass -ode*s are s,ecified to use H*oo?-acrossH cardina*ities< e"en t$oug$ se"era* aut$ors (/erise<J23W E*-asri 9 Na"at$e J2'W a-ongst ot$ers J25W) ,refer sa-eside or H*oo?-$ereH for ro*es and bot$ -ini-u- and -a1i-u- cardina*ities 5ecent researc$ers (Aeinerer<J2(W 8u**ea et a*ia J22W) $a"e s$own t$at t$e H*oo?-acrossH tec$ni@ue used b0 =/. and E5 diagra-s is *ess effecti"e and *ess co$erent w$en a,,*ied to n-ar0 re*ations$i,s of order _2 !n Aeinerer it sa0s H%rob*e-s arise if we o,erate under t$e *oo?-across se-antics as used for =/. associations ;art-ann J2)W in"estigates t$is situation and s$ows $ow and w$0 different transfor-ations fai* H ( lthough the ;reduction; mentioned is s!urious as the two diagrams 7%< and 7%5 are in fact the same) and a*so H>s we wi** see on t$e ne1t few ,ages< t$e *oo?-across inter,retation introduces se"era* difficu*ties w$ic$ ,re"ent t$e e1tension of si-,*e -ec$anis-s fro- binar0 to n-ar0 associations H E1c*usi"e #$e ter- H=nifiedH a,,*ies on*0 to t$e unification of t$e -an0 ,rior e1isting and co-,eting Object Orientated *anguages !-,ortant we** ?nown and ,o,u*ar tec$ni@ues< a*-ost uni"ersa**0 used in industr0< suc$ as 8ata A*ow 8iagra-s and Structure C$arts were not inc*uded in t$e s,ecification /ode*ing e1,erts $a"e written criticis-s of =/.< inc*uding +rian ;enderson-Se**ers and Cesar 7onDa*eD-%ereD in H=ses and >buses of t$e Stereot0,e /ec$anis- in =/. 1 1 and 2 0H J2&W

;.- ,odeling tools


#$e -ost we**-?nown =/. -ode*ing too* is !+/ 5ationa* 5ose Ot$er too*s inc*ude< in a*,$abetica* order< >rgo=/.< +O=/.< 8ia< Enter,rise >rc$itect< /agic8raw =/.< /ode*io< %ower8esigner< 5ationa* 5$a,sod0< 5ationa* Software >rc$itect< Star=/. and =-bre**o So-e of t$e ,o,u*ar de"e*o,-ent en"iron-ents a*so offer =/. -ode*ing too*s< e g : Ec*i,se< Net+eans< and :isua* Studio

Class diagra,s
!n software engineering< a class diagram in t$e =nified /ode*ing .anguage (=/.) is a t0,e of static structure diagra- t$at describes t$e structure of a s0ste- b0 s$owing t$e s0ste-4s c*asses< t$eir attributes< o,erations (or -et$ods)< and t$e re*ations$i,s a-ong t$e c*asses Overview

- &5 -

Object-Oriented Software Engineering (CS350)

;ierarc$0 of =/. 2 0 8iagra-s< s$own as a c*ass diagra- #$e indi"idua* c*asses are re,resented just wit$ one co-,art-ent< but t$e0 often contain u, to t$ree co-,art-ents #$e c*ass diagra- is t$e -ain bui*ding b*oc? of object oriented -ode**ing !t is used bot$ for genera* conce,tua* -ode**ing of t$e s0ste-atics of t$e a,,*ication< and for detai*ed -ode**ing trans*ating t$e -ode*s into ,rogra--ing code C*ass diagra-s can a*so be used for data -ode*ing J1W #$e c*asses in a c*ass diagra- re,resent bot$ t$e -ain objects< interactions in t$e a,,*ication and t$e c*asses to be ,rogra--ed

> c*ass wit$ t$ree sections !n t$e diagra-< c*asses are re,resented wit$ bo1es w$ic$ contain t$ree ,arts:J2W #$e u,,er ,art $o*ds t$e na-e of t$e c*ass #$e -idd*e ,art contains t$e attributes of t$e c*ass #$e botto- ,art gi"es t$e -et$ods or o,erations t$e c*ass can ta?e or underta?e !n t$e design of a s0ste-< a nu-ber of c*asses are identified and grou,ed toget$er in a c*ass diagraw$ic$ $e*,s to deter-ine t$e static re*ations between t$ose objects 3it$ detai*ed -ode*ing< t$e c*asses of t$e conce,tua* design are often s,*it into a nu-ber of subc*asses !n order to furt$er describe t$e be$a"ior of s0ste-s< t$ese c*ass diagra-s can be co-,*e-ented b0 state diagra- or =/. state -ac$ine >*so instead of c*ass diagra-s Object ro*e -ode*ing can be used if 0ou just want to -ode* t$e c*asses and t$eir re*ations$i,s J2W Members =/. ,ro"ides -ec$anis-s to re,resent c*ass -e-bers< suc$ as attributes and -et$ods< and additiona* infor-ation about t$e8isibilit/ #o s,ecif0 t$e "isibi*it0 of a c*ass -e-ber (i e < an0 attribute or -et$od) t$ese are t$e fo**owing notations t$at -ust be ,*aced before t$e -e-ber4s na-e J3W: >** t$e :isibi*it0 of a C*ass /e-bers >re:

- &( -

Course Notes:
+ # ~ / underline Public Private Protected Package Derived Static

Sco+e #$e =/. s,ecifies two t0,es of sco,e for -e-bers: instance and c*assifier J'W C*assifier -e-bers are co--on*0 recogniDed as HstaticH in -an0 ,rogra--ing *anguages !n t$e case of instance -e-bers< t$e sco,e is a s,ecific instance Aor attributes< it -eans t$at its "a*ue can "ar0 between instances Aor -et$ods< it -eans t$at its in"ocation affects t$e instance state< in ot$er words< affects t$e instance attributes Ot$erwise< in t$e c*assifier -e-ber< t$e sco,e is t$e c*ass Aor attributes< it -eans t$at its "a*ue is e@ua* for a** instances Aor -et$ods< it -eans t$at its in"ocation does not affect t$e instance state #o indicate t$at a -e-ber $as t$e c*assifier sco,e< its na-e -ust be under*ined Ot$erwise< as defau*t< t$e instance sco,e is considered +elationships > re*ations$i, is a genera* ter- co"ering t$e s,ecific t0,es of *ogica* connections found on c*ass and object diagra-s =/. s$ows t$e fo**owing re*ations$i,s: "nstance le#el relations$i+s E0ternal lin7s > :in& is t$e basic re*ations$i, a-ong objects <ssociation

C*ass diagra- e1a-,*e of association between two c*asses >n association re,resents a fa-i*0 of *in?s +inar0 associations (wit$ two ends) are nor-a**0 re,resented as a *ine >n association can be na-ed< and t$e ends of an association can be adorned wit$ ro*e na-es< owners$i, indicators< -u*ti,*icit0< "isibi*it0< and ot$er ,ro,erties #$ere are four different t0,es of association: bi-directiona*< uni-directiona*< >ggregation (inc*udes Co-,osition aggregation) and 5ef*e1i"e +i-directiona* and uni-directiona* associations are t$e -ost co--on ones Aor instance< a f*ig$t c*ass is associated wit$ a ,*ane c*ass bi-directiona**0 >ssociation re,resents t$e static re*ations$i, s$ared a-ong t$e objects of two c*asses E1a-,*e: Hde,art-ent offers coursesH< is an association re*ation

- &2 -

Object-Oriented Software Engineering (CS350) <ggregation

C*ass diagra- s$owing >ggregation between two c*asses ggregation is a "ariant of t$e H$as aH or association re*ations$i,G aggregation is -ore s,ecific t$an association !t is an association t$at re,resents a ,art-w$o*e or ,art-of re*ations$i, >s a t0,e of association< an aggregation can be na-ed and $a"e t$e sa-e adorn-ents t$at an association can ;owe"er< an aggregation -a0 not in"o*"e -ore t$an two c*asses ggregation can occur w$en a c*ass is a co**ection or container of ot$er c*asses< but w$ere t$e contained c*asses do not $a"e a strong life cycle de!endency on t$e containerXessentia**0< if t$e container is destro0ed< its contents are not !n =/.< it is gra,$ica**0 re,resented as a hollow dia-ond s$a,e on t$e containing c*ass end of t$e tree wit$ *ines t$at connect contained c*asses to t$e containing c*ass Co,+osition

C*ass diagra- s$owing Co-,osition between two c*asses at to, and >ggregation between two c*asses at botto.om!osition is a stronger "ariant of t$e Howns aH or association re*ations$i,G co-,osition is -ore s,ecific t$an aggregation .om!osition usua**0 $as a strong life cycle de!endency between instances of t$e container c*ass and instances of t$e contained c*ass(es): !f t$e container is destro0ed< nor-a**0 e"er0 instance t$at it contains is destro0ed as we** (Note t$at< w$ere a**owed< a ,art can be re-o"ed fro- a co-,osite before t$e co-,osite is de*eted< and t$us not be de*eted as ,art of t$e co-,osite ) 3it$ co-,osition (aggregation)< an arrow ,oints to t$e contained c*ass< and t$e b*ac? dia-ond ,oints towards t$e container c*ass #$e =/. gra,$ica* re,resentation of a co-,osition re*ations$i, is a filled dia-ond s$a,e on t$e containing c*ass end of t$e tree of *ines t$at connect contained c*ass(es) to t$e containing c*ass 6ifferences between co,+osition and aggregation 3$en atte-,ting to re,resent rea*-wor*d w$o*e-,art re*ations$i,s< e g < an engine is a ,art of a car< t$e co-,osition re*ations$i, is -ost a,,ro,riate ;owe"er< w$en re,resenting a software or database re*ations$i,< e g < car -ode* engine EN701 is ,art of a car -ode* C/01< an aggregation re*ations$i, is best< as t$e engine< EN701 -a0 be a*so ,art of a different car -ode* #$us t$e aggregation re*ations$i, is often ca**ed Hcata*ogH contain-ent to distinguis$ it fro- co-,osition4s H,$0sica*H contain-ent

- &) -

Course Notes: #$e w$o*e of a co-,osition -ust $a"e a -u*ti,*icit0 of 0 1 or 1< indicating t$at a ,art -ust be*ong to on*0 one w$o*eG t$e ,art -a0 $a"e an0 -u*ti,*icit0 Aor e1a-,*e< consider =ni"ersit0 and 8e,art-ent c*asses > de,art-ent be*ongs to on*0 one uni"ersit0< so =ni"ersit0 $as -u*ti,*icit0 1 in t$e re*ations$i, > uni"ersit0 can (and wi** *i?e*0) $a"e -u*ti,*e de,art-ents< so 8e,art-ent $as -u*ti,*icit0 1 \ Class le#el relations$i+s 5enerali=ation

C*ass diagra- s$owing genera*iDation between one su,erc*ass and two subc*asses #$e 7enera*iDation re*ations$i, (His aH) indicates t$at one of t$e two re*ated c*asses (t$e subclass) is considered to be a s,ecia*iDed for- of t$e ot$er (t$e su!er ty!e) and su,erc*ass is considered as 4Generalization' of subc*ass !n ,ractice< t$is -eans t$at an0 instance of t$e subt0,e is a*so an instance of t$e su,erc*ass >n e1e-,*ar0 tree of genera*iDations of t$is for- is found in bino-ia* no-enc*ature: $u-an beings are a subc*ass of si-ian< w$ic$ are a subc*ass of -a--a*< and so on #$e re*ations$i, is -ost easi*0 understood b0 t$e ,$rase 4an > is a +4 (a $u-an is a -a--a*< a mammal is an ani-a*) #$e =/. gra,$ica* re,resentation of a 7enera*iDation is a $o**ow triang*e s$a,e on t$e su,erc*ass end of t$e *ine (or tree of *ines) t$at connects it to one or -ore subt0,es #$e genera*iDation re*ations$i, is a*so ?nown as t$e inheritance or ;is a; re*ations$i, #$e su!erclass(base c*ass) in t$e genera*iDation re*ations$i, is a*so ?nown as t$e ;!arent;< su!erclass< base class< or base ty!e #$e subty!e in t$e s,ecia*iDation re*ations$i, is a*so ?nown as t$e ;child;< subclass< derived class< derived ty!e< inheriting class< or inheriting ty!e Note t$at t$is re*ations$i, bears no rese-b*ance to t$e bio*ogica* ,arentFc$i*d re*ations$i,: t$e use of t$ese ter-s is e1tre-e*0 co--on< but can be -is*eading >n e-,t0 arrow t$at ,oints fro- t$e subc*ass towards t$e su,er c*ass de,icts t$e genera*iDation re*ations$i, 7enera*iDation-S,ecia*iDation re*ations$i, > is a t0,e of + E g Han oa? is a t0,e of treeH< Han auto-obi*e is a t0,e of "e$ic*eH 7enera*iDation can on*0 be s$own on c*ass diagra-s and on =se case diagra-s 3eali=ation - && -

Object-Oriented Software Engineering (CS350) !n =/. -ode*ing< a rea*iDation re*ations$i, is a re*ations$i, between two -ode* e*e-ents< in w$ic$ one -ode* e*e-ent (t$e c*ient) rea*iDes (i-,*e-ents or e1ecutes) t$e be$a"ior t$at t$e ot$er -ode* e*e-ent (t$e su,,*ier) s,ecifies > rea*iDation is indicated b0 a das$ed *ine wit$ an unfi**ed arrow$ead towards t$e su,,*ier 5ea*iDations can on*0 be s$own on c*ass or co-,onent diagra-s > rea*iDation is a re*ations$i, between c*asses< interfaces< co-,onents< and ,ac?ages t$at connects a c*ient e*e-ent wit$ a su,,*ier e*e-ent > rea*iDation re*ations$i, between c*asses and interfaces and between co-,onents and interfaces s$ows t$at t$e c*ass rea*iDes t$e o,erations offered b0 t$e interface 5eneral relations$i+

C*ass diagra- s$owing de,endenc0 between HCarH c*ass and H3$ee*H c*ass (>n e"en c*earer e1a-,*e wou*d be HCar de,ends on Aue*H< because Car a*read0 aggregates (and not just uses) 3$ee*) 6e+endenc/ 8e,endenc0 is a wea?er for- of re*ations$i, w$ic$ indicates t$at one c*ass de,ends on anot$er because it uses it at so-e ,oint of ti-e One c*ass de,ends on anot$er if t$e *atter is a ,ara-eter "ariab*e or *oca* "ariab*e of a -et$od of t$e for-er #$is is different fro- an association< w$ere an attribute of t$e for-er is an instance of t$e *atter .ulti+licit/ #$e association re*ations$i, indicates t$at (at *east) one of t$e two re*ated c*asses -a?es reference to t$e ot$er !n contrast wit$ t$e genera*iDation re*ations$i,< t$is is -ost easi*0 understood t$roug$ t$e ,$rase 4> $as a +4 (a -ot$er cat $as ?ittens< ?ittens $a"e a -ot$er cat) #$e =/. re,resentation of an association is a *ine wit$ an o,tiona* arrow$ead indicating t$e role of t$e object(s) in t$e re*ations$i,< and an o,tiona* notation at eac$ end indicating t$e multi!licity of instances of t$at entit0 (t$e nu-ber of objects t$at ,artici,ate in t$e association) 2334 4 2335 or 5 4335 No instances< or one instance (o,tiona*< -a0) E1act*0 one instance Yero or -ore instances One or -ore instances (at *east one)

%nalysis stereotypes

- 100 -

Course Notes: !n t$e ear*0 stages of a ,roject4s tec$nica* ana*0sis< c*ass diagra-s can be used to ,roduce ear*0 conce,tua* -ode*s of t$e s0ste- C*asses at t$is stage often ta?e t$e for- of boundaries< contro*s and entities and rare*0 sur"i"e into t$e design wit$out $ea"0 c$anges

*oundaries +oundar0 c*asses $and*e t$e co--unication between actors and t$e s0ste-4s interna* co-,onents #$e0 -ig$t be user interfaces< s0ste- interfaces or de"ice interfaces (for e1a-,*e) #$e0 are identified b0 eac$ actorCuse-case ,air on t$e s0ste-4s use-case diagra-< wit$ one and on*0 one boundar0 c*ass e1isting for eac$ ,air #$e0 are drawn as circ*es wit$ a s$ort *ine to t$e *eft attac$ed to a "ertica* *ine t$e sa-e $eig$t as t$e circ*e (as t$oug$ it is attac$ed to t$e side of t$e use-case s0ste- boundar0) >*ternati"e*0< t$e0 can be drawn as nor-a* c*asses wit$ t$e `boundar0a stereot0,e notation abo"e t$e c*ass na-e Entities Entit0 c*asses -ode* t$e infor-ation $and*ed b0 t$e s0ste-< and so-eti-es t$e be$a"iour associated wit$ t$e infor-ation #$e0 s$ou*d not be identified as database tab*es or ot$er data-stores #$e0 are drawn as circ*es wit$ a s$ort *ine attac$ed to t$e botto- of t$e circ*e >*ternati"e*0< t$e0 can be drawn as nor-a* c*asses wit$ t$e `entit0a stereot0,e notation abo"e t$e c*ass na-e Controls Contro* c*asses $and*e t$e f*ow of contro* for a use-case and can t$erefore be seen as co-ordinating re,resentation c*asses #$ese do not do e"er0t$ing in t$e use case< but co-ordinate wit$ ot$er c*asses t$at can do t$e wor? for t$e-

Ob'ect diagrams
>n object diagram in t$e =nified /ode*ing .anguage (=/.)< is a diagra- t$at s$ows a co-,*ete or ,artia* "iew of t$e structure of a -ode*ed s0ste- at a s,ecific ti-e

- 101 -

Object-Oriented Software Engineering (CS350) >n Object diagra- focuses on so-e ,articu*ar set of object instances and attributes< and t$e *in?s between t$e instances > corre*ated set of object diagra-s ,ro"ides insig$t into $ow an arbitrar0 "iew of a s0ste- is e1,ected to e"o*"e o"er ti-e Object diagra-s are -ore concrete t$an c*ass diagra-s< and are often used to ,ro"ide e1a-,*es< or act as test cases for t$e c*ass diagra-s On*0 t$ose as,ects of a -ode* t$at are of current interest need be s$own on an object diagra-

Ob'ect diagram topics "nstance s+ecifications


Eac$ object and *in? on an object diagra- is re,resented b0 an *nstanceS!ecification #$is can s$ow an object4s c*assifier (e g an abstract or concrete c*ass) and instance na-e< as we** as attributes and ot$er structura* features using slots Eac$ slot corres,onds to a sing*e attribute or feature< and -a0 inc*ude a "a*ue for t$at entit0 #$e na-e on an instance s,ecification o,tiona**0 s$ows an instance na-e< a 4:4 se,arator< and o,tiona**0 one or -ore c*assifier na-es se,arated b0 co--as #$e contents of s*ots< if an0< are inc*uded be*ow t$e na-es< in a se,arate attribute co-,art-ent > *in? is s$own as a so*id *ine< and re,resents an instance of an association

Object diagra, e0a,+le

!nitia**0< w$en n[2< and f(n-2) [ 0< and f(n-1) [ 1< t$en f(n) [ 0 B 1 [ 1 >s an e1a-,*e< consider one ,ossib*e wa0 of -ode*ing ,roduction of t$e Aibonacci se@uence !n t$e first =/. object diagra- on t$e rig$t< t$e instance in t$e *eft-ost instance s,ecification is na-ed v=< $as *nde!endent>ariable as its c*assifier< ,*a0s t$e NMinus2 ro*e wit$in t$e )ibonacciSystem< and $as a s*ot for t$e val attribute wit$ a "a*ue of ? #$e second object is na-ed v2< is of c*ass *nde!endent>ariable< ,*a0s t$e NMinus= ro*e< and $as val 5 = #$e ,e!endent>ariable object is na-ed v7< and ,*a0s t$e N ro*e #$e to,-ost instance< an anon0-ous instance s,ecification< $as )ibonacci)unction as its c*assifier< and -a0 $a"e an instance na-e< a ro*e< and s*ots< but t$ese are not s$own $ere #$e diagra- a*so inc*udes t$ree na-ed *in?s< s$own as *ines .in?s are instances of an association

>fter t$e first iteration< w$en n [ 3< and f(n-2) [ 1< and f(n-1) [ 1< t$en f(n) [ 1 B 1 [ 2 !n t$e second diagra-< at a s*ig$t*0 *ater ,oint in ti-e< t$e *nde!endent>ariable and ,e!endent>ariable objects are t$e sa-e< but t$e s*ots for t$e val attribute $a"e different "a*ues #$e ro*e na-es are not s$own $ere

- 102 -

Course Notes:

>fter se"era* -ore iterations< w$en n [ 2< and f(n-2) [ 5< and f(n-1) [ )< t$en f(n) [ 5 B ) [ 13 !n t$e *ast object diagra-< a sti** *ater sna,s$ot< t$e sa-e t$ree objects are in"o*"ed #$eir s*ots $a"e different "a*ues #$e instance and ro*e na-es are not s$own $ere

;sage
!f 0ou are using a =/. -ode*ing too*< 0ou wi** t0,ica**0 draw object diagra-s using so-e ot$er diagra- t0,e< suc$ as on a c*ass diagra- >n object instance -a0 be ca**ed an instance s!ecification or just an instance > *in? between instances is genera**0 referred to as a lin& Ot$er =/. entities< suc$ as an aggregation or co-,osition s0-bo* (a dia-ond) -a0 a*so a,,ear on an object diagra-

State transition diagrams


#$e state diagram in t$e =nified /ode*ing .anguage is essentia**0 a ;are* statec$art wit$ standardiDed notationJ1W <J2W w$ic$ can describe -an0 s0ste-s< fro- co-,uter ,rogra-s to business ,rocesses !n =/. 2 t$e na-e $as been c$anged to State Machine ,iagram #$e fo**owing are t$e basic notationa* e*e-ents t$at can be used to -a?e u, a diagra-: Ai**ed circ*e< ,ointing to t$e initia* state ;o**ow circ*e containing a s-a**er fi**ed circ*e< indicating t$e fina* state (if an0) 5ounded rectang*e< denoting a state #o, of t$e rectang*e contains a na-e of t$e state Can contain a $oriDonta* *ine in t$e -idd*e< be*ow w$ic$ t$e acti"ities t$at are done in t$at state are indicated >rrow< denoting transition #$e na-e of t$e e"ent (if an0) causing t$is transition *abe*s t$e arrow bod0 > guard e1,ression -a0 be added before a HFH and enc*osed in s@uare-brac?ets ( eventName6guardExpression7 )< denoting t$at t$is e1,ression -ust be true for t$e transition to ta?e ,*ace !f an action is ,erfor-ed during t$is transition< it is added to t$e *abe* fo**owing a HFH ( eventName6guardExpression7"action ) #$ic? $oriDonta* *ine wit$ eit$er 1_1 *ines entering and 1 *ine *ea"ing or 1 *ine entering and 1_1 *ines *ea"ing #$ese denote joinFfor?< res,ecti"e*0

Pac/age diagrams
> pac*age diagram in t$e =nified /ode*ing .anguage de,icts t$e de,endencies between t$e ,ac?ages t$at -a?e u, a -ode*

O#er#iew
!n addition to t$e standard =/. 8e,endenc0 re*ations$i,< t$ere are two s,ecia* t0,es of de,endencies defined between ,ac?ages: ,ac?age i-,ort - 103 -

Object-Oriented Software Engineering (CS350) ,ac?age -erge > !ac&age im!ort is Ha re*ations$i, between an i-,orting na-es,ace and a ,ac?age< indicating t$at t$e i-,orting na-es,ace adds t$e na-es of t$e -e-bers of t$e ,ac?age to its own na-es,ace H J1W +0 defau*t< an un*abe*ed de,endenc0 between two ,ac?ages is inter,reted as a ,ac?age i-,ort re*ations$i, !n t$is re*ations$i, e*e-ents wit$in t$e target ,ac?age wi** be i-,orted in source ,ac?age > !ac&age merge is Ha directed re*ations$i, between two ,ac?ages< t$at indicates t$at t$e contents of t$e two ,ac?ages are to be co-bined !t is "er0 si-i*ar to 7enera*iDation in t$e sense t$at t$e source e*e-ent conce,tua**0 adds t$e c$aracteristics of t$e target e*e-ent to its own c$aracteristics resu*ting in an e*e-ent t$at co-bines t$e c$aracteristics of bot$HJ2W

%ac?ages containing use cases !n t$is re*ations$i, if an e*e-ent e1ists wit$in source e*e-ent4s definition and target a*so t$en t$e source e*e-ent4s definition4s wi** be e1,anded to inc*ude target e*e-ent4s definitions it4s different fro- a c*ass diagra-

Ele,ents
1 %ac?age: !t is a genera* ,ur,ose -ec$anis- for organiDing -ode* e*e-ents 9 diagra-s into grou,s !t ,ro"ides an enca,su*ated na-es,ace wit$in w$ic$ a** t$e na-es -ust be uni@ue !t is used to grou, se-antica**0 re*ated e*e-ents !t is a na-es,ace as we** as an e*e-ent t$at can be contained in ot$er ,ac?age4s na-es,aces 2 C*ass: !t is a re,resentation of objects< t$at ref*ects t$eir structure and be$a"ior wit$in t$e s0ste- !t is a te-,*ate fro- w$ic$ actua**0 running instances are created C*asses usua**0 describe *ogica* structure of s0ste3 !nterface: !t is a s,ecification of be$a"ior !-,*e-enting c*asses of an interface c*ass are re@uired to su,,ort t$e be$a"ior ' Object: !t is an instance of c*ass !t is often used in ana*0sis to re,resent nu-erous artifacts and ite-s t$at e1ist 5 #ab*e: !t is a stereot0,ed c*ass

;sage
%ac?age diagra-s can use ,ac?ages containing use cases to i**ustrate t$e functiona*it0 of a software - 10' -

Course Notes: s0ste%ac?age diagra-s can use ,ac?ages t$at re,resent t$e different *a0ers of a software s0ste- to i**ustrate t$e *a0ered arc$itecture of a software s0ste- #$e de,endencies between t$ese ,ac?ages can be adorned wit$ *abe*s F stereot0,es to indicate t$e co--unication -ec$anis- between t$e *a0ers

- 105 -

Object-Oriented Software Engineering (CS350)

(! 3e>uire,ents engineering +rocesses


*easibility study
'easibility studies ai- to objecti"e*0 and rationa**0 unco"er t$e strengt$s and wea?nesses of an e1isting business or ,ro,osed "enture< o,,ortunities and t$reats as ,resented b0 t$e en"iron-ent< t$e resources re@uired to carr0 t$roug$< and u*ti-ate*0 t$e ,ros,ects for success J1WJ2W !n its si-,*est ter-s< t$e two criteria to judge feasibi*it0 are cost re@uired and "a*ue to be attained J3W >s suc$< a we**designed feasibi*it0 stud0 s$ou*d ,ro"ide a $istorica* bac?ground of t$e business or ,roject< descri,tion of t$e ,roduct or ser"ice< accounting state-ents< detai*s of t$e o,erations and -anage-ent< -ar?eting researc$ and ,o*icies< financia* data< *ega* re@uire-ents and ta1 ob*igations J1W 7enera**0< feasibi*it0 studies ,recede tec$nica* de"e*o,-ent and ,roject i-,*e-entation

Fi#e co,,on factors


#$e acron0- #E.OS refers to t$e fi"e areas of feasibi*it0 - #ec$nica*< Econo-ic< .ega*< O,erationa*< and Sc$edu*ing

ec$nolog/ and s/ste, feasibilit/


#$e assess-ent is based on an out*ine design of s0ste- re@uire-ents in ter-s of !n,ut< %rocesses< Out,ut< Aie*ds< %rogra-s< and %rocedures #$is can be @uantified in ter-s of "o*u-es of data< trends< fre@uenc0 of u,dating< etc in order to esti-ate w$et$er t$e new s0ste- wi** ,erfor- ade@uate*0 or not #ec$no*ogica* feasibi*it0 is carried out to deter-ine w$et$er t$e co-,an0 $as t$e ca,abi*it0< in ter-s of software< $ardware< ,ersonne* and e1,ertise< to $and*e t$e co-,*etion of t$e ,roject 3$en writing a feasibi*it0 re,ort t$e fo**owing s$ou*d be ta?en to consideration: > brief descri,tion of t$e business to assess -ore ,ossib*e factorFs w$ic$ cou*d affect t$e stud0 #$e ,art of t$e business being e1a-ined #$e $u-an and econo-ic factor #$e ,ossib*e so*utions to t$e ,rob*e-s

>t t$is *e"e*< t$e concern is w$et$er t$e ,ro,osa* is bot$ technically and legally feasib*e (assu-ing -oderate cost) Economic feasibility Econo-ic ana*0sis is t$e -ost fre@uent*0 used -et$od for e"a*uating t$e effecti"eness of a new s0ste/ore co--on*0 ?nown as costFbenefit ana*0sis< t$e ,rocedure is to deter-ine t$e benefits and sa"ings t$at are e1,ected fro- a candidate s0ste- and co-,are t$e- wit$ costs !f benefits outweig$ costs< t$en t$e decision is -ade to design and i-,*e-ent t$e s0ste- >n entre,reneur -ust accurate*0 weig$ t$e cost "ersus benefits before ta?ing an action Cost-based stud0: !t is i-,ortant to identif0 cost and benefit factors< w$ic$ can be categoriDed as - 10( -

Course Notes: fo**ows: 1 8e"e*o,-ent costsG and 2 O,erating costs #$is is an ana*0sis of t$e costs to be incurred in t$e s0ste- and t$e benefits deri"ab*e out of t$e s0ste#i-e-based stud0: #$is is an ana*0sis of t$e ti-e re@uired to ac$ie"e a return on in"est-ents #$e future "a*ue of a ,roject is a*so a factor 1egal feasibility 8eter-ines w$et$er t$e ,ro,osed s0ste- conf*icts wit$ *ega* re@uire-ents< e g a data ,rocessing s0ste- -ust co-,*0 wit$ t$e *oca* 8ata %rotection >cts Operational feasibility O,erationa* feasibi*it0 is a -easure of $ow we** a ,ro,osed s0ste- so*"es t$e ,rob*e-s< and ta?es ad"antage of t$e o,,ortunities identified during sco,e definition and $ow it satisfies t$e re@uire-ents identified in t$e re@uire-ents ana*0sis ,$ase of s0ste- de"e*o,-ent J'W Schedule feasibility > ,roject wi** fai* if it ta?es too *ong to be co-,*eted before it is usefu* #0,ica**0 t$is -eans esti-ating $ow *ong t$e s0ste- wi** ta?e to de"e*o,< and if it can be co-,*eted in a gi"en ti-e ,eriod using so-e -et$ods *i?e ,a0bac? ,eriod Sc$edu*e feasibi*it0 is a -easure of $ow reasonab*e t$e ,roject ti-etab*e is 7i"en our tec$nica* e1,ertise< are t$e ,roject dead*ines reasonab*e6 So-e ,rojects are initiated wit$ s,ecific dead*ines Pou need to deter-ine w$et$er t$e dead*ines are -andator0 or desirab*e

Ot$er feasibilit/ factors


Mar/et and real estate feasibility /ar?et feasibi*it0 studies t0,ica**0 in"o*"e testing geogra,$ic *ocations for a rea* estate de"e*o,-ent ,roject< and usua**0 in"o*"e ,arce*s of rea* estate *and 8e"e*o,ers often conduct -ar?et studies to deter-ine t$e best *ocation wit$in a jurisdiction< and to test a*ternati"e *and uses for gi"en ,arce*s Iurisdictions often re@uire de"e*o,ers to co-,*ete feasibi*it0 studies before t$e0 wi** a,,ro"e a ,er-it a,,*ication for retai*< co--ercia*< industria*< -anufacturing< $ousing< office or -i1ed-use ,roject /ar?et Aeasibi*it0 ta?es into account t$e i-,ortance of t$e business in t$e se*ected area +esource feasibility #$is in"o*"es @uestions suc$ as $ow -uc$ ti-e is a"ai*ab*e to bui*d t$e new s0ste-< w$en it can be bui*t< w$et$er it interferes wit$ nor-a* business o,erations< t0,e and a-ount of resources re@uired< de,endencies< Cultural feasibility !n t$is stage< t$e ,roject4s a*ternati"es are e"a*uated for t$eir i-,act on t$e *oca* and genera* cu*ture - 102 -

Object-Oriented Software Engineering (CS350) Aor e1a-,*e< en"iron-enta* factors need to be considered and t$ese factors are to be we** ?nown Aurt$er an enter,rise4s own cu*ture can c*as$ wit$ t$e resu*ts of t$e ,roject *inancial feasibility !n case of a new ,roject<financia* "iabi*it0 can be judged on t$e fo**owing ,ara-eters: #ota* esti-ated cost of t$e ,roject Ainancing of t$e ,roject in ter-s of its ca,ita* structure< debt e@uit0 ratio and ,ro-oter4s s$are of tota* cost E1isting in"est-ent b0 t$e ,ro-oter in an0 ot$er business %rojected cas$ f*ow and ,rofitabi*it0

Out+ut
#$e feasibi*it0 stud0 out,uts t$e feasibility study report< a re,ort detai*ing t$e e"a*uation criteria< t$e stud0 findings< and t$e reco--endations J5W

Elicitation ) analysis
!n re@uire-ents engineering< re#uirements elicitation is t$e ,ractice of co**ecting t$e re@uire-ents of a s0ste- fro- users< custo-ers and ot$er sta?e$o*ders J1W #$e ,ractice is a*so so-eti-es referred to as re#uirements gathering #$e ter- e*icitation is used in boo?s and researc$ to raise t$e fact t$at good re@uire-ents can not just be co**ected fro- t$e custo-er< as wou*d be indicated b0 t$e na-e re@uire-ents gat$ering 5e@uire-ents e*icitation is non-tri"ia* because 0ou can ne"er be sure 0ou get a** re@uire-ents fro- t$e user and custo-er b0 just as?ing t$e- w$at t$e s0ste- s$ou*d do 5e@uire-ents e*icitation ,ractices inc*ude inter"iews< @uestionnaires< user obser"ation< wor?s$o,s< brain stor-ing< use cases< ro*e ,*a0ing and ,rotot0,ing +efore re@uire-ents can be ana*0Ded< -ode*ed< or s,ecified t$e0 -ust be gat$ered t$roug$ an e*icitation ,rocess 5e@uire-ents e*icitation is a ,art of t$e re@uire-ents engineering ,rocess< usua**0 fo**owed b0 ana*0sis and s,ecification of t$e re@uire-ents Co--on*0 used e*icitation ,rocesses are t$e sta?e$o*der -eetings or inter"iews Aor e1a-,*e< an i-,ortant first -eeting cou*d be between software engineers and custo-ers w$ere t$e0 discuss t$eir ,ers,ecti"e of t$e re@uire-ents

%roble,s
!n 1&&2< C$riste* and Sang identified ,rob*e-s t$at indicate t$e c$a**enges for re@uire-ents e*icitation: J2W 1 roblems of scope #$e boundar0 of t$e s0ste- is i**-defined or t$e custo-ersFusers s,ecif0 unnecessar0 tec$nica* detai* t$at -a0 confuse< rat$er t$an c*arif0< o"era** s0ste- objecti"es

- 10) -

Course Notes: 2 roblems of understanding #$e custo-ersFusers are not co-,*ete*0 sure of w$at is needed< $a"e a ,oor understanding of t$e ca,abi*ities and *i-itations of t$eir co-,uting en"iron-ent< donOt $a"e a fu** understanding of t$e ,rob*e- do-ain< $a"e troub*e co--unicating needs to t$e s0ste- engineer< o-it infor-ation t$at is be*ie"ed to be Qob"ious<R s,ecif0 re@uire-ents t$at conf*ict wit$ t$e needs of ot$er custo-ersFusers< or s,ecif0 re@uire-ents t$at are a-biguous or untestab*e 3 roblems of volatility #$e re@uire-ents c$ange o"er ti-e #$e rate of c$ange is so-eti-es referred to as t$e *e"e* of re@uire-ent "o*ati*it0

5uidelines
!n 1&&2< So--er"i**e and Saw0er suggested a set of guide*ines for re@uire-ents e*icitation< to address concerns suc$ as t$ose identified b0 C$riste* and Sang:J3W >ssess t$e business and tec$nica* feasibi*it0 for t$e ,ro,osed s0ste !dentif0 t$e ,eo,*e w$o wi** $e*, s,ecif0 re@uire-ents and understand t$eir organiDationa* bias 8efine t$e tec$nica* en"iron-ent (e g < co-,uting arc$itecture< o,erating s0ste-< te*eco--unications needs) into w$ic$ t$e s0ste- or ,roduct wi** be ,*aced !dentif0 Hdo-ain constraintsH (i e < c$aracteristics of t$e business en"iron-ent s,ecific to t$e a,,*ication do-ain) t$at *i-it t$e functiona*it0 or ,erfor-ance of t$e s0ste- or ,roduct to be bui*t 8efine one or -ore re@uire-ents e*icitation -et$ods (e g < inter"iews< focus grou,s< tea-eetings) So*icit ,artici,ation fro- -an0 ,eo,*e so t$at re@uire-ents are defined fro- different ,oints of "iewG be sure to identif0 t$e rationa*e for eac$ re@uire-ent t$at is recorded !dentif0 a-biguous re@uire-ents as candidates for ,rotot0,ing Create usage scenarios or use cases to $e*, custo-ersFusers better identif0 ?e0 re@uire-ents

Se>uence of ste+s
!n 200'< 7o*ds-it$ suggested a H,rob*e- ,0ra-idH of Hsi1 ste,s w$ic$ -ust be ,erfor-ed in se@uenceH:J'W 1 2 3 ' !dentif0 t$e rea* ,rob*e-< o,,ortunit0 or c$a**enge !dentif0 t$e current -easure(s) w$ic$ s$ow t$at t$e ,rob*e- is rea* !dentif0 t$e goa* -easure(s) to s$ow t$e ,rob*e- $as been addressed and t$e "a*ue of -eeting it !dentif0 t$e Has-isH cause(s) of t$e ,rob*e-< as it is t$e causes t$at -ust be so*"ed< not t$e ,rob*e- direct*0 5 8efine t$e business Hw$atsH t$at -ust be de*i"ered to -eet t$e goa* -easure(s) ( S,ecif0 a ,roduct design $ow to satisf0 t$e rea* business re@uire-ents ;owe"er 7o*ds-it$ notes t$at identif0ing t$e rea* ,rob*e- His e1ceeding*0 difficu*tH J'W

Co,+le,entar/ a++roac$es
!n 200&< >*e1ander and +eus-8u?ic ,ro,osed a set of co-,*e-entar0 a,,roac$es for disco"ering - 10& -

Object-Oriented Software Engineering (CS350) re@uire-ents:J5W !dentif0ing sta?e$o*ders /ode*ing goa*s /ode*ing conte1t 8isco"ering scenarios (or =se cases) 8isco"ering H@ua*ities and constraintsH (Non-functiona* re@uire-ents) /ode*ing rationa*e and assu-,tions 3riting definitions of ter-s >na*0Ding -easure-ents (acce,tance criteria) >na*0Ding ,riorities

>*e1ander and +eus-8u?ic suggested t$at t$ese a,,roac$es cou*d be conducted wit$ indi"idua*s (as in inter"iews)< wit$ grou,s (as in focused -eetings ?nown as wor?s$o,s< or "ia E*ectronic -eeting s0ste-s)< or fro- Ht$ingsH (artifacts) suc$ as ,rotot0,es J5W

Non-functional re>uire,ents
!n 200&< /i**er ,ro,osed a batter0 of o"er 2<000 @uestions to e*icit non-functiona* re@uire-ents J(W ;er a,,roac$ is to bui*d a sta?e$o*der ,rofi*e and t$en inter"iew t$ose sta?e$o*ders e1tensi"e*0 #$e @uestions are grou,ed into t$ree sections< a** focused on user needs:J(W 1 O,eration: $ow we** does t$e s0ste- ,erfor- for dai*0 use6 2 5e"ision: $ow eas0 is it to correct errors and add functions6 3 #ransition: ;ow eas0 is it to ada,t to c$anges in t$e tec$nica* en"iron-ent6 Re#uirements analysis in s0ste-s engineering and software engineering< enco-,asses t$ose tas?s t$at go into deter-ining t$e needs or conditions to -eet for a new or a*tered ,roduct< ta?ing account of t$e ,ossib*0 conf*icting re@uire-ents of t$e "arious sta?e$o*ders< suc$ as beneficiaries or users !t is an ear*0 stage in t$e -ore genera* acti"it0 of re@uire-ents engineering w$ic$ enco-,asses a** acti"ities concerned wit$ e*iciting< ana*0Ding< docu-enting< "a*idating and -anaging software or s0stere@uire-ents J2W 5e@uire-ents ana*0sis is critica* to t$e success of a s0ste-s or software ,roject J3W #$e re@uire-ents s$ou*d be docu-ented< actionab*e< -easurab*e< testab*e< traceab*e< re*ated to identified business needs or o,,ortunities< and defined to a *e"e* of detai* sufficient for s0ste- design Overview Conce,tua**0< re@uire-ents ana*0sis inc*udes t$ree t0,es of acti"ities: E*iciting re@uire-ents: t$e tas? of identif0ing t$e "arious t0,es of re@uire-ents fro- "arious sources inc*uding ,roject docu-entation< (e g t$e ,roject c$arter or definition)< business ,rocess docu-entation< and sta?e$o*der inter"iews #$is is so-eti-es a*so ca**ed re@uire-ents gat$ering >na*0Ding re@uire-ents: deter-ining w$et$er t$e stated re@uire-ents are c*ear< co-,*ete< consistent and una-biguous< and reso*"ing an0 a,,arent conf*icts - 110 -

Course Notes: 5ecording re@uire-ents: 5e@uire-ents -a0 be docu-ented in "arious for-s< usua**0 inc*uding a su--ar0 *ist and -a0 inc*ude natura*-*anguage docu-ents< use cases< user stories< or ,rocess s,ecifications 5e@uire-ents ana*0sis can be a *ong and arduous ,rocess during w$ic$ -an0 de*icate ,s0c$o*ogica* s?i**s are in"o*"ed New s0ste-s c$ange t$e en"iron-ent and re*ations$i,s between ,eo,*e< so it is i-,ortant to identif0 a** t$e sta?e$o*ders< ta?e into account a** t$eir needs and ensure t$e0 understand t$e i-,*ications of t$e new s0ste-s >na*0sts can e-,*o0 se"era* tec$ni@ues to e*icit t$e re@uire-ents fro- t$e custo-er #$ese -a0 inc*ude t$e de"e*o,-ent of scenarios (re,resented as user stories in agi*e -et$ods)< t$e identification of use cases< t$e use of wor?,*ace obser"ation or et$nogra,$0< $o*ding inter"iews< or focus grou,s (-ore a,t*0 na-ed in t$is conte1t as re@uire-ents wor?s$o,s< or re@uire-ents re"iew sessions) and creating re@uire-ents *ists %rotot0,ing -a0 be used to de"e*o, an e1a-,*e s0ste- t$at can be de-onstrated to sta?e$o*ders 3$ere necessar0< t$e ana*0st wi** e-,*o0 a co-bination of t$ese -et$ods to estab*is$ t$e e1act re@uire-ents of t$e sta?e$o*ders< so t$at a s0stet$at -eets t$e business needs is ,roduced

+e,uirements analysis topics


Sta7e$older identification See Sta?e$o*der ana*0sis for a discussion of business uses Sta?e$o*ders (S;) are ,eo,*e or organiDations (*ega* entities suc$ as co-,anies< standards bodies) t$at $a"e a "a*id interest in t$e s0ste- #$e0 -a0 be affected b0 it eit$er direct*0 or indirect*0 > -ajor new e-,$asis in t$e 1&&0s was a focus on t$e identification of sta&eholders !t is increasing*0 recogniDed t$at sta?e$o*ders are not *i-ited to t$e organiDation e-,*o0ing t$e ana*0st Ot$er sta?e$o*ders wi** inc*ude: an0one w$o o,erates t$e s0ste- (nor-a* and -aintenance o,erators) an0one w$o benefits fro- t$e s0ste- (functiona*< ,o*itica*< financia* and socia* beneficiaries) an0one in"o*"ed in ,urc$asing or ,rocuring t$e s0ste- !n a -ass--ar?et ,roduct organiDation< ,roduct -anage-ent< -ar?eting and so-eti-es sa*es act as surrogate consu-ers (-ass--ar?et custo-ers) to guide de"e*o,-ent of t$e ,roduct organiDations w$ic$ regu*ate as,ects of t$e s0ste- (financia*< safet0< and ot$er regu*ators) ,eo,*e or organiDations o,,osed to t$e s0ste- (negati"e sta?e$o*dersG see a*so /isuse case) organiDations res,onsib*e for s0ste-s w$ic$ interface wit$ t$e s0ste- under design t$ose organiDations w$o integrate $oriDonta**0 wit$ t$e organiDation for w$o- t$e ana*0st is designing t$e s0steSta7e$older inter#iews Sta?e$o*der inter"iews are a co--on tec$ni@ue used in re@uire-ent ana*0sis #$oug$ t$e0 are genera**0 idios0ncratic in nature and focused u,on t$e ,ers,ecti"es and ,ercei"ed needs of t$e sta?e$o*der< often t$is ,ers,ecti"e deficienc0 $as t$e genera* ad"antage of obtaining a -uc$ ric$er understanding of t$e sta?e$o*der4s uni@ue business ,rocesses< decision-re*e"ant business ru*es< and ,ercei"ed needs Conse@uent*0 t$is tec$ni@ue can ser"e as a -eans of obtaining t$e $ig$*0 focused ?now*edge t$at is often not e*icited in Ioint 5e@uire-ents 8e"e*o,-ent sessions< w$ere t$e - 111 -

Object-Oriented Software Engineering (CS350) sta?e$o*der4s attention is co-,e**ed to assu-e a -ore cross-functiona* conte1t< and t$e desire to a"oid contro"ers0 -a0 *i-it t$e sta?e$o*ders wi**ingness to contribute /oreo"er< t$e in-,erson nature of t$e inter"iews ,ro"ides a -ore re*a1ed en"iron-ent w$ere *ines of t$oug$t -a0 be e1,*ored at *engt$ ?oint 3e>uire,ents 6e#elo+,ent @?36A Sessions 5e@uire-ents often $a"e cross-functiona* i-,*ications t$at are un?nown to indi"idua* sta?e$o*ders and often -issed or inco-,*ete*0 defined during sta?e$o*der inter"iews #$ese cross-functiona* i-,*ications can be e*icited b0 conducting I58 sessions in a contro**ed en"iron-ent< faci*itated b0 a trained faci*itator< w$erein sta?e$o*ders ,artici,ate in discussions to e*icit re@uire-ents< ana*0De t$eir detai*s and unco"er cross-functiona* i-,*ications > dedicated scribe and +usiness >na*0st s$ou*d be ,resent to docu-ent t$e discussion =ti*iDing t$e s?i**s of a trained faci*itator to guide t$e discussion frees t$e +usiness >na*0st to focus on t$e re@uire-ents definition ,rocess I58 Sessions are ana*ogous to Ioint >,,*ication 8esign Sessions !n t$e for-er< t$e sessions e*icit re@uire-ents t$at guide design< w$ereas t$e *atter e*icit t$e s,ecific design features to be i-,*e-ented in satisfaction of e*icited re@uire-ents Contract-st/le re>uire,ent lists One traditiona* wa0 of docu-enting re@uire-ents $as been contract st0*e re@uire-ent *ists !n a co-,*e1 s0ste- suc$ re@uire-ents *ists can run to $undreds of ,ages >n a,,ro,riate -eta,$or wou*d be an e1tre-e*0 *ong s$o,,ing *ist Suc$ *ists are "er0 -uc$ out of fa"our in -odern ana*0sisG as t$e0 $a"e ,ro"ed s,ectacu*ar*0 unsuccessfu* at ac$ie"ing t$eir ai-sG but t$e0 are sti** seen to t$is da0 Strengt$s %ro"ides a c$ec?*ist of re@uire-ents %ro"ide a contract between t$e ,roject s,onsor(s) and de"e*o,ers Aor a *arge s0ste- can ,ro"ide a $ig$ *e"e* descri,tion 1ea7nesses Suc$ *ists can run to $undreds of ,ages #$e0 are not intended to ser"e as a reader-friend*0 descri,tion of t$e desired a,,*ication Suc$ re@uire-ents *ists abstract a** t$e re@uire-ents and so t$ere is *itt*e conte1t #$e +usiness >na*0st -a0 inc*ude conte1t for re@uire-ents in acco-,an0ing design docu-entation #$is abstraction is not intended to describe $ow t$e re@uire-ents fit or wor? toget$er #$e *ist -a0 not ref*ect re*ations$i,s and de,endencies between re@uire-ents 3$i*e a *ist does -a?e it eas0 to ,rioritiDe eac$ indi"idua* ite-< re-o"ing one ite- out of conte1t can render an entire use case or business re@uire-ent use*ess #$e *ist doesn4t su,,*ant t$e need to re"iew re@uire-ents carefu**0 wit$ sta?e$o*ders in order to gain a better s$ared understanding of t$e i-,*ications for t$e design of t$e desired s0ste- F a,,*ication - 112 -

Course Notes: Si-,*0 creating a *ist does not guarantee its co-,*eteness #$e +usiness >na*0st -ust -a?e a good fait$ effort to disco"er and co**ect a substantia**0 co-,re$ensi"e *ist< and re*0 on sta?e$o*ders to ,oint out -issing re@uire-ents #$ese *ists can create a fa*se sense of -utua* understanding between t$e sta?e$o*ders and de"e*o,ersG +usiness >na*0sts are critica* to t$e trans*ation ,rocess !t is a*-ost i-,ossib*e to unco"er a** t$e functiona* re@uire-ents before t$e ,rocess of de"e*o,-ent and testing begins !f t$ese *ists are treated as an i--utab*e contract< t$en re@uire-ents t$at e-erge in t$e 8e"e*o,-ent ,rocess -a0 generate a contro"ersia* c$ange re@uest <lternati#e to re>uire,ent lists >s an a*ternati"e to t$e re@uire-ent *ists >gi*e Software 8e"e*o,-ent uses =ser stories to suggest re@uire-ent in e"er0 da0 *anguage .easurable goals /ain artic*e: 7oa* -ode*ing +est ,ractices ta?e t$e co-,osed *ist of re@uire-ents -ere*0 as c*ues and re,eated*0 as? Hw$06H unti* t$e actua* business ,ur,oses are disco"ered Sta?e$o*ders and de"e*o,ers can t$en de"ise tests to -easure w$at *e"e* of eac$ goa* $as been ac$ie"ed t$us far Suc$ goa*s c$ange -ore s*ow*0 t$an t$e *ong *ist of s,ecific but un-easured re@uire-ents Once a s-a** set of critica*< -easured goa*s $as been estab*is$ed< ra,id ,rotot0,ing and s$ort iterati"e de"e*o,-ent ,$ases -a0 ,roceed to de*i"er actua* sta?e$o*der "a*ue *ong before t$e ,roject is $a*f o"er %rotot/+es %rotot0,es are /oc?u,s of an a,,*ication< a**owing users to "isua*iDe an a,,*ication t$at $as not 0et been constructed %rotot0,es $e*, ,eo,*e get an idea of w$at t$e s0ste- wi** *oo? *i?e< and -a?e it easier for ,rojects to -a?e design decisions wit$out waiting for t$e s0ste- to be bui*t /ajor i-,ro"e-ents in co--unication between users and de"e*o,ers were often seen wit$ t$e introduction of ,rotot0,es Ear*0 "iews of a,,*ications *ed to fewer c$anges *ater and $ence reduced o"era** costs considerab*0 %rotot0,es can be f*at diagra-s (often referred to as wirefra-es) or wor?ing a,,*ications using s0nt$esiDed functiona*it0 3irefra-es are -ade in a "ariet0 of gra,$ic design docu-ents< and often re-o"e a** co*or fro- t$e design (i e use a gre0sca*e co*or ,a*ette) in instances w$ere t$e fina* software is e1,ected to $a"e gra,$ic design a,,*ied to it #$is $e*,s to ,re"ent confusion as to w$et$er t$e ,rotot0,e re,resents t$e fina* "isua* *oo? and fee* of t$e a,,*ication ;se cases > use case is a structure for docu-enting t$e functiona* re@uire-ents for a s0ste-< usua**0 in"o*"ing software< w$et$er t$at is new or being c$anged Eac$ use case ,ro"ides a set of scenarios t$at con"e0 $ow t$e s0ste- s$ou*d interact wit$ a $u-an user or anot$er s0ste-< to ac$ie"e a s,ecific business goa* =se cases t0,ica**0 a"oid tec$nica* jargon< ,referring instead t$e *anguage of t$e end-user or - 113 -

Object-Oriented Software Engineering (CS350) domain e"!ert =se cases are often co-aut$ored b0 re@uire-ents engineers and sta?e$o*ders =se cases are dece,ti"e*0 si-,*e too*s for describing t$e be$a"ior of software or s0ste-s > use case contains a te1tua* descri,tion of t$e wa0s in w$ic$ users are intended to wor? wit$ t$e software or s0ste- =se cases s$ou*d not describe interna* wor?ings of t$e s0ste-< nor s$ou*d t$e0 e1,*ain $ow t$at s0ste- wi** be i-,*e-ented !nstead< t$e0 s$ow t$e ste,s needed to ,erfor- a tas? Software re>uire,ents s+ecification See Software 5e@uire-ents S,ecification (S5S) for a fu** account "ypes of +e,uirements 5e@uire-ents are categoriDed in se"era* wa0s #$e fo**owing are co--on categoriDations of re@uire-ents t$at re*ate to tec$nica* -anage-ent:J1W Custo-er 5e@uire-ents State-ents of fact and assu-,tions t$at define t$e e1,ectations of t$e s0ste- in ter-s of -ission objecti"es< en"iron-ent< constraints< and -easures of effecti"eness and suitabi*it0 (/OEF/OS) #$e custo-ers are t$ose t$at ,erfor- t$e eig$t ,ri-ar0 functions of s0ste-s engineering< wit$ s,ecia* e-,$asis on t$e o,erator as t$e ?e0 custo-er O,erationa* re@uire-ents wi** define t$e basic need and< at a -ini-u-< answer t$e @uestions ,osed in t$e fo**owing *isting:J1W @!erational distribution or de!loyment: 3$ere wi** t$e s0ste- be used6 Mission !rofile or scenario: ;ow wi** t$e s0ste- acco-,*is$ its -ission objecti"e6 /erformance and related !arameters: 3$at are t$e critica* s0ste- ,ara-eters to acco-,*is$ t$e -ission6 3tili$ation environments: ;ow are t$e "arious s0ste- co-,onents to be used6 Effectiveness re2uirements: ;ow effecti"e or efficient -ust t$e s0ste- be in ,erfor-ing its -ission6 @!erational life cycle: ;ow *ong wi** t$e s0ste- be in use b0 t$e user6 Environment: 3$at en"iron-ents wi** t$e s0ste- be e1,ected to o,erate in an effecti"e -anner6 >rc$itectura* 5e@uire-ents >rc$itectura* re@uire-ents e1,*ain w$at $as to be done b0 identif0ing t$e necessar0 s0stearc$itecture of a s0steStructura* 5e@uire-ents Structura* re@uire-ents e1,*ain w$at $as to be done b0 identif0ing t$e necessar0 structure of a s0ste+e$a"iora* 5e@uire-ents +e$a"iora* re@uire-ents e1,*ain w$at $as to be done b0 identif0ing t$e necessar0 be$a"ior of a s0steAunctiona* 5e@uire-ents Aunctiona* re@uire-ents e1,*ain w$at $as to be done b0 identif0ing t$e necessar0 tas?< action or acti"it0 t$at -ust be acco-,*is$ed Aunctiona* re@uire-ents ana*0sis wi** be used as t$e to,*e"e* functions for functiona* ana*0sis J1W - 11' -

Course Notes: Non-functiona* 5e@uire-ents Non-functiona* re@uire-ents are re@uire-ents t$at s,ecif0 criteria t$at can be used to judge t$e o,eration of a s0ste-< rat$er t$an s,ecific be$a"iors %erfor-ance 5e@uire-ents #$e e1tent to w$ic$ a -ission or function -ust be e1ecutedG genera**0 -easured in ter-s of @uantit0< @ua*it0< co"erage< ti-e*iness or readiness 8uring re@uire-ents ana*0sis< ,erfor-ance ($ow we** does it $a"e to be done) re@uire-ents wi** be interacti"e*0 de"e*o,ed across a** identified functions based on s0ste- *ife c0c*e factorsG and c$aracteriDed in ter-s of t$e degree of certaint0 in t$eir esti-ate< t$e degree of critica*it0 to s0ste- success< and t$eir re*ations$i, to ot$er re@uire-ents J1W 8esign 5e@uire-ents #$e Qbui*d to<R Qcode to<R and Qbu0 toR re@uire-ents for ,roducts and Q$ow to e1ecuteR re@uire-ents for ,rocesses e1,ressed in tec$nica* data ,ac?ages and tec$nica* -anua*s J1W 8eri"ed 5e@uire-ents 5e@uire-ents t$at are i-,*ied or transfor-ed fro- $ig$er-*e"e* re@uire-ent Aor e1a-,*e< a re@uire-ent for *ong range or $ig$ s,eed -a0 resu*t in a design re@uire-ent for *ow weig$t J1W >**ocated 5e@uire-ents > re@uire-ent t$at is estab*is$ed b0 di"iding or ot$erwise a**ocating a $ig$-*e"e* re@uire-ent into -u*ti,*e *ower-*e"e* re@uire-ents E1a-,*e: > 100-,ound ite- t$at consists of two subs0ste-s -ig$t resu*t in weig$t re@uire-ents of 20 ,ounds and 30 ,ounds for t$e two *ower*e"e* ite-s J1W 3e**-?nown re@uire-ents categoriDation -ode*s inc*ude A=5%S and A=5%SB< de"e*o,ed at ;ew*ett%ac?ard +e,uirements analysis issues Sta7e$older issues Ste"e /cConne**< in $is boo? +a!id ,evelo!ment< detai*s a nu-ber of wa0s users can in$ibit re@uire-ents gat$ering: =sers do not understand w$at t$e0 want or users don4t $a"e a c*ear idea of t$eir re@uire-ents =sers wi** not co--it to a set of written re@uire-ents =sers insist on new re@uire-ents after t$e cost and sc$edu*e $a"e been fi1ed Co--unication wit$ users is s*ow =sers often do not ,artici,ate in re"iews or are inca,ab*e of doing so =sers are tec$nica**0 unso,$isticated =sers do not understand t$e de"e*o,-ent ,rocess =sers do not ?now about ,resent tec$no*og0

#$is -a0 *ead to t$e situation w$ere user re@uire-ents ?ee, c$anging e"en w$en s0ste- or ,roduct de"e*o,-ent $as been started

- 115 -

Object-Oriented Software Engineering (CS350) EngineerBde#elo+er issues %ossib*e ,rob*e-s caused b0 engineers and de"e*o,ers during re@uire-ents ana*0sis are: #ec$nica* ,ersonne* and end-users -a0 $a"e different "ocabu*aries Conse@uent*0< t$e0 -a0 wrong*0 be*ie"e t$e0 are in ,erfect agree-ent unti* t$e finis$ed ,roduct is su,,*ied Engineers and de"e*o,ers -a0 tr0 to -a?e t$e re@uire-ents fit an e1isting s0ste- or -ode*< rat$er t$an de"e*o, a s0ste- s,ecific to t$e needs of t$e c*ient >na*0sis -a0 often be carried out b0 engineers or ,rogra--ers< rat$er t$an ,ersonne* wit$ t$e ,eo,*e s?i**s and t$e do-ain ?now*edge to understand a c*ient4s needs ,ro,er*0 <tte,+ted solutions One atte-,ted so*ution to co--unications ,rob*e-s $as been to e-,*o0 s,ecia*ists in business or s0ste- ana*0sis #ec$ni@ues introduced in t$e 1&&0s *i?e ,rotot0,ing< =nified /ode*ing .anguage (=/.)< use cases< and >gi*e software de"e*o,-ent are a*so intended as so*utions to ,rob*e-s encountered wit$ ,re"ious -et$ods >*so< a new c*ass of a,,*ication si-u*ation or a,,*ication definition too*s $a"e entered t$e -ar?et #$ese too*s are designed to bridge t$e co--unication ga, between business users and t$e !# organiDation X and a*so to a**ow a,,*ications to be 4test -ar?eted4 before an0 code is ,roduced #$e best of t$ese too*s offer: e*ectronic w$iteboards to s?etc$ a,,*ication f*ows and test a*ternati"es abi*it0 to ca,ture business *ogic and data needs abi*it0 to generate $ig$ fide*it0 ,rotot0,es t$at c*ose*0 i-itate t$e fina* a,,*ication interacti"it0 ca,abi*it0 to add conte1tua* re@uire-ents and ot$er co--ents abi*it0 for re-ote and distributed users to run and interact wit$ t$e si-u*ation

%3E#iew
REvie% (%rocess and 5e@uire-ents :iew,oints) is a re@uire-ents -et$od w$ic$ focuses on t$e ear*0 stage of 5e@uire-ents Engineering: disco"ering and docu-enting re@uire-ents %5E"iew uses a :iew,oint-Oriented >,,roac$ to enab*e t$e con"ersion of to,-*e"e* goa*s (QconcernsR) into re@uire-ents and constraintsJ1W Q%re"iew ai-s to i-,ro"e t$e @ua*it0 of re@uire-ents s,ecification b0 ,ro"iding a fra-ewor? w$ic$ can su,,ort bot$ re@uire-ents e*icitation and t$e structuring of t$e re@uire-ents docu-entJ2W R Overview %5E"iew focuses on "iew,oints for re@uire-ents engineering of co-,uter-based s0ste-s but t$e "iew,oint-conce,t is a*so used in "arious ot$er areas of e1,ertise !n co--unications< t$e O8% (O,en 8istributed %rocessing) 5eference /ode* defines "iew,oints fro- w$ic$ a s0ste- can be s,ecifiedJ3W - 11( -

Course Notes: !n CSC3 "iew,oints are a*so used to structure organisationa* ana*0ses ;owe"er< t$ese $a"e not ada,ted t$e e1,*icit notion of a "iew,oint< but use it as a genera* -u*ti,*e ,ers,ecti"e a,,roac$ to ana*0sis #$e CO5E -et$od de"e*o,ed b0 /u**er0J'W was t$e first -et$od to use "iew,oints as an e1,*icit notion Nuseibe$J5WJ(W and 7reens,anJ2W $a"e de"e*o,ed si-i*ar -et$ods< in w$ic$ "iew,oints are a centra* notion %5E"iew is a ,rag-atic ada,tation of t$ese o*der -et$ods #$e traditiona* "iew,oint-oriented a,,roac$es are @uite inf*e1ib*e< w$ic$ -a?es it $ard to introduce t$ese -et$ods into e1isting businesses %5E"iew is not ,rescri,ti"e about t$e -et$ods and notations to be used< t$ereb0 -a?ing it easier to be integrated into e1isting re@uire-ents -et$ods %5E"iew ai-s to i-,ro"e t$e @ua*it0 of re@uire-ents s,ecification b0 ,ro"iding a framewor& for t$e ear*0 ,$ases of t$e re@uire-ents ,rocess P+Eview Process-Data Diagram =sing -eta--ode**ing< t$e %5E"iew ,rocess wi** be e1,*ained in t$e co-ing ,aragra,$s Aigure 1 s$ows t$e acti"ities wit$in t$e %5E"iew ,rocess Aor c*arit0< t$e definition of t$ese acti"ities wi** not be s$own in a tab*e< as is co--on in -eta--ode**ing< but wi** be e1,*ained in t$e c$a,ter U#$e %5E"iew ,rocess %rocess diagra, #$ese acti"ities $a"e se"era* conce,ts< or de*i"erab*es< w$ic$ can be found in t$e -eta-data tab*e be*ow #$ese conce,ts are *in?ed to t$e %rocess-diagra- abo"e< creating t$e ,rocess-data diagra- So-e of t$e conce,ts in t$e tab*e $a"e a definition uni@ue to t$e %5E"iew -et$od< and wi** be defined using J1W as source /ore generic conce,ts are defined using -ore standardiDed definitions

Figure 1: PREview Process Diagram - 112 -

Object-Oriented Software Engineering (CS350) &afety ER4 ER8 ER9 &&4 B 0 B &afe state $ssurance &&8 0 B B &&9 0 0 0 !oncept > non-negotiab*e 5EE=!5E/EN# w$ose satisfaction is essentia* to t$e success of t$e enter,rise !t is Qg*oba*R in t$e sense t$at it $as a wide sco,e in t$at it CONCE5N ,otentia**0 affects e"er0 as,ect of t$e s0ste- rat$er t$an< for e1a-,*e< being satisfiab*e b0 a sing*e co-,onent !f a QconcernR does not -eet t$ese criteria< it is not a concern J1W > state-ent of t$e re@uired functiona*it0 of a software co-,onent 5EE=!5E/EN# ($tt,:FF-d, i"" nasa go"F-d,bg*ossar0 $t-*) ET#E5N>. 5EE=!5E/EN#s against w$ic$ ot$er 5EE=!5E/EN#s are "a*idated (no 5EE=!5E/EN# source) > set of @uestions $e*,ing t$e ana*0st to create a c$ec?*ist of ET#E5N>. E=ES#!ONSE# 5EE=!5E/EN#s to be co-,*iant wit$ t$ose of ot$er :!E3%O!N#S > %5E"iew :!E3%O!N# re,resents a ,ers,ecti"e used to -a, 5EE=!5E/EN#s deri"ed fro- t$e ,rob*e- do-ain onto t$e s0ste- to be de"e*o,ed !t $as *ong been recognised t$at it is good ,ractice to ana*0se a :!E3%O!N# software or s0ste-s engineering ,rob*e- fro- t$e ,ers,ecti"es of t$e "arious actors ($u-an or -ac$ine) w$o -ust interact wit$ t$e s0ste- or w$o $a"e so-e sta?e in t$e s0ste- #$e ter- Q:!E3%O!N#R is broad*0 s0non0-ous wit$ ,ers,ecti"e J1W !n %5E"iew< t$e AOC=S defines t$e sco,e of t$e :!E3%O!N#Os AOC=S 5EE=!5E/EN#s as a function of t$e ,rob*e- do-ain and t$e co-,onents inf*uenced in t$e s0ste- J1W #$is records c$anges to t$e infor-ation recorded in t$e :!E3%O!N# o"er ti-e C;>N7E ;!S#O5P Aor e1a-,*e< a rationa*e for w$0 a ,articu*ar concern need not be considered b0 t$e :!E3%O!N# s$ou*d a,,ear $ere J1W #$e source e1,*icit*0 identifies t$e source of t$e 5EE=!5E/EN#s associated SO=5CE wit$ t$e re@uire-ent SO=5CEs -a0 be indi"idua*s< ro*es< grou,s< or docu-ents J1W #$e 5EE=!5E/EN#S 8OC=/EN# c*ear*0 states t$e objecti"es of t$e 5EE=!5E/EN#S software to be de"e*o,ed< and describes t$e s,ecific functiona*it0 wi** be 8OC=/EN# inc*uded #$is docu-ent for-s t$e basis for a** future design and coding ($tt,:FFwww e,ri co-Fe,risoftwareF,rocessguideFg*ossar0 $t-*) !ompatibility ER: ER; ER< ER= 0 0 0 0 0 0 0 0 0 able of conce+ts Definition

- 11) -

Course Notes:

%rocess-data diagra,

%5E"iew %rocess-8ata 8iagra"he P+Eview process #$e acti"ities in t$e ,rocess-data -ode* are e1,*ained in t$is ,aragra,$ 3e>uire,ents disco#er/ #$e re@uire-ents disco"er0 ,$ase consists of se"era* sub-acti"ities !dentif0 Concerns: Concerns are identified t$roug$ discussion wit$ t$e ,rinci,a* sta?e$o*ders #$ese are t0,ica**0 t$e c*ient and t$e de"e*o,er #$e sta?e$o*dersO ,rinci,a* concerns for t$e s0ste- are e*icited t$roug$ inter"iews and @uestionnaires - 11& -

Object-Oriented Software Engineering (CS350) E*aborate concerns : Once identified< concerns -ust be e*aborated into a for- w$ic$ is direct*0 a,,*icab*e #$e concerns are e*aborated into e1terna* re@uire-ents and @uestions sets w$ic$ wi** function as a c$ec?*ist #$ese @uestions wi** be used as a test of co-,*iance w$en t$e "iew,oints are first disco"ered +0 using t$is c$ec?-*ist< %5E"iew wi** identif0 conf*icts between two or -ore re@uire-ents in an ear*0 stage !dentif0 "iew,oints : > %5E"iew :iew,oint re,resents a ,ers,ecti"e used to -a, re@uire-ents deri"ed fro- t$e ,rob*e- do-ain onto t$e s0ste- to be de"e*o,ed #$is wa0 t$e software or s0ste-s engineering ,rob*e- is ana*0sed fro- t$e ,ers,ecti"es of t$e "arious actors ($u-an or -ac$ine) w$o -ust interact wit$ t$e s0ste- or w$o $a"e so-e sta?e in t$e s0ste- Q#$e ter4"iew,oint4 is broad*0 s0non0-ous wit$ ,ers,ecti"eR J)W :iew,oints fa** into one of t$ese c*asses: !nteractors (;u-an o,erators and -odu*es of t$e s0ste-) !ndirect Sta?e$o*ders (e g o,erating organisation F standards F regu*ator0 bodies 8o-ain %$eno-ena (5estrictions of t$e s0ste- in ter-s of tec$nica* restraints) :iew,oints s$ou*d be deco-,osed unti* t$e0 re,resent a sing*e co$esi"e ,ers,ecti"e< ?nown as t$e focus of t$e "iew,oint< and t$e0Ore source can be identified (see -eta -ode*) 8isco"er re@uire-ents : #$e re@uire-ents< e*icited fro- t$e set of different "iew,oints wi** be docu-ented and ana*0sed in t$e ne1t stage of t$e ,rocess 3e>uire,ents anal/sis #$e re@uire-ents co**ected during t$e disco"er0 ,$ase are integrated and ana*0sed =sua**0< t$is wi** resu*t in t$e identification of -issing re@uire-ents< inconsistencies and re@uire-ents conf*icts #0,ica**0< t$e re@uire-ents in a *arge s0ste- wi** be docu-ented b0 a -i1ture of natura* *anguage< se-i-for-a*< for-a* and gra,$ica* notation > s0ste-atic a,,roac$ to disco"ering inconsistenc0 is used in %5E"iew< *oose*0 based on t$e ;ouse of Eua*it0 used b0 Eua*it0 Aunction 8e,*o0-ent (EA8) #$e tab*e be*ow s$ows an e1a-,*e for an on-board train ,rotection s0ste- (7>>%)< ta?en fro- J1W ;ere t$e safe state assurance concerns (SS1< SS2< SS3) are ,*otted against t$e e1terna* re@uire-ents fro-< in t$is case< safet0 and co-,atibi*it0 concerns (E51-2) &&4: 8etection of e1cess s,eed &&8: 8etection of o"ers$ooting ER4: #$e s0ste- s$a** detect t$e occurrence of e1cess s,eed ER8: #$e s0ste- s$a** detect t$e occurrence of o"ers$oot ER9: #$e s0ste- s$a** a,,*0 e-ergenc0 bra?ing w$en eit$er e1cess s,eed or o"ers$oot is detected >s can be e1,ected< SS1 s$ows a reinforcing effect on E51 and E53< and SS2 s$ows a reinforcing effect on E52 and E53 > Dero -eans t$ere is no re*ation< or a neutra* effect /ore interesting of course are t$e ,ossib*e conf*icts t$at arise !n t$is case< SS3 s$ows conf*icts wit$ t$e fo**owing e1terna* re@uire-ents: - 120 -

Course Notes: ER;: #$e 7>>% software -ust e1ecute wit$in t$e a,,*ication c0c*e of t$e e1isting onboard software ER<: #$e reaction ti-e of t$e 7>>% software to t$e c$ange of state of one bit in t$e "ariants tab*e -ust be 312-s ER=: #$e rea*-ti-e ,erfor-ance of t$e e1isting on-board software -ust be -aintained >** conf*icting< redundant and non-co-,*iant re@uire-ents wi** be -o"ed to t$e ne1t stage of t$e %5E"iew ,rocess: 5e@uire-ents Negotiation Co-,*iant and -utua**0 consistent re@uire-ents wi** be -o"ed to t$e fina* stage of t$e %5E"iew: U5e@uire-ents definition 3e>uire,ents negotiation >n0 inconsistencies between re@uire-ents or inco-,*eteness of t$ese re@uire-ents wi** *ead to reentr0 of t$e re@uire-ent disco"er0 ,$ase< to disco"er furt$er infor-ation and refine e1isting but inco-,*ete infor-ation 3e>uire,ents definition Co-,*iance and -utua**0 consistent re@uire-ents wi** be integrated and for-atted into a re@uire-ents s,ecification docu-ent

- 121 -

Object-Oriented Software Engineering (CS350)

C! S/ste, ,odels
> system model is t$e conce,tua* -ode* t$at describes and re,resents a s0ste- > s0ste- co-,rises -u*ti,*e "iews suc$ as ,*anning< re@uire-ent (ana*0sis)< design< i-,*e-entation< de,*o0-ent< structure< be$a"ior< in,ut data< and out,ut data "iews > s0ste- -ode* is re@uired to describe and re,resent a** t$ese -u*ti,*e "iews #$e s0ste- -ode* describes and re,resents t$e -u*ti,*e "iews ,ossib*0 using two different a,,roac$es #$e first one is t$e non-arc$itectura* a,,roac$ and t$e second one is t$e arc$itectura* a,,roac$ #$e non-arc$itectura* a,,roac$ res,ecti"e*0 ,ic?s a -ode* for eac$ "iew Aor e1a-,*e< Structured S0ste-s >na*0sis and 8esign /et$od (SS>8/)< ,ic?ing t$e Structure C$art (SC) for structure descri,tion and t$e 8ata A*ow 8iagra- (8A8) for be$a"ior descri,tion< is categoriDed into t$e nonarc$itectura* a,,roac$ #$e arc$itectura* a,,roac$< instead of ,ic?ing -an0 $eterogeneous and unre*ated -ode*s< wi** use on*0 one sing*e coa*escence -ode* Aor e1a-,*e< S0ste- arc$itecture< using t$e >rc$itecture 8escri,tion .anguage (>8.) for bot$ structure and be$a"ior descri,tions< is categoriDed into t$e arc$itectura* a,,roac$

&ehavioral models
6ata-flow ,odels
> data flo% diagram (D'D) is a gra,$ica* re,resentation of t$e Hf*owH of data t$roug$ an infor-ation s0ste-< -ode*ing its !rocess as,ects Often t$e0 are a ,re*i-inar0 ste, used to create an o"er"iew of t$e s0ste- w$ic$ can *ater be e*aborated J2W 8A8s can a*so be used for t$e "isua*iDation of data ,rocessing (structured design) > 8A8 s$ows w$at ?inds of infor-ation wi** be in,ut to and out,ut fro- t$e s0ste-< w$ere t$e data wi** co-e fro- and go to< and w$ere t$e data wi** be stored !t does not s$ow infor-ation about t$e ti-ing of ,rocesses< or infor-ation about w$et$er ,rocesses wi** o,erate in se@uence or in ,ara**e* (w$ic$ is s$own on a f*owc$art)

O#er#iew

8ata f*ow diagra- e1a-,*e

- 122 -

Course Notes:

8ata f*ow diagra- - PourdonF8e/arco notation !t is co--on ,ractice to draw t$e conte1t-*e"e* data f*ow diagra- first< w$ic$ s$ows t$e interaction between t$e s0ste- and e1terna* agents w$ic$ act as data sources and data sin?s On t$e conte1t diagra- t$e s0ste-4s interactions wit$ t$e outside wor*d are -ode**ed ,ure*0 in ter-s of data f*ows across t$e system boundary #$e conte1t diagra- s$ows t$e entire s0ste- as a sing*e ,rocess< and gi"es no c*ues as to its interna* organiDation #$is conte1t-*e"e* 8A8 is ne1t He1,*odedH< to ,roduce a .e"e* 0 8A8 t$at s$ows so-e of t$e detai* of t$e s0ste- being -ode*ed #$e .e"e* 0 8A8 s$ows $ow t$e s0ste- is di"ided into sub-s0ste-s (,rocesses)< eac$ of w$ic$ dea*s wit$ one or -ore of t$e data f*ows to or fro- an e1terna* agent< and w$ic$ toget$er ,ro"ide a** of t$e functiona*it0 of t$e s0ste- as a w$o*e !t a*so identifies interna* data stores t$at -ust be ,resent in order for t$e s0ste- to do its job< and s$ows t$e f*ow of data between t$e "arious ,arts of t$e s0ste8ata f*ow diagra-s were ,ro,osed b0 .arr0 Constantine< t$e origina* de"e*o,er of structured design< J3W based on /artin and Estrin4s Hdata f*ow gra,$H -ode* of co-,utation 8ata f*ow diagra-s are one of t$e t$ree essentia* ,ers,ecti"es of t$e structured-s0ste-s ana*0sis and design -et$od SS>8/ #$e s,onsor of a ,roject and t$e end users wi** need to be briefed and consu*ted t$roug$out a** stages of a s0ste-4s e"o*ution 3it$ a data f*ow diagra-< users are ab*e to "isua*iDe $ow t$e s0ste- wi** o,erate< w$at t$e s0ste- wi** acco-,*is$< and $ow t$e s0ste- wi** be i-,*e-ented #$e o*d s0ste-4s dataf*ow diagra-s can be drawn u, and co-,ared wit$ t$e new s0ste-4s data f*ow diagra-s to draw co-,arisons to i-,*e-ent a -ore efficient s0ste- 8ata f*ow diagra-s can be used to ,ro"ide t$e end user wit$ a ,$0sica* idea of w$ere t$e data t$e0 in,ut u*ti-ate*0 $as an effect u,on t$e structure of t$e w$o*e s0ste- fro- order to dis,atc$ to re,ort ;ow an0 s0ste- is de"e*o,ed can be deter-ined t$roug$ a data f*ow diagra- -ode* !n t$e course of de"e*o,ing a set of levelled data f*ow diagra-s t$e ana*0stFdesigners is forced to address $ow t$e s0ste- -a0 be deco-,osed into co-,onent sub-s0ste-s< and to identif0 t$e transaction data in t$e data -ode* 8ata f*ow diagra-s can be used in bot$ >na*0sis and 8esign ,$ase of S8.C #$ere are different notations to draw data f*ow diagra-s (Pourdon 9 Coad and 7ane 9 SarsonJ'W)< defining different "isua* re,resentations for ,rocesses< data stores< data f*ow< and e1terna* entities J5W - 123 -

Object-Oriented Software Engineering (CS350)

State ,ac$ine ,odels


U)1 state machine<J1W a*so ?nown as U)1 statechart< is a significant*0 en$anced rea*iDation of t$e -at$e-atica* conce,t of a finite auto-aton in co-,uter science a,,*ications as e1,ressed in t$e =nified /ode*ing .anguage (=/.) notation #$e conce,ts be$ind it are about organiDing t$e wa0 a de"ice< co-,uter ,rogra-< or ot$er (often tec$nica*) ,rocess wor?s suc$ t$at an entit0 or eac$ of its sub-entities is a*wa0s in e1act*0 one of a nu-ber of ,ossib*e states and w$ere t$ere are we**-defined conditiona* transitions between t$ese states =/. state -ac$ine is an object-based "ariant of ;are* statec$art<J2W ada,ted and e1tended b0 =/. =/. state -ac$ines o"erco-e t$e -ain *i-itations of traditiona* finite-state -ac$ines w$i*e retaining t$eir -ain benefits =/. statec$arts introduce t$e new conce,ts of $ierarc$ica**0 nested states and ort$ogona* regions< w$i*e e1tending t$e notion of actions =/. state -ac$ines $a"e t$e c$aracteristics of bot$ /ea*0 -ac$ines and /oore -ac$ines #$e0 su,,ort actions t$at de,end on bot$ t$e state of t$e s0ste- and t$e triggering e"ent< as in /ea*0 -ac$ines< as we** as entr0 and e1it actions< w$ic$ are associated wit$ states rat$er t$an transitions< as in /oore -ac$ines #$e ter- H=/. state -ac$ineH can refer to two ?inds of state -ac$ines: behavioral state machines and !rotocol state machines +e$a"iora* state -ac$ines can be used to -ode* t$e be$a"ior of indi"idua* entities (e g < c*ass instances) %rotoco* state -ac$ines are used to e1,ress usage ,rotoco*s and can be used to s,ecif0 t$e *ega* usage scenarios of c*assifiers< interfaces< and ,orts J1W

*asic state ,ac$ine conce+ts


/an0 software s0ste-s are e"ent-dri"en< w$ic$ -eans t$at t$e0 continuous*0 wait for t$e occurrence of so-e e1terna* or interna* event suc$ as a -ouse c*ic?< a button ,ress< a ti-e tic?< or an arri"a* of a data ,ac?et >fter recogniDing t$e e"ent< suc$ s0ste-s react b0 ,erfor-ing t$e a,,ro,riate co-,utation t$at -a0 inc*ude -ani,u*ating t$e $ardware or generating QsoftR e"ents t$at trigger ot$er interna* software co-,onents (#$atOs w$0 e"ent-dri"en s0ste-s are a*ternati"e*0 ca**ed reactive systems ) Once t$e e"ent $and*ing is co-,*ete< t$e s0ste- goes bac? to waiting for t$e ne1t e"ent #$e res,onse to an e"ent genera**0 de,ends on bot$ t$e t0,e of t$e e"ent and on t$e interna* state of t$e s0ste- and can inc*ude a c$ange of state *eading to a state transition #$e ,attern of e"ents< states< and state transitions a-ong t$ose states can be abstracted and re,resented as a finite(state machine (AS/) #$e conce,t of a AS/ is i-,ortant in e"ent-dri"en ,rogra--ing because it -a?es t$e e"ent $and*ing e1,*icit*0 de,endent on bot$ t$e e"ent-t0,e and on t$e state of t$e s0ste- 3$en used correct*0< a state -ac$ine can drastica**0 cut down t$e nu-ber of e1ecution ,at$s t$roug$ t$e code< si-,*if0 t$e conditions tested at eac$ branc$ing ,oint< and si-,*if0 t$e switc$ing between different -odes of e1ecution J3W Con"erse*0< using e"ent-dri"en ,rogra--ing wit$out an under*0ing AS/ -ode* can *ead ,rogra--ers to ,roduce error ,rone< difficu*t to e1tend and e1cessi"e*0 co-,*e1 a,,*ication code J'W

- 12' -

Course Notes:

*asic ;.- state diagra,s


=/. ,reser"es t$e genera* for- of t$e traditiona* state diagra-s #$e =/. state diagra-s are directed gra,$s in w$ic$ nodes denote states and connectors denote state transitions Aor e1a-,*e< Aigure 1 s$ows a =/. state diagra- corres,onding to t$e co-,uter ?e0board state -ac$ine !n =/.< states are re,resented as rounded rectang*es *abe*ed wit$ state na-es #$e transitions< re,resented as arrows< are *abe*ed wit$ t$e triggering e"ents fo**owed o,tiona**0 b0 t$e *ist of e1ecuted actions #$e initial transition originates fro- t$e so*id circ*e and s,ecifies t$e defau*t state w$en t$e s0ste- first begins E"er0 state diagra- s$ou*d $a"e suc$ a transition< w$ic$ s$ou*d not be *abe*ed< since it is not triggered b0 an e"ent #$e initia* transition can $a"e associated actions

Aigure 1: =/. state diagra- re,resenting t$e co-,uter ?e0board state -ac$ine

E#ents
!n t$e -ost genera* ter-s< an event is so-et$ing t$at $a,,ens t$at affects t$e s0ste- Strict*0 s,ea?ing< in t$e =/. s,ecification<J1W t$e ter- e"ent refers to t$e t0,e of occurrence rat$er t$an to an0 concrete instance of t$at occurrence Aor e1a-,*e< Se0stro?e is an e"ent for t$e ?e0board< but eac$ ,ress of a ?e0 is not an e"ent but a concrete instance of t$e Se0stro?e e"ent >not$er e"ent of interest for t$e ?e0board -ig$t be %ower-on< but turning t$e ,ower on to-orrow at 10:05:3( wi** be just an instance of t$e %ower-on e"ent >n e"ent can $a"e associated parameters< a**owing t$e e"ent instance to con"e0 not on*0 t$e occurrence of so-e interesting incident but a*so @uantitati"e infor-ation regarding t$at occurrence Aor e1a-,*e< t$e Se0stro?e e"ent generated b0 ,ressing a ?e0 on a co-,uter ?e0board $as associated ,ara-eters t$at con"e0 t$e c$aracter scan code as we** as t$e status of t$e S$ift< Ctr*< and >*t ?e0s >n e"ent instance out*i"es t$e instantaneous occurrence t$at generated it and -ig$t con"e0 t$is occurrence to one or -ore state -ac$ines Once generated< t$e e"ent instance goes t$roug$ a ,rocessing *ife c0c*e t$at can consist of u, to t$ree stages Airst< t$e e"ent instance is received w$en it is acce,ted and waiting for ,rocessing (e g < it is ,*aced on t$e e"ent @ueue) .ater< t$e e"ent instance is - 125 -

Object-Oriented Software Engineering (CS350) dispatched to t$e state -ac$ine< at w$ic$ ,oint it beco-es t$e current e"ent Aina**0< it is consumed w$en t$e state -ac$ine finis$es ,rocessing t$e e"ent instance > consu-ed e"ent instance is no *onger a"ai*ab*e for ,rocessing

States
> state ca,tures t$e re*e"ant as,ects of t$e s0ste-4s $istor0 "er0 efficient*0 Aor e1a-,*e< w$en 0ou stri?e a ?e0 on a ?e0board< t$e c$aracter code generated wi** be eit$er an u,,ercase or a *owercase c$aracter< de,ending on w$et$er t$e Ca,s .oc? is acti"e #$erefore< t$e ?e0board4s be$a"ior can be di"ided into two states: t$e Hdefau*tH state and t$e Hca,sb*oc?edH state (/ost ?e0boards inc*ude an .E8 t$at indicates t$at t$e ?e0board is in t$e Hca,sb*oc?edH state ) #$e be$a"ior of a ?e0board de,ends on*0 on certain as,ects of its $istor0< na-e*0 w$et$er t$e Ca,s .oc? ?e0 $as been ,ressed< but not< for e1a-,*e< on $ow -an0 and e1act*0 w$ic$ ot$er ?e0s $a"e been ,ressed ,re"ious*0 > state can abstract awa0 a** ,ossib*e (but irre*e"ant) e"ent se@uences and ca,ture on*0 t$e re*e"ant ones #o re*ate t$is conce,t to ,rogra--ing< t$is -eans t$at instead of recording t$e e"ent $istor0 in a -u*titude of "ariab*es< f*ags< and con"o*uted *ogic< 0ou re*0 -ain*0 on just one state variable t$at can assu-e on*0 a *i-ited nu-ber of a ,riori deter-ined "a*ues (e g < two "a*ues in case of t$e ?e0board) #$e "a*ue of t$e state "ariab*e cris,*0 defines t$e current state of t$e s0ste- at an0 gi"en ti-e #$e conce,t of state reduces t$e ,rob*e- of identif0ing t$e e1ecution conte1t in t$e code to testing just t$e state "ariab*e instead of -an0 "ariab*es< t$us e*i-inating a *ot of conditiona* *ogic /oreo"er< switc$ing between different states is "ast*0 si-,*ified as we**< because 0ou need to reassign just one state "ariab*e instead of c$anging -u*ti,*e "ariab*es in a se*f-consistent -anner

E0tended states
One ,ossib*e inter,retation of state for software s0ste-s is t$at eac$ state re,resents one distinct set of "a*id "a*ues of t$e w$o*e ,rogra- -e-or0 E"en for si-,*e ,rogra-s wit$ on*0 a few e*e-entar0 "ariab*es< t$is inter,retation *eads to an astrono-ica* nu-ber of states Aor e1a-,*e< a sing*e 32-bit integer cou*d contribute to o"er ' bi**ion different states C*ear*0< t$is inter,retation is not ,ractica*< so ,rogra- "ariab*es are co--on*0 dissociated fro- states 5at$er< t$e co-,*ete condition of t$e s0ste(ca**ed t$e extended state) is t$e co-bination of a @ua*itati"e as,ect (t$e state) and t$e @uantitati"e as,ects (t$e e1tended state "ariab*es) !n t$is inter,retation< a c$ange of "ariab*e does not a*wa0s i-,*0 a c$ange of t$e @ua*itati"e as,ects of t$e s0ste- be$a"ior and t$erefore does not *ead to a c$ange of state J5W State -ac$ines su,,*e-ented wit$ "ariab*es are ca**ed extended state machines and =/. state -ac$ines be*ong to t$is categor0 E1tended state -ac$ines can a,,*0 t$e under*0ing for-a*is- to -uc$ -ore co-,*e1 ,rob*e-s t$an is ,ractica* wit$out inc*uding e1tended state "ariab*es Aor instance< su,,ose t$e be$a"ior of t$e ?e0board de,ends on t$e nu-ber of c$aracters t0,ed on it so far and t$at after< sa0< 1<000 ?e0stro?es< t$e ?e0board brea?s down and enters t$e fina* state #o -ode* t$is be$a"ior in a state -ac$ine wit$out -e-or0< 0ou wou*d need to introduce 1<000 states (e g < ,ressing a ?e0 in state stro?e123 wou*d *ead to state stro?e12'< and so on)< w$ic$ is c*ear*0 an i-,ractica* ,ro,osition >*ternati"e*0< 0ou cou*d construct an e1tended state -ac$ine wit$ a ?e0bcount down-counter "ariab*e #$e counter wou*d be initia*iDed to 1<000 and decre-ented b0 e"er0 ?e0stro?e wit$out c$anging state 3$en t$e counter reac$ed Dero< t$e state -ac$ine wou*d enter t$e fina* state - 12( -

Course Notes:

Aigure 2: E1tended state -ac$ine of Hc$ea, ?e0boardH wit$ e1tended state "ariab*e ?e0bcount and "arious guard conditions #$e state diagra- fro- Aigure 2 is an e1a-,*e of an e1tended state -ac$ine< in w$ic$ t$e co-,*ete condition of t$e s0ste- (ca**ed t$e e1tended state) is t$e co-bination of a @ua*itati"e as,ectXt$e HstateHXand t$e @uantitati"e as,ectsXt$e e1tended state "ariab*es (suc$ as t$e down-counter key_count) !n e1tended state -ac$ines< a c$ange of a "ariab*e does not a*wa0s i-,*0 a c$ange of t$e @ua*itati"e as,ects of t$e s0ste- be$a"ior and t$erefore does not a*wa0s *ead to a c$ange of state #$e ob"ious ad"antage of e1tended state -ac$ines is f*e1ibi*it0 Aor e1a-,*e< e1tending t$e *ifes,an of t$e Hc$ea, ?e0boardH fro- 1<000 to 10<000 ?e0stro?es wou*d not co-,*icate t$e e1tended state -ac$ine at a** #$e on*0 -odification re@uired wou*d be c$anging t$e initia*iDation "a*ue of t$e key_count down-counter in t$e initia* transition #$is f*e1ibi*it0 of e1tended state -ac$ines co-es wit$ a ,rice< $owe"er< because of t$e co-,*e1 cou,*ing between t$e H@ua*itati"eH and t$e H@uantitati"eH as,ects of t$e e1tended state #$e cou,*ing occurs t$roug$ t$e guard conditions attac$ed to transitions< as s$own in Aigure 2

5uard conditions
>uard conditions (or si-,*0 guards) are +oo*ean e1,ressions e"a*uated d0na-ica**0 based on t$e "a*ue of e1tended state "ariab*es and e"ent ,ara-eters 7uard conditions affect t$e be$a"ior of a state -ac$ine b0 enab*ing actions or transitions on*0 w$en t$e0 e"a*uate to #5=E and disab*ing t$e- w$en t$e0 e"a*uate to A>.SE !n t$e =/. notation< guard conditions are s$own in s@uare brac?ets (e g < [key_count == 0] in Aigure 2) #$e need for guards is t$e i--ediate conse@uence of adding -e-or0 e1tended state "ariab*es to t$e state -ac$ine for-a*is- =sed s,aring*0< e1tended state "ariab*es and guards -a?e u, a ,owerfu* -ec$anis- t$at can si-,*if0 designs +ut donOt *et t$e fanc0 na-e (HguardH) and t$e concise =/. notation foo* 0ou 3$en 0ou actua**0 code an e1tended state -ac$ine< t$e guards beco-e t$e sa-e !As and E.SEs t$at 0ou wanted to e*i-inate b0 using t$e state -ac$ine in t$e first ,*ace #oo -an0 of t$e-< and 0ouO** find 0ourse*f bac? in s@uare one (Hs,ag$etti codeH)< w$ere t$e guards effecti"e*0 ta?e - 122 -

Object-Oriented Software Engineering (CS350) o"er $and*ing of a** t$e re*e"ant conditions in t$e s0ste!ndeed< abuse of e1tended state "ariab*es and guards is t$e ,ri-ar0 -ec$anis- of arc$itectura* deca0 in designs based on state -ac$ines =sua**0< in t$e da0-to-da0 batt*e< it see-s "er0 te-,ting< es,ecia**0 to ,rogra--ers new to state -ac$ine for-a*is-< to add 0et anot$er e1tended state "ariab*e and 0et anot$er guard condition (anot$er !A or an E.SE) rat$er t$an to factor out t$e re*ated be$a"ior into a new @ua*itati"e as,ect of t$e s0ste-Xt$e state Aro- e1,erience in t$e trenc$es< t$e *i?e*i$ood of suc$ an arc$itectura* deca0 is direct*0 ,ro,ortiona* to t$e o"er$ead (actua* or ,ercei"ed) in"o*"ed in adding or re-o"ing states (w$ic$ re*ates to t$e actua* strateg0 used for i-,*e-enting =/. state -ac$ines ) One of t$e -ain c$a**enges in beco-ing an effecti"e state -ac$ine designer is to de"e*o, a sense for w$ic$ ,arts of t$e be$a"ior s$ou*d be ca,tured as t$e H@ua*itati"eH as,ects (t$e HstateH) and w$ic$ e*e-ents are better *eft as t$e H@uantitati"eH as,ects (e1tended state "ariab*es) !n genera*< 0ou s$ou*d acti"e*0 *oo? for o,,ortunities to ca,ture t$e e"ent $istor0 (w$at $a,,ened) as t$e HstateH of t$e s0ste-< instead of storing t$is infor-ation in e1tended state "ariab*es Aor e1a-,*e< a state -ac$ine re,resenting t$e be$a"ior of a ,oc?et ca*cu*ator -ig$t use an e1tended state "ariab*e Decimal lag to re-e-ber t$at t$e user entered t$e deci-a* ,oint to a"oid entering -u*ti,*e deci-a* ,oints in t$e sa-e nu-ber ;owe"er< a better so*ution is to obser"e t$at entering a deci-a* ,oint rea**0 *eads to a distinct state Henteringbt$ebfractiona*b,artbofbabnu-ber<H in w$ic$ t$e ca*cu*ator ignores deci-a* ,oints #$is so*ution is su,erior for a nu-ber of reasons #$e *esser reason is t$at it e*i-inates one e1tended state "ariab*e and t$e need to initia*iDe and test it #$e -ore i-,ortant reason is t$at t$e statebased so*ution is -ore robust because t$e conte1t infor-ation is used "er0 *oca**0 (on*0 in t$is ,articu*ar state) and is discarded as soon as it beco-es irre*e"ant Once t$e nu-ber is correct*0 entered< it doesn4t rea**0 -atter for t$e subse@uent o,eration of t$e ca*cu*ator w$et$er t$at nu-ber $ad a deci-a* ,oint #$e state -ac$ine -o"es on to anot$er state and auto-atica**0 HforgetsH t$e ,re"ious conte1t #$e Decimal lag e1tended state "ariab*e< on t$e ot$er $and< H*a0s aroundH we** ,ast t$e ti-e t$e infor-ation beco-es irre*e"ant (and ,er$a,s outdatedc) 3orse< 0ou -ust not forget to reset Decimal lag before entering anot$er nu-ber or t$e f*ag wi** incorrect*0 indicate t$at indeed t$e user once entered t$e deci-a* ,oint< but ,er$a,s t$is $a,,ened in t$e conte1t of t$e !revious nu-ber Ca,turing be$a"ior as t$e @ua*itati"e HstateH $as its disad"antages and *i-itations< too Airst< t$e state and transition to,o*og0 in a state -ac$ine -ust be static and fi1ed at co-,i*e ti-e< w$ic$ can be too *i-iting and inf*e1ib*e Sure< 0ou can easi*0 de"ise Hstate -ac$inesH t$at wou*d -odif0 t$e-se*"es at runti-e (t$is is w$at often actua**0 $a,,ens w$en 0ou tr0 to recode Hs,ag$etti codeH as a state -ac$ine) ;owe"er< t$is is *i?e writing se*f--odif0ing code< w$ic$ indeed was done in t$e ear*0 da0s of ,rogra--ing but was @uic?*0 dis-issed as a genera**0 bad idea Conse@uent*0< HstateH can ca,ture on*0 static as,ects of t$e be$a"ior t$at are ?nown a ,riori and are un*i?e*0 to c$ange in t$e future Aor e1a-,*e< it4s fine to ca,ture t$e entr0 of a deci-a* ,oint in t$e ca*cu*ator as a se,arate state Henteringbt$ebfractiona*b,artbofbabnu-ber<H because a nu-ber can $a"e on*0 one fractiona* ,art< w$ic$ is bot$ ?nown a ,riori and is not *i?e*0 to c$ange in t$e future ;owe"er< i-,*e-enting t$e Hc$ea, ?e0boardH wit$out e1tended state "ariab*es and guard conditions wou*d be ,ractica**0 i-,ossib*e #$is e1a-,*e ,oints to t$e -ain wea?ness of t$e @ua*itati"e Hstate<H w$ic$ si-,*0 cannot store too -uc$ infor-ation (suc$ as t$e wide range of ?e0stro?e counts) E1tended state "ariab*es and guards are t$us a -ec$anis- for adding e1tra runti-e f*e1ibi*it0 to state -ac$ines J(W

- 12) -

Course Notes:

<ctions and transitions


3$en an e"ent instance is dis,atc$ed< t$e state -ac$ine res,onds b0 ,erfor-ing actions< suc$ as c$anging a "ariab*e< ,erfor-ing !FO< in"o?ing a function< generating anot$er e"ent instance< or c$anging to anot$er state >n0 ,ara-eter "a*ues associated wit$ t$e current e"ent are a"ai*ab*e to a** actions direct*0 caused b0 t$at e"ent Switc$ing fro- one state to anot$er is ca**ed state transition< and t$e e"ent t$at causes it is ca**ed t$e triggering e"ent< or si-,*0 t$e trigger !n t$e ?e0board e1a-,*e< if t$e ?e0board is in t$e Hdefau*tH state w$en t$e Ca,s.oc? ?e0 is ,ressed< t$e ?e0board wi** enter t$e Hca,sb*oc?edH state ;owe"er< if t$e ?e0board is a*read0 in t$e Hca,sb*oc?edH state< ,ressing Ca,s.oc? wi** cause a different transitionX fro- t$e Hca,sb*oc?edH to t$e Hdefau*tH state !n bot$ cases< ,ressing Ca,s.oc? is t$e triggering e"ent !n e1tended state -ac$ines< a transition can $a"e a guard< w$ic$ -eans t$at t$e transition can HfireH on*0 if t$e guard e"a*uates to #5=E > state can $a"e -an0 transitions in res,onse to t$e sa-e trigger< as *ong as t$e0 $a"e nono"er*a,,ing guardsG $owe"er< t$is situation cou*d create ,rob*e-s in t$e se@uence of e"a*uation of t$e guards w$en t$e co--on trigger occurs #$e =/. s,ecificationJ1W intentiona**0 does not sti,u*ate an0 ,articu*ar orderG rat$er< =/. ,uts t$e burden on t$e designer to de"ise guards in suc$ a wa0 t$at t$e order of t$eir e"a*uation does not -atter %ractica**0< t$is -eans t$at guard e1,ressions s$ou*d $a"e no side effects< at *east none t$at wou*d a*ter e"a*uation of ot$er guards $a"ing t$e sa-e trigger

3un-to-co,+letion e0ecution ,odel


>** state -ac$ine for-a*is-s< inc*uding =/. state -ac$ines< uni"ersa**0 assu-e t$at a state -ac$ine co-,*etes ,rocessing of eac$ e"ent before it can start ,rocessing t$e ne1t e"ent #$is -ode* of e1ecution is ca**ed run to completion< or 5#C !n t$e 5#C -ode*< t$e s0ste- ,rocesses e"ents in discrete< indi"isib*e 5#C ste,s New inco-ing e"ents cannot interru,t t$e ,rocessing of t$e current e"ent and -ust be stored (t0,ica**0 in an e"ent @ueue) unti* t$e state -ac$ine beco-es id*e again #$ese se-antics co-,*ete*0 a"oid an0 interna* concurrenc0 issues wit$in a sing*e state -ac$ine #$e 5#C -ode* a*so gets around t$e conce,tua* ,rob*e- of ,rocessing actions associated wit$ transitions< w$ere t$e state -ac$ine is not in a we**-defined state (is between two states) for t$e duration of t$e action 8uring e"ent ,rocessing< t$e s0ste- is unres,onsi"e (unobser"ab*e)< so t$e i**-defined state during t$at ti-e $as no ,ractica* significance Note< $owe"er< t$at 5#C does not -ean t$at a state -ac$ine $as to -ono,o*iDe t$e C%= unti* t$e 5#C ste, is co-,*ete J1W #$e ,ree-,tion restriction on*0 a,,*ies to t$e tas? conte1t of t$e state -ac$ine t$at is a*read0 bus0 ,rocessing e"ents !n a -u*titas?ing en"iron-ent< ot$er tas?s (not re*ated to t$e tas? conte1t of t$e bus0 state -ac$ine) can be running< ,ossib*0 ,ree-,ting t$e current*0 e1ecuting state -ac$ine >s *ong as ot$er state -ac$ines do not s$are "ariab*es or ot$er resources wit$ eac$ ot$er< t$ere are no concurrenc0 $aDards #$e ?e0 ad"antage of 5#C ,rocessing is si-,*icit0 !ts biggest disad"antage is t$at t$e res,onsi"eness of a state -ac$ine is deter-ined b0 its *ongest 5#C ste, >c$ie"ing s$ort 5#C ste,s can often significant*0 co-,*icate rea*-ti-e designs

- 12& -

Object-Oriented Software Engineering (CS350)

;.- e0tensions to t$e traditional FS. for,alis,


#$oug$ t$e traditiona* AS/s are an e1ce**ent too* for tac?*ing s-a**er ,rob*e-s< it4s a*so genera**0 ?nown t$at t$e0 tend to beco-e un-anageab*e< e"en for -oderate*0 in"o*"ed s0ste-s 8ue to t$e ,$eno-enon ?nown as state and transition explosion< t$e co-,*e1it0 of a traditiona* AS/ tends to grow -uc$ faster t$an t$e co-,*e1it0 of t$e s0ste- it describes #$is $a,,ens because t$e traditiona* state -ac$ine for-a*is- inf*icts re,etitions Aor e1a-,*e< if 0ou tr0 to re,resent t$e be$a"ior of a si-,*e ,oc?et ca*cu*ator wit$ a traditiona* AS/< 0ou4** i--ediate*0 notice t$at -an0 e"ents (e g < t$e C*ear or Off button ,resses) are $and*ed identica**0 in -an0 states > con"entiona* AS/ s$own in t$e figure be*ow< $as no -eans of ca,turing suc$ a co--ona*it0 and re@uires re!eating t$e sa-e actions and transitions in -an0 states 3$at4s -issing in t$e traditiona* state -ac$ines is t$e -ec$anis- for factoring out t$e co--on be$a"ior in order to s$are it across -an0 states

> ,oc?et ca*cu*ator (*eft) and t$e traditiona* state -ac$ine wit$ -u*ti,*e transitions C*ear and Off (rig$t) =/. state -ac$ines addresses e1act*0 t$is s$ortco-ing of t$e con"entiona* AS/s #$e0 ,ro"ide a nu-ber of features for e*i-inating t$e re,etitions so t$at t$e co-,*e1it0 of a =/. state -ac$ine no *onger e1,*odes but tends to fait$fu**0 re,resent t$e co-,*e1it0 of t$e reacti"e s0ste- it describes Ob"ious*0< t$ese features are "er0 interesting to software de"e*o,ers< because on*0 t$e0 -a?e t$e w$o*e state -ac$ine a,,roac$ tru*0 a,,*icab*e to rea*-*ife ,rob*e-s

9ierarc$icall/ nested states


#$e -ost i-,ortant inno"ation of =/. state -ac$ines o"er t$e traditiona* AS/s is t$e introduction of hierarchically nested states (t$at is w$0 statec$arts are a*so ca**ed hierarchical state machines< or ?&)s) #$e se-antics associated wit$ state nesting are as fo**ows (see Aigure 3): !f a s0ste- is in t$e nested state< for e1a-,*e Hresu*tH (ca**ed t$e substate)< it a*so (i-,*icit*0) is in t$e surrounding state HonH (ca**ed t$e superstate) #$is state -ac$ine wi** atte-,t to $and*e an0 e"ent in t$e conte1t of t$e substate< w$ic$ conce,tua**0 is at t$e *ower *e"e* of t$e $ierarc$0 ;owe"er< if t$e substate Hresu*tH does not ,rescribe $ow to $and*e t$e e"ent< t$e e"ent is not @uiet*0 discarded as in a traditiona* Hf*atH state -ac$ineG rat$er< it is auto-atica**0 $and*ed at t$e $ig$er *e"e* conte1t of t$e su,erstate HonH #$is is w$at is -eant b0 t$e s0ste- being in state Hresu*tH as we** as HonH Of course< state nesting is not - 130 -

Course Notes: *i-ited to one *e"e* on*0< and t$e si-,*e ru*e of e"ent ,rocessing a,,*ies recursi"e*0 to an0 *e"e* of nesting

Aigure 3: > ,oc?et ca*cu*ator (*eft) and t$e =/. state -ac$ine wit$ state nesting (rig$t) States t$at contain ot$er states are ca**ed com!osite statesG con"erse*0< states wit$out interna* structure are ca**ed sim!le states > nested state is ca**ed a direct substate w$en it is not contained b0 an0 ot$er stateG ot$erwise< it is referred to as a transitively nested substate +ecause t$e interna* structure of a co-,osite state can be arbitrari*0 co-,*e1< an0 $ierarc$ica* state -ac$ine can be "iewed as an interna* structure of so-e ($ig$er-*e"e*) co-,osite state !t is conce,tua**0 con"enient to define one co-,osite state as t$e u*ti-ate root of state -ac$ine $ierarc$0 !n t$e =/. s,ecification<J1W e"er0 state -ac$ine $as a top state (t$e abstract root of e"er0 state -ac$ine $ierarc$0)< w$ic$ contains a** t$e ot$er e*e-ents of t$e entire state -ac$ine #$e gra,$ica* rendering of t$is a**-enc*osing to, state is o,tiona* >s 0ou can see< t$e se-antics of $ierarc$ica* state deco-,osition are designed to faci*itate reusing of be$a"ior #$e substates (nested states) need on*0 define t$e differences fro- t$e su,erstates (containing states) > substate can easi*0 in$eritJ'W t$e co--on be$a"ior fro- its su,erstate(s) b0 si-,*0 ignoring co--on*0 $and*ed e"ents< w$ic$ are t$en auto-atica**0 $and*ed b0 $ig$er-*e"e* states !n ot$er words< $ierarc$ica* state nesting enab*es programming by difference J2W #$e as,ect of state $ierarc$0 e-,$asiDed -ost often is abstractionXan o*d and ,owerfu* tec$ni@ue for co,ing wit$ co-,*e1it0 !nstead of facing a** as,ects of a co-,*e1 s0ste- at t$e sa-e ti-e< it is often ,ossib*e to ignore (abstract awa0) so-e ,arts of t$e s0ste- ;ierarc$ica* states are an idea* -ec$anisfor $iding interna* detai*s because t$e designer can easi*0 Doo- out or Doo- in to $ide or s$ow nested states ;owe"er< t$e co-,osite states don4t si-,*0 $ide co-,*e1it0G t$e0 a*so acti"e*0 reduce it t$roug$ t$e ,owerfu* -ec$anis- of $ierarc$ica* e"ent ,rocessing 3it$out suc$ reuse< e"en a -oderate increase in s0ste- co-,*e1it0 often *eads to an e1,*osi"e increase in t$e nu-ber of states and transitions Aor e1a-,*e< t$e $ierarc$ica* state -ac$ine re,resenting t$e ,oc?et ca*cu*ator (Aigure 3) a"oids re,eating t$e transitions C*ear and Off in "irtua**0 e"er0 state >"oiding re,etitions a**ows ;S/s to grow ,ro,ortiona**0 to s0ste- co-,*e1it0 >s t$e -ode*ed s0ste- grows< t$e o,,ortunit0 for reuse a*so increases and t$us counteracts t$e e1,*osi"e increase in states and transitions t0,ica* for traditiona* - 131 -

Object-Oriented Software Engineering (CS350) AS/s

Ort$ogonal regions
;ierarc$ica* state deco-,osition can be "iewed as e1c*usi"e-O5 o,eration a,,*ied to states Aor e1a-,*e< if a s0ste- is in t$e HonH su,erstate (Aigure 3)< it -eans t$at it4s eit$er in Ho,erand1H substate O5 t$e Ho,erand2H substate O5 t$e Ho,EnteredH substate O5 t$e Hresu*tH substate #$at is w$0 t$e HonH su,erstate is ca**ed an O5-state =/. statec$arts a*so introduce t$e co-,*e-entar0 >N8-deco-,osition Suc$ deco-,osition -eans t$at a co-,osite state can contain two or -ore ort$ogona* regions (ort$ogona* -eans inde,endent in t$is conte1t) and t$at being in suc$ a co-,osite state entai*s being in a** its ort$ogona* regions si-u*taneous*0 J)W Ort$ogona* regions address t$e fre@uent ,rob*e- of a co-binatoria* increase in t$e nu-ber of states w$en t$e be$a"ior of a s0ste- is frag-ented into inde,endent< concurrent*0 acti"e ,arts Aor e1a-,*e< a,art fro- t$e -ain ?e0,ad< a co-,uter ?e0board $as an inde,endent nu-eric ?e0,ad Aro- t$e ,re"ious discussion< reca** t$e two states of t$e -ain ?e0,ad a*read0 identified: Hdefau*tH and Hca,sb*oc?edH (see Aigure 1) #$e nu-eric ?e0,ad a*so can be in two statesXHnu-bersH and HarrowsHXde,ending on w$et$er Nu- .oc? is acti"e #$e co-,*ete state s,ace of t$e ?e0board in t$e standard deco-,osition is t$e Cartesian ,roduct of t$e two co-,onents (-ain ?e0,ad and nu-eric ?e0,ad) and consists of four states: Hdefau*tCnu-bers<H Hdefau*tCarrows<H Hca,sb*oc?edCnu-bers<H and Hca,sb*oc?edCarrows H ;owe"er< t$is is unnatura* because t$e be$a"ior of t$e nu-eric ?e0,ad does not de,end on t$e state of t$e -ain ?e0,ad and "ice "ersa Ort$ogona* regions a**ow 0ou to a"oid -i1ing t$e inde,endent be$a"iors as a Cartesian ,roduct and< instead< to ?ee, t$e- se,arate< as s$own in Aigure '

Aigure ': #wo ort$ogona* regions (-ain ?e0,ad and nu-eric ?e0,ad) of a co-,uter ?e0board Note t$at if t$e ort$ogona* regions are fu**0 inde,endent of eac$ ot$er< t$eir co-bined co-,*e1it0 is si-,*0 additi"e< w$ic$ -eans t$at t$e nu-ber of inde,endent states needed to -ode* t$e s0ste- is si-,*0 t$e su- & A l A m A %%%< w$ere &0 l0 m0 %%% denote nu-bers of O5-states in eac$ ort$ogona* region #$e genera* case of -utua* de,endenc0< on t$e ot$er $and< resu*ts in -u*ti,*icati"e co-,*e1it0< so in genera*< t$e nu-ber of states needed is t$e ,roduct & B l B m B %%%

- 132 -

Course Notes: !n -ost rea*-*ife situations< $owe"er< ort$ogona* regions are on*0 a,,ro1i-ate*0 ort$ogona* (i e < t$e0 are not inde,endent) #$erefore< =/. statec$arts ,ro"ide a nu-ber of wa0s for ort$ogona* regions to co--unicate and s0nc$roniDe t$eir be$a"iors Aro- t$ese ric$ sets of (so-eti-es co-,*e1) -ec$anis-s< ,er$a,s t$e -ost i-,ortant is t$at ort$ogona* regions can coordinate t$eir be$a"iors b0 sending e"ent instances to eac$ ot$er E"en t$oug$ ort$ogona* regions i-,*0 inde,endence of e1ecution (i e < so-e ?ind of concurrenc0)< t$e =/. s,ecification does not re@uire t$at a se,arate t$read of e1ecution be assigned to eac$ ort$ogona* region (a*t$oug$ it can be i-,*e-ented t$at wa0) !n fact< -ost co--on*0< ort$ogona* regions e1ecute wit$in t$e sa-e t$read J&W #$e =/. s,ecification on*0 re@uires t$at t$e designer not re*0 on an0 ,articu*ar order in w$ic$ an e"ent instance wi** be dis,atc$ed to t$e in"o*"ed ort$ogona* regions

Entr/ and e0it actions


E"er0 state in a =/. statec$art can $a"e o,tiona* entry actions< w$ic$ are e1ecuted u,on entr0 to a state< as we** as o,tiona* exit actions< w$ic$ are e1ecuted u,on e1it fro- a state Entr0 and e1it actions are associated wit$ states< not transitions 5egard*ess of $ow a state is entered or e1ited< a** its entr0 and e1it actions wi** be e1ecuted +ecause of t$is c$aracteristic< statec$arts be$a"e *i?e /oore -ac$ines #$e =/. notation for state entr0 and e1it actions is to ,*ace t$e reser"ed word Hentr0H (or He1itH) in t$e state rig$t be*ow t$e na-e co-,art-ent< fo**owed b0 t$e forward s*as$ and t$e *ist of arbitrar0 actions (see Aigure 5)

Aigure 5: #oaster o"en state -ac$ine wit$ entr0 and e1it actions #$e "a*ue of entr0 and e1it actions is t$at t$e0 ,ro"ide -eans for guaranteed initiali$ation and cleanu!< "er0 -uc$ *i?e c*ass constructors and destructors in Object-oriented ,rogra--ing Aor e1a-,*e< consider t$e Hdoorbo,enH state fro- Aigure 5< w$ic$ corres,onds to t$e toaster o"en be$a"ior w$i*e t$e door is o,en #$is state $as a "er0 i-,ortant safet0-critica* re@uire-ent: >*wa0s disab*e t$e $eater w$en t$e door is o,en >dditiona**0< w$i*e t$e door is o,en< t$e interna* *a-, i**u-inating t$e o"en s$ou*d *ig$t u,

- 133 -

Object-Oriented Software Engineering (CS350) Of course< 0ou cou*d -ode* suc$ be$a"ior b0 adding a,,ro,riate actions (disab*ing t$e $eater and turning on t$e *ig$t) to e"er0 transition ,at$ *eading to t$e Hdoorbo,enH state (t$e user -a0 o,en t$e door at an0 ti-e during Hba?ingH or HtoastingH or w$en t$e o"en is not used at a**) Pou a*so s$ou*d not forget to e1tinguis$ t$e interna* *a-, wit$ e"er0 transition *ea"ing t$e Hdoorbo,enH state ;owe"er< suc$ a so*ution wou*d cause t$e re,etition of actions in -an0 transitions /ore i-,ortant< suc$ an a,,roac$ is error-,rone in "iew of c$anges to t$e state -ac$ine (e g < t$e ne1t ,rogra--er wor?ing on a new feature< suc$ as to,-browning< -ig$t si-,*0 forget to disab*e t$e $eater on transition to Hdoorbo,enH) Entr0 and e1it actions a**ow 0ou to i-,*e-ent t$e desired be$a"ior in a -uc$ safer< si-,*er< and -ore intuiti"e wa0 >s s$own in Aigure 5< 0ou cou*d s,ecif0 t$at t$e e1it action fro- H$eatingH disab*es t$e $eater< t$e entr0 action to Hdoorbo,enH *ig$ts u, t$e o"en *a-,< and t$e e1it action fro- Hdoorbo,enH e1tinguis$es t$e *a-, #$e use of entr0 and e1it action is su,erior to ,*acing actions on transitions because it a"oids re,etitions of t$ose actions on transitions and e*i-inates t$e basic safet0 $aDard of *ea"ing t$e $eater on w$i*e t$e door is o,en #$e se-antics of e1it actions guarantees t$at< regard*ess of t$e transition ,at$< t$e $eater wi** be disab*ed w$en t$e toaster is not in t$e H$eatingH state +ecause entr0 actions are e1ecuted auto-atica**0 w$ene"er an associated state is entered< t$e0 often deter-ine t$e conditions of o,eration or t$e identit0 of t$e state< "er0 -uc$ as a c*ass constructor deter-ines t$e identit0 of t$e object being constructed Aor e1a-,*e< t$e identit0 of t$e H$eatingH state is deter-ined b0 t$e fact t$at t$e $eater is turned on #$is condition -ust be estab*is$ed before entering an0 substate of H$eatingH because entr0 actions to a substate of H$eating<H *i?e Htoasting<H re*0 on ,ro,er initia*iDation of t$e H$eatingH su,erstate and ,erfor- on*0 t$e differences fro- t$is initia*iDation Conse@uent*0< t$e order of e1ecution of entr0 actions -ust a*wa0s ,roceed fro- t$e outer-ost state to t$e inner-ost state (to,-down) Not sur,rising*0< t$is order is ana*ogous to t$e order in w$ic$ c*ass constructors are in"o?ed Construction of a c*ass a*wa0s starts at t$e "er0 root of t$e c*ass $ierarc$0 and fo**ows t$roug$ a** in$eritance *e"e*s down to t$e c*ass being instantiated #$e e1ecution of e1it actions< w$ic$ corres,onds to destructor in"ocation< ,roceeds in t$e e1act re"erse order (botto--u,)

"nternal transitions
:er0 co--on*0< an e"ent causes on*0 so-e interna* actions to e1ecute but does not *ead to a c$ange of state (state transition) !n t$is case< a** actions e1ecuted co-,rise t$e internal transition Aor e1a-,*e< w$en 0ou t0,e on 0our ?e0board< it res,onds b0 generating different c$aracter codes ;owe"er< un*ess 0ou $it t$e Ca,s .oc? ?e0< t$e state of t$e ?e0board does not c$ange (no state transition occurs) !n =/.< t$is situation s$ou*d be -ode*ed wit$ interna* transitions< as s$own in Aigure ( #$e =/. notation for interna* transitions fo**ows t$e genera* s0nta1 used for e1it (or entr0) actions< e1ce,t instead of t$e word entr0 (or e1it) t$e interna* transition is *abe*ed wit$ t$e triggering e"ent (e g < see t$e interna* transition triggered b0 t$e >NPbSEP e"ent in Aigure ()

- 13' -

Course Notes:

Aigure (: =/. state diagra- of t$e ?e0board state -ac$ine wit$ interna* transitions !n t$e absence of entr0 and e1it actions< interna* transitions wou*d be identica* to self(transitions (transitions in w$ic$ t$e target state is t$e sa-e as t$e source state) !n fact< in a c*assica* /ea*0 -ac$ine< actions are associated e1c*usi"e*0 wit$ state transitions< so t$e on*0 wa0 to e1ecute actions wit$out c$anging state is t$roug$ a se*f-transition (de,icted as a directed *oo, in Aigure 1 fro- t$e to, of t$is artic*e) ;owe"er< in t$e ,resence of entr0 and e1it actions< as in =/. statec$arts< a se*ftransition in"o*"es t$e e1ecution of e1it and entr0 actions and t$erefore it is distincti"e*0 different froan interna* transition !n contrast to a se*f-transition< no entr0 or e1it actions are e"er e1ecuted as a resu*t of an interna* transition< e"en if t$e interna* transition is in$erited fro- a $ig$er *e"e* of t$e $ierarc$0 t$an t$e current*0 acti"e state !nterna* transitions in$erited fro- su,erstates at an0 *e"e* of nesting act as if t$e0 were defined direct*0 in t$e current*0 acti"e state

ransition e0ecution se>uence


State nesting co-bined wit$ entr0 and e1it actions significant*0 co-,*icates t$e state transition se-antics in ;S/s co-,ared to t$e traditiona* AS/s 3$en dea*ing wit$ $ierarc$ica**0 nested states and ort$ogona* regions< t$e si-,*e ter- current state can be @uite confusing !n an ;S/< -ore t$an one state can be acti"e at once !f t$e state -ac$ine is in a *eaf state t$at is contained in a co-,osite state (w$ic$ is ,ossib*0 contained in a $ig$er-*e"e* co-,osite state< and so on)< a** t$e co-,osite states t$at eit$er direct*0 or transiti"e*0 contain t$e *eaf state are a*so acti"e Aurt$er-ore< because so-e of t$e co-,osite states in t$is $ierarc$0 -ig$t $a"e ort$ogona* regions< t$e current acti"e state is actua**0 re,resented b0 a tree of states starting wit$ t$e sing*e to, state at t$e root down to indi"idua* si-,*e states at t$e *ea"es #$e =/. s,ecification refers to suc$ a state tree as state configuration J1W

- 135 -

Object-Oriented Software Engineering (CS350)

Aigure 2: State ro*es in a state transition !n =/.< a state transition can direct*0 connect an0 two states #$ese two states< w$ic$ -a0 be co-,osite< are designated as t$e main source and t$e main target of a transition Aigure 2 s$ows a si-,*e transition e1a-,*e and e1,*ains t$e state ro*es in t$at transition #$e =/. s,ecification ,rescribes t$at ta?ing a state transition in"o*"es e1ecuting t$e fo**owing actions in t$e fo**owing se@uence (see Section 15 3 1' in @M8 3nified Modeling :anguage (@M8 3M:)0 *nfrastructure >ersion 2%2J1W): 1 E"a*uate t$e guard condition associated wit$ t$e transition and ,erfor- t$e fo**owing ste,s on*0 if t$e guard e"a*uates to #5=E 2 E1it t$e source state configuration 3 E1ecute t$e actions associated wit$ t$e transition ' Enter t$e target state configuration #$e transition se@uence is eas0 to inter,ret in t$e si-,*e case of bot$ t$e -ain source and t$e -ain target nesting at t$e sa-e *e"e* Aor e1a-,*e< transition #1 s$own in Aigure 2 causes t$e e"a*uation of t$e guard g()G fo**owed b0 t$e se@uence of actions: a!"# b!"# t!"# c!"# d!"# and e!"G assu-ing t$at t$e guard g!" e"a*uates to #5=E ;owe"er< in t$e genera* case of source and target states nested at different *e"e*s of t$e state $ierarc$0< it -ig$t not be i--ediate*0 ob"ious $ow -an0 *e"e*s of nesting need to be e1ited #$e =/. s,ecificationJ1W ,rescribes t$at a transition in"o*"es e1iting a** nested states fro- t$e current acti"e state (w$ic$ -ig$t be a direct or transiti"e substate of t$e -ain source state) u, to< but not inc*uding< t$e least common ancestor (.C>) state of t$e -ain source and -ain target states >s t$e na-e indicates< t$e .C> is t$e *owest co-,osite state t$at is si-u*taneous*0 a su,erstate (ancestor) of bot$ t$e source and t$e target states >s described before< t$e order of e1ecution of e1it actions is a*wa0s fro- t$e -ost dee,*0 nested state (t$e current acti"e state) u, t$e $ierarc$0 to t$e .C> but wit$out e1iting t$e .C> Aor instance< t$e .C>(s1<s2) of states Hs1H and Hs2H s$own in Aigure 2 is state Hs H Entering t$e target state configuration co--ences fro- t$e *e"e* w$ere t$e e1it actions *eft off (i e < fro- inside t$e .C>) >s described before< entr0 actions -ust be e1ecuted starting fro- t$e $ig$est*e"e* state down t$e state $ierarc$0 to t$e -ain target state !f t$e -ain target state is co-,osite< t$e =/. se-antics ,rescribes to Hdri**H into its sub-ac$ine recursi"e*0 using t$e *oca* initia* transitions #$e target state configuration is co-,*ete*0 entered on*0 after encountering a *eaf state t$at $as no initia* transitions - 13( -

Course Notes:

-ocal #ersus e0ternal transitions


+efore =/. 2<J1W t$e on*0 transition se-antics in use was t$e external transition< in w$ic$ t$e -ain source of t$e transition is a*wa0s e1ited and t$e -ain target of t$e transition is a*wa0s entered =/. 2 ,reser"ed t$e He1terna* transitionH se-antics for bac?ward co-,atibi*it0< but introduced a*so a new ?ind of transition ca**ed local transition (see Section 15 3 15 in 3nified Modeling :anguage (3M:)0 *nfrastructure >ersion 2%2J1W) Aor -an0 transition to,o*ogies< e1terna* and *oca* transitions are actua**0 identica* ;owe"er< a *oca* transition doesnOt cause e1it fro- and reentr0 to t$e -ain source state if t$e -ain target state is a substate of t$e -ain source !n addition< a *oca* state transition doesnOt cause e1it fro- and reentr0 to t$e -ain target state if t$e -ain target is a su,erstate of t$e -ain source state

Aigure ): .oca* (a) "ersus e1terna* transitions (b) Aigure ) contrasts *oca* (a) and e1terna* (b) transitions !n t$e to, row< 0ou see t$e case of t$e -ain source containing t$e -ain target #$e *oca* transition does not cause e1it fro- t$e source< w$i*e t$e e1terna* transition causes e1it and reentr0 to t$e source !n t$e botto- row of Aigure )< 0ou see t$e case of t$e -ain target containing t$e -ain source #$e *oca* transition does not cause entr0 to t$e target< w$ereas t$e e1terna* transition causes e1it and reentr0 to t$e target

E#ent deferral
So-eti-es an e"ent arri"es at a ,articu*ar*0 incon"enient ti-e< w$en a state -ac$ine is in a state t$at cannot $and*e t$e e"ent !n -an0 cases< t$e nature of t$e e"ent is suc$ t$at it can be ,ost,oned (wit$in *i-its) unti* t$e s0ste- enters anot$er state< in w$ic$ it is better ,re,ared to $and*e t$e origina* e"ent =/. state -ac$ines ,ro"ide a s,ecia* -ec$anis- for deferring events in states !n e"er0 state< 0ou can inc*ude a c*ause [event li$t]/de%er !f an e"ent in t$e current stateOs deferred e"ent *ist occurs< t$e e"ent wi** be sa"ed (deferred) for future ,rocessing unti* a state is entered t$at does not *ist t$e e"ent in its deferred e"ent *ist =,on entr0 to suc$ a state< t$e =/. state -ac$ine wi** auto-atica**0 reca** an0 sa"ed e"ent(s) t$at are no *onger deferred and wi** t$en eit$er consu-e or discard t$ese e"ents !t is ,ossib*e for a su,erstate to $a"e a transition defined on an e"ent t$at is deferred b0 a substate Consistent wit$ ot$er areas in t$e s,ecification of =/. state -ac$ines< t$e substate ta?es ,recedence o"er t$e su,erstate< t$e e"ent wi** be deferred and t$e transition for t$e su,erstate wi** not be e1ecuted !n t$e case of ort$ogona* regions w$ere one ort$ogona* region defers - 132 -

Object-Oriented Software Engineering (CS350) an e"ent and anot$er consu-es t$e e"ent< t$e consu-er ta?es ,recedence and t$e e"ent is consu-ed and not deferred

$e li,itations of ;.- state ,ac$ines


;are* statec$arts< w$ic$ are t$e ,recursors of =/. state -ac$ines< $a"e been in"ented as Ha "isua* for-a*is- for co-,*e1 s0ste-sH<J2W so fro- t$eir ince,tion< t$e0 $a"e been inse,arab*0 associated wit$ gra,$ica* re,resentation in t$e for- of state diagra-s ;owe"er< it is i-,ortant to understand t$at t$e conce,t of =/. state -ac$ine transcends an0 ,articu*ar notation< gra,$ica* or te1tua* #$e =/. s,ecificationJ1W -a?es t$is distinction a,,arent b0 c*ear*0 se,arating state -ac$ine se-antics fro- t$e notation ;owe"er< t$e notation of =/. statec$arts is not ,ure*0 "isua* >n0 nontri"ia* state -ac$ine re@uires a *arge a-ount of te1tua* infor-ation (e g < t$e s,ecification of actions and guards) #$e e1act s0nta1 of action and guard e1,ressions isnOt defined in t$e =/. s,ecification< so -an0 ,eo,*e use eit$er structured Eng*is$ or< -ore for-a**0< e1,ressions in an i-,*e-entation *anguage suc$ as C< CBB< or Ia"a J10W !n ,ractice< t$is -eans t$at =/. statec$art notation de,ends $ea"i*0 on t$e s,ecific ,rogra--ing *anguage Ne"ert$e*ess< -ost of t$e statec$arts se-antics are $ea"i*0 biased toward gra,$ica* notation Aor e1a-,*e< state diagra-s ,oor*0 re,resent t$e se@uence of ,rocessing< be it order of e"a*uation of guards or order of dis,atc$ing e"ents to ort$ogona* regions #$e =/. s,ecification sideste,s t$ese ,rob*e-s b0 ,utting t$e burden on t$e designer not to re*0 on an0 ,articu*ar se@uencing +ut< w$en 0ou actua**0 i-,*e-ent =/. state -ac$ines< 0ou wi** a*wa0s $a"e fu** contro* o"er t$e order of e1ecution< so t$e restrictions i-,osed b0 =/. se-antics wi** be unnecessari*0 restricti"e Si-i*ar*0< statec$art diagra-s re@uire a *ot of ,*u-bing gear (,seudostates< *i?e joins< for?s< junctions< c$oice,oints< etc ) to re,resent t$e f*ow of contro* gra,$ica**0 #$ese e*e-ents are essentia**0 t$e o*d f*owc$art in disguise< w$ic$ structured ,rogra--ing tec$ni@ues ,ro"ed far *ess significant a *ong ti-e ago !n ot$er words< t$ese e*e-ents of t$e gra,$ica* notation do not add -uc$ "a*ue in re,resenting f*ow of contro* as co-,ared to ,*ain structured code #$e =/. notation and se-antics are rea**0 geared toward co-,uteriDed =/. too*s > =/. state -ac$ine< as re,resented in a too*< is not just t$e state diagra-< but rat$er a -i1ture of gra,$ica* and te1tua* re,resentation t$at ,recise*0 ca,tures bot$ t$e state to,o*og0 and t$e actions #$e users of t$e too* can get se"era* co-,*e-entar0 "iews of t$e sa-e state -ac$ine< bot$ "isua* and te1tua*< w$ereas t$e generated code is just one of t$e -an0 a"ai*ab*e "iews

Data models
> $ig$-*e"e* data model in business or for an0 functiona* area is an abstract -ode* t$at docu-ents and organiDes t$e business data for co--unication between functiona* and tec$nica* ,eo,*e !t is used to s$ow t$e data needed and created b0 business ,rocesses > data model in software engineering is an abstract -ode* t$at docu-ents and organiDes t$e business data for co--unication between tea- -e-bers and is used as a ,*an for de"e*o,ing a,,*ications< s,ecifica**0 $ow data are stored and accessed

- 13) -

Course Notes: >ccording to ;ober-an (200&)< H> data -ode* is a wa0finding too* for bot$ business and !# ,rofessiona*s< w$ic$ uses a set of s0-bo*s and te1t to ,recise*0 e1,*ain a subset of rea* infor-ation to i-,ro"e co--unication wit$in t$e organiDation and t$ereb0 *ead to a -ore f*e1ib*e and stab*e a,,*ication en"iron-ent HJ2W > data -ode* e1,*icit*0 deter-ines t$e structure of data or structured data #0,ica* a,,*ications of data -ode*s inc*ude database -ode*s< design of infor-ation s0ste-s< and enab*ing e1c$ange of data =sua**0 data -ode*s are s,ecified in a data -ode*ing *anguage J3W Co--unication and ,recision are t$e two ?e0 benefits t$at -a?e a data -ode* i-,ortant to a,,*ications t$at use and e1c$ange data > data -ode* is t$e -ediu- w$ic$ ,roject tea- -e-bers frodifferent bac?grounds and wit$ different *e"e*s of e1,erience can co--unicate wit$ one anot$er %recision -eans t$at t$e ter-s and ru*es on a data -ode* can be inter,reted on*0 one wa0 and are not a-biguous J2W > data -ode* can be so-eti-es referred to as a data structure< es,ecia**0 in t$e conte1t of ,rogra--ing *anguages 8ata -ode*s are often co-,*e-ented b0 function -ode*s< es,ecia**0 in t$e conte1t of enter,rise -ode*s

O#er#iew
/anaging *arge @uantities of structured and unstructured data is a ,ri-ar0 function of infor-ation s0ste-s 8ata -ode*s describe structured data for storage in data -anage-ent s0ste-s suc$ as re*ationa* databases #$e0 t0,ica**0 do not describe unstructured data< suc$ as word ,rocessing docu-ents< e-ai* -essages< ,ictures< digita* audio< and "ideo

$e role of data ,odels

;ow data -ode*s de*i"er benefit J'W #$e -ain ai- of data -ode*s is to su,,ort t$e de"e*o,-ent of infor-ation s0ste-s b0 ,ro"iding t$e definition and for-at of data >ccording to 3est and Aow*er (1&&&) Hif t$is is done consistent*0 across s0ste-s t$en co-,atibi*it0 of data can be ac$ie"ed !f t$e sa-e data structures are used to store and access data t$en different a,,*ications can s$are data #$e resu*ts of t$is are indicated abo"e ;owe"er< s0ste-s and interfaces often cost -ore t$an t$e0 s$ou*d< to bui*d< o,erate< and -aintain #$e0 -a0 a*so constrain t$e business rat$er t$an su,,ort it > -ajor cause is t$at t$e @ua*it0 of t$e data -ode*s - 13& -

Object-Oriented Software Engineering (CS350) i-,*e-ented in s0ste-s and interfaces is ,oorH J'W H+usiness ru*es< s,ecific to $ow t$ings are done in a ,articu*ar ,*ace< are often fi1ed in t$e structure of a data -ode* #$is -eans t$at s-a** c$anges in t$e wa0 business is conducted *ead to *arge c$anges in co-,uter s0ste-s and interfacesH J'W HEntit0 t0,es are often not identified< or incorrect*0 identified #$is can *ead to re,*ication of data< data structure< and functiona*it0< toget$er wit$ t$e attendant costs of t$at du,*ication in de"e*o,-ent and -aintenanceH J'W H8ata -ode*s for different s0ste-s are arbitrari*0 different #$e resu*t of t$is is t$at co-,*e1 interfaces are re@uired between s0ste-s t$at s$are data #$ese interfaces can account for between 25-20N of t$e cost of current s0ste-sH J'W H8ata cannot be s$ared e*ectronica**0 wit$ custo-ers and su,,*iers< because t$e structure and -eaning of data $as not been standardised Aor e1a-,*e< engineering design data and drawings for ,rocess ,*ant are sti** so-eti-es e1c$anged on ,a,erH J'W #$e reason for t$ese ,rob*e-s is a *ac? of standards t$at wi** ensure t$at data -ode*s wi** bot$ -eet business needs and be consistent J'W >ccording to ;ober-an (200&)< H> data -ode* is a wa0finding too* for bot$ business and !# ,rofessiona*s< w$ic$ uses a set of s0-bo*s and te1t to ,recise*0 e1,*ain a subset of rea* infor-ation to i-,ro"e co--unication wit$in t$e organiDation and t$ereb0 *ead to a -ore f*e1ib*e and stab*e a,,*ication en"iron-ent HJ2W > data -ode* e1,*icit*0 deter-ines t$e structure of data or structured data #0,ica* a,,*ications of data -ode*s inc*ude database -ode*s< design of infor-ation s0ste-s< and enab*ing e1c$ange of data =sua**0 data -ode*s are s,ecified in a data -ode*ing *anguage J3W Co--unication and ,recision are t$e two ?e0 benefits t$at -a?e a data -ode* i-,ortant to a,,*ications t$at use and e1c$ange data > data -ode* is t$e -ediu- w$ic$ ,roject tea- -e-bers frodifferent bac?grounds and wit$ different *e"e*s of e1,erience can co--unicate wit$ one anot$er %recision -eans t$at t$e ter-s and ru*es on a data -ode* can be inter,reted on*0 one wa0 and are not a-biguous J2W > data -ode* can be so-eti-es referred to as a data structure< es,ecia**0 in t$e conte1t of ,rogra--ing *anguages 8ata -ode*s are often co-,*e-ented b0 function -ode*s< es,ecia**0 in t$e conte1t of enter,rise -ode*s

- 1'0 -

Course Notes:

$ree +ers+ecti#es

#$e >NS!FS%>5C t$ree *e"e* arc$itecture #$is s$ows t$at a data -ode* can be an e1terna* -ode* (or "iew)< a conce,tua* -ode*< or a ,$0sica* -ode* #$is is not t$e on*0 wa0 to *oo? at data -ode*s< but it is a usefu* wa0< ,articu*ar*0 w$en co-,aring -ode*s J'W > data -ode* instance -a0 be one of t$ree ?inds according to >NS! in 1&25:J5W Conce,tua* sc$e-a : describes t$e se-antics of a do-ain< being t$e sco,e of t$e -ode* Aor e1a-,*e< it -a0 be a -ode* of t$e interest area of an organiDation or industr0 #$is consists of entit0 c*asses< re,resenting ?inds of t$ings of significance in t$e do-ain< and re*ations$i,s assertions about associations between ,airs of entit0 c*asses > conce,tua* sc$e-a s,ecifies t$e ?inds of facts or ,ro,ositions t$at can be e1,ressed using t$e -ode* !n t$at sense< it defines t$e a**owed e1,ressions in an artificia* 4*anguage4 wit$ a sco,e t$at is *i-ited b0 t$e sco,e of t$e -ode* #$e use of conce,tua* sc$e-a $as e"o*"ed to beco-e a ,owerfu* co--unication too* wit$ business users Often ca**ed a subject area -ode* (S>/) or $ig$-*e"e* data -ode* (;8/)< t$is -ode* is used to co--unicate core data conce,ts< ru*es< and definitions to a business user as ,art of an o"era** a,,*ication de"e*o,-ent or enter,rise initiati"e #$e nu-ber of objects s$ou*d be "er0 s-a** and focused on ?e0 conce,ts #r0 to *i-it t$is -ode* to one ,age< a*t$oug$ for e1tre-e*0 *arge organiDations or co-,*e1 ,rojects< t$e -ode* -ig$t s,an two or -ore ,ages J(W .ogica* sc$e-a : describes t$e se-antics< as re,resented b0 a ,articu*ar data -ani,u*ation tec$no*og0 #$is consists of descri,tions of tab*es and co*u-ns< object oriented c*asses< and T/. tags< a-ong ot$er t$ings %$0sica* sc$e-a : describes t$e ,$0sica* -eans b0 w$ic$ data are stored #$is is concerned wit$ ,artitions< C%=s< tab*es,aces< and t$e *i?e #$e significance of t$is a,,roac$< according to >NS!< is t$at it a**ows t$e t$ree ,ers,ecti"es to be re*ati"e*0 inde,endent of eac$ ot$er Storage tec$no*og0 can c$ange wit$out affecting eit$er t$e *ogica* or t$e conce,tua* -ode* #$e tab*eFco*u-n structure can c$ange wit$out (necessari*0) affecting t$e conce,tua* -ode* !n eac$ case< of course< t$e structures -ust re-ain consistent wit$ t$e ot$er -ode* #$e tab*eFco*u-n structure -a0 be different fro- a direct trans*ation of t$e entit0 c*asses and attributes< but it -ust u*ti-ate*0 carr0 out t$e objecti"es of t$e conce,tua* entit0 c*ass structure Ear*0 ,$ases of -an0 software de"e*o,-ent ,rojects e-,$asiDe t$e design of a conce,tua* data -ode* Suc$ a design - 1'1 -

Object-Oriented Software Engineering (CS350) can be detai*ed into a *ogica* data -ode* !n *ater stages< t$is -ode* -a0 be trans*ated into ,$0sica* data -ode* ;owe"er< it is a*so ,ossib*e to i-,*e-ent a conce,tua* -ode* direct*0

9istor/
One of t$e ear*iest ,ioneering wor?s in -ode**ing infor-ation s0ste-s was done b0 Poung and Sent (1&5))<J2WJ)W w$o argued for Ha ,recise and abstract wa0 of s,ecif0ing t$e infor-ationa* and ti-e c$aracteristics of a data ,rocessing ,rob*e-H #$e0 wanted to create Ha notation t$at s$ou*d enab*e t$e ana*0st to organiDe t$e ,rob*e- around an0 ,iece of $ardwareH #$eir wor? was a first effort to create an abstract s,ecification and in"ariant basis for designing different a*ternati"e i-,*e-entations using different $ardware co-,onents > ne1t ste, in !S -ode**ing was ta?en b0 CO8>SP.< an !# industr0 consortiu- for-ed in 1&5&< w$o essentia**0 ai-ed at t$e sa-e t$ing as Poung and Sent: t$e de"e*o,-ent of Ha ,ro,er structure for -ac$ine inde,endent ,rob*e- definition *anguage< at t$e s0ste*e"e* of data ,rocessingH #$is *ed to t$e de"e*o,-ent of a s,ecific !S infor-ation a*gebra J)W !n t$e 1&(0s data -ode*ing gained -ore significance wit$ t$e initiation of t$e -anage-ent infor-ation s0ste- (/!S) conce,t >ccording to .eondes (2002)< Hduring t$at ti-e< t$e infor-ation s0ste,ro"ided t$e data and infor-ation for -anage-ent ,ur,oses #$e first generation database s0ste-< ca**ed !ntegrated 8ata Store (!8S)< was designed b0 C$ar*es +ac$-an at 7enera* E*ectric #wo fa-ous database -ode*s< t$e networ? data -ode* and t$e $ierarc$ica* data -ode*< were ,ro,osed during t$is ,eriod of ti-eH J&W #owards t$e end of t$e 1&(0s Edgar A Codd wor?ed out $is t$eories of data arrange-ent< and ,ro,osed t$e re*ationa* -ode* for database -anage-ent based on first-order ,redicate *ogic J10W !n t$e 1&20s entit0 re*ations$i, -ode*ing e-erged as a new t0,e of conce,tua* data -ode*ing< origina**0 ,ro,osed in 1&2( b0 %eter C$en Entit0 re*ations$i, -ode*s were being used in t$e first stage of infor-ation s0ste- design during t$e re@uire-ents ana*0sis to describe infor-ation needs or t$e t0,e of infor-ation t$at is to be stored in a database #$is tec$ni@ue can describe an0 onto*og0< i e < an o"er"iew and c*assification of conce,ts and t$eir re*ations$i,s< for a certain area of interest !n t$e 1&20s 7 / Nijssen de"e*o,ed HNatura* .anguage !nfor-ation >na*0sis /et$odH (N!>/) -et$od< and de"e*o,ed t$is in t$e 1&)0s in coo,eration wit$ #err0 ;a*,in into Object-5o*e /ode*ing (O5/) Aurt$er in t$e 1&)0s according to Ian . ;arrington (2000) Ht$e de"e*o,-ent of t$e object-oriented ,aradig- broug$t about a funda-enta* c$ange in t$e wa0 we *oo? at data and t$e ,rocedures t$at o,erate on data #raditiona**0< data and ,rocedures $a"e been stored se,arate*0: t$e data and t$eir re*ations$i, in a database< t$e ,rocedures in an a,,*ication ,rogra- Object orientation< $owe"er< co-bined an entit04s ,rocedure wit$ its data HJ11W

/+es of data ,odels


Database model /ain artic*e: 8atabase -ode*

- 1'2 -

Course Notes: > database -ode* is a t$eor0 or s,ecification describing $ow a database is structured and used Se"era* suc$ -ode*s $a"e been suggested Co--on -ode*s inc*ude:

A*at -ode* Networ? -ode*

;ierarc$ica* -ode* 5e*ationa* -ode*

A*at -ode*: #$is -a0 not strict*0 @ua*if0 as a data -ode* #$e f*at (or tab*e) -ode* consists of a sing*e< two-di-ensiona* arra0 of data e*e-ents< w$ere a** -e-bers of a gi"en co*u-n are assu-ed to be si-i*ar "a*ues< and a** -e-bers of a row are assu-ed to be re*ated to one anot$er ;ierarc$ica* -ode*: !n t$is -ode* data is organiDed into a tree-*i?e structure< i-,*0ing a sing*e u,ward *in? in eac$ record to describe t$e nesting< and a sort fie*d to ?ee, t$e records in a ,articu*ar order in eac$ sa-e-*e"e* *ist Networ? -ode*: #$is -ode* organiDes data using two funda-enta* constructs< ca**ed records and sets 5ecords contain fie*ds< and sets define one-to--an0 re*ations$i,s between records: one owner< -an0 -e-bers 5e*ationa* -ode*: is a database -ode* based on first-order ,redicate *ogic !ts core idea is to describe a database as a co**ection of ,redicates o"er a finite set of ,redicate "ariab*es< describing constraints on t$e ,ossib*e "a*ues and co-binations of "a*ues Conce,t-oriented -ode*

- 1'3 -

Object-Oriented Software Engineering (CS350) Star sc$e-a

Object-re*ationa* -ode*: Si-i*ar to a re*ationa* database -ode*< but objects< c*asses and in$eritance are direct*0 su,,orted in database sc$e-as and in t$e @uer0 *anguage Star sc$e-a is t$e si-,*est st0*e of data ware$ouse sc$e-a #$e star sc$e-a consists of a few Hfact tab*esH (,ossib*0 on*0 one< justif0ing t$e na-e) referencing an0 nu-ber of Hdi-ension tab*esH #$e star sc$e-a is considered an i-,ortant s,ecia* case of t$e snowf*a?e sc$e-a Data Structure Diagram

E1a-,*e of a 8ata Structure 8iagra> data structure diagra- (8S8) is a diagra- and data -ode* used to describe conce,tua* data -ode*s b0 ,ro"iding gra,$ica* notations w$ic$ docu-ent entities and t$eir re*ations$i,s< and t$e constraints t$at bind t$e- #$e basic gra,$ic e*e-ents of 8S8s are bo1es< re,resenting entities< and arrows< re,resenting re*ations$i,s 8ata structure diagra-s are -ost usefu* for docu-enting co-,*e1 data entities

- 1'' -

Course Notes: 8ata structure diagra-s are an e1tension of t$e entit0-re*ations$i, -ode* (E5 -ode*) !n 8S8s< attributes are s,ecified inside t$e entit0 bo1es rat$er t$an outside of t$e-< w$i*e re*ations$i,s are drawn as bo1es co-,osed of attributes w$ic$ s,ecif0 t$e constraints t$at bind entities toget$er #$e E5 -ode*< w$i*e robust< doesn4t ,ro"ide a wa0 to s,ecif0 t$e constraints between re*ations$i,s< and beco-es "isua**0 cu-berso-e w$en re,resenting entities wit$ se"era* attributes 8S8s differ fro- t$e E5 -ode* in t$at t$e E5 -ode* focuses on t$e re*ations$i,s between different entities< w$ereas 8S8s focus on t$e re*ations$i,s of t$e e*e-ents wit$in an entit0 and enab*e users to fu**0 see t$e *in?s and re*ations$i,s between eac$ entit0 #$ere are se"era* st0*es for re,resenting data structure diagra-s< wit$ t$e notab*e difference in t$e -anner of defining cardina*it0 #$e c$oices are between arrow $eads< in"erted arrow $eads (crow4s feet)< or nu-erica* re,resentation of t$e cardina*it0

E1a-,*e of a !8EA1T Entit0 re*ations$i, diagra-s used to -ode* !8EA1T itse*f J12W Entity-relationship model /ain artic*e: Entit0-re*ations$i, -ode* >n entit0-re*ations$i, -ode* (E5/) is an abstract conce,tua* data -ode* (or se-antic data -ode*) used in software engineering to re,resent structured data #$ere are se"era* notations used for E5/s 4eographic data model /ain artic*e: 8ata -ode* (7!S) > data -ode* in 7eogra,$ic infor-ation s0ste-s is a -at$e-atica* construct for re,resenting geogra,$ic objects or surfaces as data Aor e1a-,*e< t$e "ector data -ode* re,resents geogra,$0 as co**ections of ,oints< *ines< and ,o*0gonsG t$e raster data -ode* re,resent geogra,$0 as ce** -atri1es t$at store nu-eric "a*uesG and t$e #riangu*ated irregu*ar networ? (#!N) data -ode* re,resents geogra,$0 as sets of contiguous< nono"er*a,,ing triang*es J13W

- 1'5 -

Object-Oriented Software Engineering (CS350)

7rou,s re*ate to ,rocess of -a?ing a -a,J1'W

N7/8+ databases *in?ed toget$erJ1'W

N7/8+ data -ode* a,,*icationsJ1'W 4eneric data model /ain artic*e: 7eneric data -ode*

5e,resenting 38 -a, infor-ationJ1'W

7eneric data -ode*s are genera*iDations of con"entiona* data -ode*s #$e0 define standardised genera* re*ation t0,es< toget$er wit$ t$e ?inds of t$ings t$at -a0 be re*ated b0 suc$ a re*ation t0,e 7eneric data -ode*s are de"e*o,ed as an a,,roac$ to so*"e so-e s$ortco-ings of con"entiona* data -ode*s Aor e1a-,*e< different -ode*ers usua**0 ,roduce different con"entiona* data -ode*s of t$e sa-e do-ain #$is can *ead to difficu*t0 in bringing t$e -ode*s of different ,eo,*e toget$er and is an obstac*e for data e1c$ange and data integration !n"ariab*0< $owe"er< t$is difference is attributab*e to different *e"e*s of abstraction in t$e -ode*s and differences in t$e ?inds of facts t$at can be instantiated (t$e se-antic e1,ression ca,abi*ities of t$e -ode*s) #$e -ode*ers need to co--unicate and agree on certain e*e-ents w$ic$ are to be rendered -ore concrete*0< in order to -a?e t$e differences *ess significant Semantic data model

Se-antic data -ode*s J12W - 1'( -

Course Notes: > se-antic data -ode* in software engineering is a tec$ni@ue to define t$e -eaning of data wit$in t$e conte1t of its interre*ations$i,s wit$ ot$er data > se-antic data -ode* is an abstraction w$ic$ defines $ow t$e stored s0-bo*s re*ate to t$e rea* wor*d J12W > se-antic data -ode* is so-eti-es ca**ed a conce,tua* data -ode* #$e *ogica* data structure of a database -anage-ent s0ste- (8+/S)< w$et$er $ierarc$ica*< networ?< or re*ationa*< cannot tota**0 satisf0 t$e re@uire-ents for a conce,tua* definition of data because it is *i-ited in sco,e and biased toward t$e i-,*e-entation strateg0 e-,*o0ed b0 t$e 8+/S #$erefore< t$e need to define data fro- a conce,tua* "iew $as *ed to t$e de"e*o,-ent of se-antic data -ode*ing tec$ni@ues #$at is< tec$ni@ues to define t$e -eaning of data wit$in t$e conte1t of its interre*ations$i,s wit$ ot$er data >s i**ustrated in t$e figure #$e rea* wor*d< in ter-s of resources< ideas< e"ents< etc < are s0-bo*ica**0 defined wit$in ,$0sica* data stores > se-antic data -ode* is an abstraction w$ic$ defines $ow t$e stored s0-bo*s re*ate to t$e rea* wor*d #$us< t$e -ode* -ust be a true re,resentation of t$e rea* wor*d J12W

6ata ,odel to+ics


Data architecture /ain artic*e: 8ata arc$itecture 8ata arc$itecture is t$e design of data for use in defining t$e target state and t$e subse@uent ,*anning needed to $it t$e target state !t is usua**0 one of se"era* arc$itecture do-ains t$at for- t$e ,i**ars of an enter,rise arc$itecture or so*ution arc$itecture > data arc$itecture describes t$e data structures used b0 a business andFor its a,,*ications #$ere are descri,tions of data in storage and data in -otionG descri,tions of data stores< data grou,s and data ite-sG and -a,,ings of t$ose data artifacts to data @ua*ities< a,,*ications< *ocations etc Essentia* to rea*iDing t$e target state< 8ata arc$itecture describes $ow data is ,rocessed< stored< and uti*iDed in a gi"en s0ste- !t ,ro"ides criteria for data ,rocessing o,erations t$at -a?e it ,ossib*e to design data f*ows and a*so contro* t$e f*ow of data in t$e s0steData modeling

- 1'2 -

Object-Oriented Software Engineering (CS350)

#$e data -ode*ing ,rocess 8ata -ode*ing in software engineering is t$e ,rocess of creating a data -ode* b0 a,,*0ing for-a* data -ode* descri,tions using data -ode*ing tec$ni@ues 8ata -ode*ing is a tec$ni@ue for defining business re@uire-ents for a database !t is so-eti-es ca**ed database modeling because a data -ode* is e"entua**0 i-,*e-ented in a database J15W #$e figure i**ustrates t$e wa0 data -ode*s are de"e*o,ed and used toda0 > conce,tua* data -ode* is de"e*o,ed based on t$e data re@uire-ents for t$e a,,*ication t$at is being de"e*o,ed< ,er$a,s in t$e conte1t of an acti"it0 -ode* #$e data -ode* wi** nor-a**0 consist of entit0 t0,es< attributes< re*ations$i,s< integrit0 ru*es< and t$e definitions of t$ose objects #$is is t$en used as t$e start ,oint for interface or database design J'W Data properties So-e i-,ortant ,ro,erties of data for w$ic$ re@uire-ents need to be -et are: definition-re*ated ,ro,ertiesJ'W relevance: t$e usefu*ness of t$e data in t$e conte1t of 0our business clarity: t$e a"ai*abi*it0 of a c*ear and s$ared definition for t$e data consistency: t$e co-,atibi*it0 of t$e sa-e t0,e of data fro- different sources

So-e i-,ortant ,ro,erties of data J'W - 1') -

Course Notes: content-re*ated ,ro,erties timeliness: t$e a"ai*abi*it0 of data at t$e ti-e re@uired and $ow u, to date t$at data is accuracy: $ow c*ose to t$e trut$ t$e data is ,ro,erties re*ated to bot$ definition and content com!leteness: $ow -uc$ of t$e re@uired data is a"ai*ab*e accessibility: w$ere< $ow< and to w$o- t$e data is a"ai*ab*e or not a"ai*ab*e (e g securit0) cost: t$e cost incurred in obtaining t$e data< and -a?ing it a"ai*ab*e for use Data organi ation >not$er ?ind of data -ode* describes $ow to organiDe data using a database -anage-ent s0ste- or ot$er data -anage-ent tec$no*og0 !t describes< for e1a-,*e< re*ationa* tab*es and co*u-ns or objectoriented c*asses and attributes Suc$ a data -ode* is so-eti-es referred to as t$e !hysical data model< but in t$e origina* >NS! t$ree sc$e-a arc$itecture< it is ca**ed H*ogica*H !n t$at arc$itecture< t$e ,$0sica* -ode* describes t$e storage -edia (c0*inders< trac?s< and tab*es,aces) !dea**0< t$is -ode* is deri"ed fro- t$e -ore conce,tua* data -ode* described abo"e !t -a0 differ< $owe"er< to account for constraints *i?e ,rocessing ca,acit0 and usage ,atterns 3$i*e data analysis is a co--on ter- for data -ode*ing< t$e acti"it0 actua**0 $as -ore in co--on wit$ t$e ideas and -et$ods of synthesis (inferring genera* conce,ts fro- ,articu*ar instances) t$an it does wit$ analysis (identif0ing co-,onent conce,ts fro- -ore genera* ones) K/resumably we call ourselves systems analysts because no one can say systems synthesists%L 8ata -ode*ing stri"es to bring t$e data structures of interest toget$er into a co$esi"e< inse,arab*e< w$o*e b0 e*i-inating unnecessar0 data redundancies and b0 re*ating data structures wit$ re*ations$i,s > different a,,roac$ is t$roug$ t$e use of ada,ti"e s0ste-s suc$ as artificia* neura* networ?s t$at can autono-ous*0 create i-,*icit -ode*s of data Data structure

> binar0 tree< a si-,*e t0,e of branc$ing *in?ed data structure

- 1'& -

Object-Oriented Software Engineering (CS350) > data structure is a wa0 of storing data in a co-,uter so t$at it can be used efficient*0 !t is an organiDation of -at$e-atica* and *ogica* conce,ts of data Often a carefu**0 c$osen data structure wi** a**ow t$e -ost efficient a*gorit$- to be used #$e c$oice of t$e data structure often begins fro- t$e c$oice of an abstract data t0,e > data -ode* describes t$e structure of t$e data wit$in a gi"en do-ain and< b0 i-,*ication< t$e under*0ing structure of t$at do-ain itse*f #$is -eans t$at a data -ode* in fact s,ecifies a dedicated grammar for a dedicated artificia* *anguage for t$at do-ain > data -ode* re,resents c*asses of entities (?inds of t$ings) about w$ic$ a co-,an0 wis$es to $o*d infor-ation< t$e attributes of t$at infor-ation< and re*ations$i,s a-ong t$ose entities and (often i-,*icit) re*ations$i,s a-ong t$ose attributes #$e -ode* describes t$e organiDation of t$e data to so-e e1tent irres,ecti"e of $ow data -ig$t be re,resented in a co-,uter s0ste#$e entities re,resented b0 a data -ode* can be t$e tangib*e entities< but -ode*s t$at inc*ude suc$ concrete entit0 c*asses tend to c$ange o"er ti-e 5obust data -ode*s often identif0 abstractions of suc$ entities Aor e1a-,*e< a data -ode* -ig$t inc*ude an entit0 c*ass ca**ed H%ersonH< re,resenting a** t$e ,eo,*e w$o interact wit$ an organiDation Suc$ an abstract entit0 c*ass is t0,ica**0 -ore a,,ro,riate t$an ones ca**ed H:endorH or HE-,*o0eeH< w$ic$ identif0 s,ecific ro*es ,*a0ed b0 t$ose ,eo,*e

.in?ed *ist >rra0

;as$ tab*e

Stac? (data structure)

Data model theory #$e ter- data -ode* can $a"e two -eanings:J1(W 1 > data -ode* theory< i e a for-a* descri,tion of $ow data -a0 be structured and accessed 2 > data -ode* instance< i e a,,*0ing a data -ode* theory to create a ,ractica* data -ode* instance for so-e ,articu*ar a,,*ication > data -ode* t$eor0 $as t$ree -ain co-,onents:J1(W

- 150 -

Course Notes: #$e structura* ,art: a co**ection of data structures w$ic$ are used to create databases re,resenting t$e entities or objects -ode*ed b0 t$e database #$e integrit0 ,art: a co**ection of ru*es go"erning t$e constraints ,*aced on t$ese data structures to ensure structura* integrit0 #$e -ani,u*ation ,art: a co**ection of o,erators w$ic$ can be a,,*ied to t$e data structures< to u,date and @uer0 t$e data contained in t$e database Aor e1a-,*e< in t$e re*ationa* -ode*< t$e structura* ,art is based on a -odified conce,t of t$e -at$e-atica* re*ationG t$e integrit0 ,art is e1,ressed in first-order *ogic and t$e -ani,u*ation ,art is e1,ressed using t$e re*ationa* a*gebra< tu,*e ca*cu*us and do-ain ca*cu*us > data -ode* instance is created b0 a,,*0ing a data -ode* t$eor0 #$is is t0,ica**0 done to so*"e so-e business enter,rise re@uire-ent +usiness re@uire-ents are nor-a**0 ca,tured b0 a se-antic *ogica* data -ode* #$is is transfor-ed into a ,$0sica* data -ode* instance fro- w$ic$ is generated a ,$0sica* database Aor e1a-,*e< a data -ode*er -a0 use a data -ode*ing too* to create an entit0-re*ations$i, -ode* of t$e cor,orate data re,ositor0 of so-e business enter,rise #$is -ode* is transfor-ed into a re*ationa* -ode*< w$ic$ in turn generates a re*ationa* database Patterns %atternsJ12W are co--on data -ode*ing structures t$at occur in -an0 data -ode*s

3elated ,odels
Data flow diagram

8ata A*ow 8iagra- e1a-,*e J1)W > data f*ow diagra- (8A8) is a gra,$ica* re,resentation of t$e Hf*owH of data t$roug$ an infor-ation s0ste- !t differs fro- t$e f*owc$art as it s$ows t$e data f*ow instead of t$e control f*ow of t$e ,rogra- > data f*ow diagra- can a*so be used for t$e "isua*iDation of data ,rocessing (structured design) 8ata f*ow diagra-s were in"ented b0 .arr0 Constantine< t$e origina* de"e*o,er of structured design<J1&W based on /artin and Estrin4s Hdata f*ow gra,$H -ode* of co-,utation !t is co--on ,ractice to draw a conte1t-*e"e* 8ata f*ow diagra- first w$ic$ s$ows t$e interaction between t$e s0ste- and outside entities #$e D'D is designed to s$ow $ow a s0ste- is di"ided into s-a**er ,ortions and to $ig$*ig$t t$e f*ow of data between t$ose ,arts #$is conte1t-*e"e* 8ata f*ow diagra- is t$en He1,*odedH to s$ow -ore detai* of t$e s0ste- being -ode*ed - 151 -

Object-Oriented Software Engineering (CS350) #nformation model

E1a-,*e of an ET%5ESS 7 !nfor-ation -ode* >n !nfor-ation -ode* is not a t0,e of data -ode*< but -ore or *ess an a*ternati"e -ode* 3it$in t$e fie*d of software engineering bot$ a data -ode* and an infor-ation -ode* can be abstract< for-a* re,resentations of entit0 t0,es t$at inc*udes t$eir ,ro,erties< re*ations$i,s and t$e o,erations t$at can be ,erfor-ed on t$e- #$e entit0 t0,es in t$e -ode* -a0 be ?inds of rea*-wor*d objects< suc$ as de"ices in a networ?< or t$e0 -a0 t$e-se*"es be abstract< suc$ as for t$e entities used in a bi**ing s0ste#0,ica**0< t$e0 are used to -ode* a constrained do-ain t$at can be described b0 a c*osed set of entit0 t0,es< ,ro,erties< re*ations$i,s and o,erations >ccording to .ee (1&&&)J20W an infor-ation -ode* is a re,resentation of conce,ts< re*ations$i,s< constraints< ru*es< and o,erations to s,ecif0 data se-antics for a c$osen do-ain of discourse !t can ,ro"ide s$arab*e< stab*e< and organiDed structure of infor-ation re@uire-ents for t$e do-ain conte1t J20W /ore in genera* t$e ter- information model is used for -ode*s of indi"idua* t$ings< suc$ as faci*ities< bui*dings< ,rocess ,*ants< etc !n t$ose cases t$e conce,t is s,ecia*ised to Aaci*it0 !nfor-ation /ode*< +ui*ding !nfor-ation /ode*< %*ant !nfor-ation /ode*< etc Suc$ an infor-ation -ode* is an integration of a -ode* of t$e faci*it0 wit$ t$e data and docu-ents about t$e faci*it0 >n infor-ation -ode* ,ro"ides for-a*is- to t$e descri,tion of a ,rob*e- do-ain wit$out constraining $ow t$at descri,tion is -a,,ed to an actua* i-,*e-entation in software #$ere -a0 be -an0 -a,,ings of t$e infor-ation -ode* Suc$ -a,,ings are ca**ed data -ode*s< irres,ecti"e of w$et$er t$e0 are object -ode*s (e g using =/.)< entit0 re*ations$i, -ode*s or T/. sc$e-as

- 152 -

Course Notes:

8ocu-ent Object /ode*< a standard object -ode* for re,resenting ;#/. or T/. Ob'ect model >n object -ode* in co-,uter science is a co**ection of objects or c*asses t$roug$ w$ic$ a ,rogra- can e1a-ine and -ani,u*ate so-e s,ecific ,arts of its wor*d !n ot$er words< t$e object-oriented interface to so-e ser"ice or s0ste- Suc$ an interface is said to be t$e ob4ect model of t$e re,resented ser"ice or s0ste- Aor e1a-,*e< t$e 8ocu-ent Object /ode* (8O/) J2W is a co**ection of objects t$at re,resent a ,age in a web browser< used b0 scri,t ,rogra-s to e1a-ine and d0na-ica**0 c$ange t$e ,age #$ere is a /icrosoft E1ce* object -ode*J21W for contro**ing /icrosoft E1ce* fro- anot$er ,rogra-< and t$e >SCO/ #e*esco,e 8ri"erJ22W is an object -ode* for contro**ing an astrono-ica* te*esco,e !n co-,uting t$e ter- ob4ect model $as a distinct second -eaning of t$e genera* ,ro,erties of objects in a s,ecific co-,uter ,rogra--ing *anguage< tec$no*og0< notation or -et$odo*og0 t$at uses t$e- Aor e1a-,*e< t$e Cava ob4ect model< t$e .@M ob4ect model< or the ob4ect model of @MT Suc$ object -ode*s are usua**0 defined using conce,ts suc$ as c*ass< -essage< in$eritance< ,o*0-or,$is-< and enca,su*ation #$ere is an e1tensi"e *iterature on for-a*iDed object -ode*s as a subset of t$e for-a* se-antics of ,rogra--ing *anguages Ob'ect-+ole Model

- 153 -

Object-Oriented Software Engineering (CS350)

E1a-,*e of t$e a,,*ication of Object-5o*e /ode*ing in a HSc$e-a for 7eo*ogic SurfaceH< Ste,$en / 5ic$ard (1&&&) J23W Object-5o*e /ode*ing (O5/) is a -et$od for conce,tua* -ode*ing< and can be used as a too* for infor-ation and ru*es ana*0sis J2'W Object-5o*e /ode*ing is a fact-oriented -et$od for ,erfor-ing s0ste-s ana*0sis at t$e conce,tua* *e"e* #$e @ua*it0 of a database a,,*ication de,ends critica**0 on its design #o $e*, ensure correctness< c*arit0< ada,tabi*it0 and ,roducti"it0< infor-ation s0ste-s are best s,ecified first at t$e conce,tua* *e"e*< using conce,ts and *anguage t$at ,eo,*e can readi*0 understand #$e conce,tua* design -a0 inc*ude data< ,rocess and be$a"iora* ,ers,ecti"es< and t$e actua* 8+/S used to i-,*e-ent t$e design -ig$t be based on one of -an0 *ogica* data -ode*s (re*ationa*< $ierarc$ic< networ?< object-oriented etc ) J25W -nified Modeling 1anguage models #$e =nified /ode*ing .anguage (=/.) is a standardiDed genera*-,ur,ose -ode*ing *anguage in t$e fie*d of software engineering !t is a gra,$ica* *anguage for "isua*iDing< s,ecif0ing< constructing< and docu-enting t$e artifacts of a software-intensi"e s0ste- #$e =nified /ode*ing .anguage offers a standard wa0 to write a s0ste-4s b*ue,rints< inc*uding:J2(W Conce,tua* t$ings suc$ as business ,rocesses and s0ste- functions Concrete t$ings suc$ as ,rogra--ing *anguage state-ents< database sc$e-as< and 5eusab*e software co-,onents =/. offers a -i1 of functiona* -ode*s< data -ode*s< and database -ode*s

- 15' -

Course Notes:

- 155 -

Object-Oriented Software Engineering (CS350)

)! Object-oriented design
.bject(oriented design is t$e ,rocess of ,*anning a s0ste- of interacting objects for t$e ,ur,ose of so*"ing a software ,rob*e- !t is one a,,roac$ to software design

Overview
>n object contains enca,su*ated data and ,rocedures grou,ed toget$er to re,resent an entit0 #$e 4object interface4< $ow t$e object can be interacted wit$< is a*so defined >n object-oriented ,rogra- is described b0 t$e interaction of t$ese objects Object-oriented design is t$e disci,*ine of defining t$e objects and t$eir interactions to so*"e a ,rob*e- t$at was identified and docu-ented during objectoriented ana*0sis 3$at fo**ows is a descri,tion of t$e c*ass-based subset of object-oriented design< w$ic$ does not inc*ude object ,rotot0,e-based a,,roac$es w$ere objects are not t0,ica**0 obtained b0 instancing c*asses but b0 c*oning ot$er (,rotot0,e) objects

Ob'ect-oriented design topics


"n+ut @sourcesA for object-oriented design
#$e in,ut for object-oriented design is ,ro"ided b0 t$e out,ut of object-oriented ana*0sis 5ea*iDe t$at an out,ut artifact does not need to be co-,*ete*0 de"e*o,ed to ser"e as in,ut of object-oriented designG ana*0sis and design -a0 occur in ,ara**e*< and in ,ractice t$e resu*ts of one acti"it0 can feed t$e ot$er in a s$ort feedbac? c0c*e t$roug$ an iterati"e ,rocess +ot$ ana*0sis and design can be ,erfor-ed incre-enta**0< and t$e artifacts can be continuous*0 grown instead of co-,*ete*0 de"e*o,ed in one s$ot So-e t0,ica* in,ut artifacts for object-oriented design are: Conce,tua* -ode*: Conce,tua* -ode* is t$e resu*t of object-oriented ana*0sis< it ca,tures conce,ts in t$e ,rob*e- do-ain #$e conce,tua* -ode* is e1,*icit*0 c$osen to be inde,endent of i-,*e-entation detai*s< suc$ as concurrenc0 or data storage =se case: =se case is a descri,tion of se@uences of e"ents t$at< ta?en toget$er< *ead to a s0stedoing so-et$ing usefu* Eac$ use case ,ro"ides one or -ore scenarios t$at con"e0 $ow t$e s0ste- s$ou*d interact wit$ t$e users ca**ed actors to ac$ie"e a s,ecific business goa* or function =se case actors -a0 be end users or ot$er s0ste-s !n -an0 circu-stances use cases are furt$er e*aborated into use case diagra-s =se case diagra-s are used to identif0 t$e actor (users or ot$er s0ste-s) and t$e ,rocesses t$e0 ,erfor S0ste- Se@uence 8iagra-: S0ste- Se@uence diagra- (SS8) is a ,icture t$at s$ows< for a ,articu*ar scenario of a use case< t$e e"ents t$at e1terna* actors generate< t$eir order< and ,ossib*e inter-s0ste- e"ents

- 15( -

Course Notes: =ser interface docu-entations (if a,,*icab*e): 8ocu-ent t$at s$ows and describes t$e *oo? and fee* of t$e end ,roduct4s user interface !t is not -andator0 to $a"e t$is< but it $e*,s to "isua*iDe t$e end-,roduct and t$erefore $e*,s t$e designer 5e*ationa* data -ode* (if a,,*icab*e): > data -ode* is an abstract -ode* t$at describes $ow data is re,resented and used !f an object database is not used< t$e re*ationa* data -ode* s$ou*d usua**0 be created before t$e design< since t$e strateg0 c$osen for object-re*ationa* -a,,ing is an out,ut of t$e OO design ,rocess ;owe"er< it is ,ossib*e to de"e*o, t$e re*ationa* data -ode* and t$e object-oriented design artifacts in ,ara**e*< and t$e growt$ of an artifact can sti-u*ate t$e refine-ent of ot$er artifacts

Object-oriented conce+ts
#$e fi"e basic conce,ts of object-oriented design are t$e i-,*e-entation *e"e* features t$at are bui*t into t$e ,rogra--ing *anguage #$ese features are often referred to b0 t$ese co--on na-es: ObjectFC*ass: > tig$t cou,*ing or association of data structures wit$ t$e -et$ods or functions t$at act on t$e data #$is is ca**ed a class< or ob4ect (an object is created based on a c*ass) Eac$ object ser"es a se,arate function !t is defined b0 its ,ro,erties< w$at it is and w$at it can do >n object can be ,art of a c*ass< w$ic$ is a set of objects t$at are si-i*ar !nfor-ation $iding: #$e abi*it0 to ,rotect so-e co-,onents of t$e object fro- e1terna* entities #$is is rea*iDed b0 *anguage ?e0words to enab*e a "ariab*e to be dec*ared as !rivate or !rotected to t$e owning class !n$eritance: #$e abi*it0 for a class to e1tend or o"erride functiona*it0 of anot$er class #$e soca**ed subclass $as a w$o*e section t$at is deri"ed (in$erited) fro- t$e su!erclass and t$en it $as its own set of functions and data !nterface: #$e abi*it0 to defer t$e i-,*e-entation of a method #$e abi*it0 to define t$e functions or methods signatures wit$out i-,*e-enting t$e %o*0-or,$is-: #$e abi*it0 to re,*ace an ob4ect wit$ its subob4ects #$e abi*it0 of an ob4ect# variable to contain< not on*0 t$at ob4ect< but a*so a** of its subob4ects

6esigning conce+ts
8efining objects< creating c*ass diagra- fro- conce,tua* diagra-: =sua**0 -a, entit0 to c*ass !dentif0ing attributes =se design ,atterns (if a,,*icab*e): > design ,attern is not a finis$ed design< it is a descri,tion of a so*ution to a co--on ,rob*e-< in a conte1tJ1W #$e -ain ad"antage of using a design ,attern is t$at it can be reused in -u*ti,*e a,,*ications !t can a*so be t$oug$t of as a te-,*ate for $ow to so*"e a ,rob*e- t$at can be used in -an0 different situations andFor a,,*ications Object-oriented design ,atterns t0,ica**0 s$ow re*ations$i,s and interactions between c*asses or objects< wit$out s,ecif0ing t$e fina* a,,*ication c*asses or objects t$at are in"o*"ed 8efine a,,*ication fra-ewor? (if a,,*icab*e): >,,*ication fra-ewor? is a ter- usua**0 used to refer to a set of *ibraries or c*asses t$at are used to i-,*e-ent t$e standard structure of an - 152 -

Object-Oriented Software Engineering (CS350) a,,*ication for a s,ecific o,erating s0ste- +0 bund*ing a *arge a-ount of reusab*e code into a fra-ewor?< -uc$ ti-e is sa"ed for t$e de"e*o,er< since $eFs$e is sa"ed t$e tas? of rewriting *arge a-ounts of standard code for eac$ new a,,*ication t$at is de"e*o,ed !dentif0 ,ersistent objectsFdata (if a,,*icab*e): !dentif0 objects t$at $a"e to *ast *onger t$an a sing*e runti-e of t$e a,,*ication !f a re*ationa* database is used< design t$e object re*ation -a,,ing !dentif0 and define re-ote objects (if a,,*icab*e)

Out+ut @deli#erablesA of object-oriented design


Se@uence 8iagra-s: E1tend t$e S0ste- Se@uence 8iagra- to add s,ecific objects t$at $and*e t$e s0ste- e"ents > se@uence diagra- s$ows< as ,ara**e* "ertica* *ines< different ,rocesses or objects t$at *i"e si-u*taneous*0< and< as $oriDonta* arrows< t$e -essages e1c$anged between t$e-< in t$e order in w$ic$ t$e0 occur C*ass diagra-: > c*ass diagra- is a t0,e of static structure =/. diagra- t$at describes t$e structure of a s0ste- b0 s$owing t$e s0ste-4s c*asses< t$eir attributes< and t$e re*ations$i,s between t$e c*asses #$e -essages and c*asses identified t$roug$ t$e de"e*o,-ent of t$e se@uence diagra-s can ser"e as in,ut to t$e auto-atic generation of t$e g*oba* c*ass diagra- of t$e s0ste-

So,e design +rinci+les and strategies


8e,endenc0 injection: #$e basic idea is t$at if an object de,ends u,on $a"ing an instance of so-e ot$er object t$en t$e needed object is HinjectedH into t$e de,endent objectG for e1a-,*e< being ,assed a database connection as an argu-ent to t$e constructor instead of creating one interna**0 >c0c*ic de,endencies ,rinci,*e: #$e de,endenc0 gra,$ of ,ac?ages or co-,onents s$ou*d $a"e no c0c*es #$is is a*so referred to as $a"ing a directed ac0c*ic gra,$ J2W Aor e1a-,*e< ,ac?age C de,ends on ,ac?age +< w$ic$ de,ends on ,ac?age > !f ,ac?age > a*so de,ended on ,ac?age C< t$en 0ou wou*d $a"e a c0c*e Co-,osite reuse ,rinci,*e: Aa"or ,o*0-or,$ic co-,osition of objects o"er in$eritance J1W

Ob'ects ) classes
!n object-oriented ,rogra--ing< a class is a construct t$at is used to create instances of itse*f C referred to as class instances< class ob4ects< instance ob4ects or si-,*0 ob4ects > c*ass defines constituent -e-bers w$ic$ enab*e its instances to $a"e state and be$a"ior J1W 8ata fie*d -e-bers (member variables or instance variables) enab*e a c*ass instance to -aintain state Ot$er ?inds of -e-bers< es,ecia**0 methods< enab*e t$e be$a"ior of c*ass instances C*asses define t$e t0,e of t$eir instances J2W > c*ass usua**0 re,resents a noun< suc$ as a ,erson< ,*ace or t$ing< or so-et$ing no-ina*iDed Aor - 15) -

Course Notes: e1a-,*e< a H+ananaH c*ass wou*d re,resent t$e ,ro,erties and functiona*it0 of bananas in genera* > sing*e< ,articu*ar banana wou*d be an instance of t$e H+ananaH c*ass< an object of t$e t0,e H+ananaH

Design and implementation


C*asses are co-,osed fro- structura* and be$a"iora* constituents J3W %rogra--ing *anguages t$at inc*ude c*asses as a ,rogra--ing construct offer su,,ort for "arious c*ass-re*ated features< and t$e s0nta1 re@uired to use t$ese features "ar0 great*0 fro- one ,rogra--ing *anguage to anot$er

Structure

=/. notation for c*asses > c*ass contains data fie*d descri,tions (or !ro!erties< fields< data members< or attributes) #$ese are usua**0 fie*d t0,es and na-es t$at wi** be associated wit$ state "ariab*es at ,rogra- run ti-eG t$ese state "ariab*es eit$er be*ong to t$e c*ass or s,ecific instances of t$e c*ass !n -ost *anguages< t$e structure defined b0 t$e c*ass deter-ines t$e *a0out of t$e -e-or0 used b0 its instances Ot$er i-,*e-entations are ,ossib*e< for e1a-,*e< objects in %0t$on use associati"e ?e0-"a*ue containers J'W So-e ,rogra--ing *anguages su,,ort s,ecification of in"ariants as ,art of t$e definition of t$e c*ass< and enforce t$e- t$roug$ t$e t0,e s0ste- Enca,su*ation of state is necessar0 for being ab*e to enforce t$e in"ariants of t$e c*ass

*e$a#ior
/ain artic*e: /et$od (co-,uter ,rogra--ing) #$e be$a"ior of c*ass or its instances is defined using -et$ods /et$ods are subroutines wit$ t$e abi*it0 to o,erate on objects or c*asses #$ese o,erations -a0 a*ter t$e state of an object or si-,*0 ,ro"ide wa0s of accessing it J5W /an0 ?inds of -et$ods e1ist< but *anguage su,,ort for t$e- "aries across *anguages So-e t0,es of -et$ods are created and ca**ed b0 ,rogra--er code< w$i*e ot$er s,ecia* -et$odsXsuc$ as constructors< destructors< and con"ersion o,eratorsXare created and ca**ed b0 co-,i*er-generated code > *anguage -a0 a*so a**ow t$e ,rogra--er to define and ca** t$ese s,ecia* -et$ods J(WJ2W

- 15& -

Object-Oriented Software Engineering (CS350)

$e conce+t of class interface


/ain artic*e: !nterface (co-,uting) E"er0 c*ass implements (or reali$es) an interface b0 ,ro"iding structure and be$a"ior Structure consists of data and state< and be$a"ior consists of code t$at s,ecifies $ow -et$ods are i-,*e-ented J)W #$ere is a distinction between t$e definition of an interface and t$e i-,*e-entation of t$at interfaceG $owe"er< t$is *ine is b*urred in -an0 ,rogra--ing *anguages because c*ass dec*arations bot$ define and i-,*e-ent an interface So-e *anguages< $owe"er< ,ro"ide features t$at se,arate interface and i-,*e-entation Aor e1a-,*e< an abstract c*ass can define an interface wit$out ,ro"iding i-,*e-entation .anguages t$at su,,ort c*ass in$eritance a*so a**ow c*asses to in$erit interfaces fro- t$e c*asses t$at t$e0 are deri"ed fro- Je"am!le neededW !n *anguages t$at su,,ort access s,ecifiers< t$e interface of a c*ass is considered to be t$e set of ,ub*ic -e-bers of t$e c*ass< inc*uding bot$ -et$ods and attributes ("ia i-,*icit getter and setter -et$ods)G an0 ,ri"ate -e-bers or interna* data structures are not intended to be de,ended on b0 e1terna* code and t$us are not ,art of t$e interface Object-oriented ,rogra--ing -et$odo*og0 dictates t$at t$e o,erations of an0 interface of a c*ass are to be inde,endent of eac$ ot$er !t resu*ts in a *a0ered design w$ere c*ients of an interface use t$e -et$ods dec*ared in t$e interface >n interface ,*aces no re@uire-ents for c*ients to in"o?e t$e o,erations of one interface in an0 ,articu*ar order #$is a,,roac$ $as t$e benefit t$at c*ient code can assu-e t$at t$e o,erations of an interface are a"ai*ab*e for use w$ene"er t$e c*ient $as access to t$e object E$ample #$e buttons on t$e front of 0our te*e"ision set are t$e interface between 0ou and t$e e*ectrica* wiring on t$e ot$er side of its ,*astic casing Pou ,ress t$e H,owerH button to togg*e t$e te*e"ision on and off !n t$is e1a-,*e< 0our ,articu*ar te*e"ision is t$e instance< eac$ -et$od is re,resented b0 a button< and a** t$e buttons toget$er co-,rise t$e interface (Ot$er te*e"ision sets t$at are t$e sa-e -ode* as 0ours wou*d $a"e t$e sa-e interface ) !n its -ost co--on for-< an interface is a s,ecification of a grou, of re*ated -et$ods wit$out an0 associated i-,*e-entation of t$e -et$ods > te*e"ision set a*so $as a -0riad of attributes< suc$ as siDe and w$et$er it su,,orts co*or< w$ic$ toget$er co-,rise its structure > c*ass re,resents t$e fu** descri,tion of a te*e"ision< inc*uding its attributes (structure) and buttons (interface) 7etting t$e tota* nu-ber of te*e"isions -anufactured cou*d be a static method of t$e te*e"ision c*ass #$is -et$od is c*ear*0 associated wit$ t$e c*ass< 0et is outside t$e do-ain of eac$ indi"idua* instance of t$e c*ass >not$er e1a-,*e wou*d be a static -et$od t$at finds a ,articu*ar instance out of t$e set of a** te*e"ision objects

.e,ber accessibilit/
/an0 *anguages su,,ort t$e conce,t of information hiding and encapsulation< t0,ica**0 wit$ access specifiers for c*ass -e-bers >ccess s,ecifiers contro* access to c*ass -e-bers So-e access s,ecifiers -a0 a*so contro* $ow c*asses in$erit suc$ constraints #$eir ,ri-ar0 ,ur,ose is to se,arate t$e interface of a c*ass fro- its i-,*e-entation - 1(0 -

Course Notes: #$e fo**owing is a co--on set of access s,ecifiers:J&W private (or class#!rivate) restricts t$e access to t$e c*ass itse*f On*0 -et$ods t$at are ,art of t$e sa-e c*ass can access ,ri"ate -e-bers protected (or class#!rotected) a**ows t$e c*ass itse*f and a** its subc*asses to access t$e -e-ber public -eans t$at an0 code can access t$e -e-ber b0 its na-e >*t$oug$ -an0 object-oriented *anguages su,,ort t$e abo"e access s,ecifiers< t$eir se-antics -a0 differ Object-oriented design uses t$e access s,ecifiers in conjunction wit$ carefu* design of ,ub*ic -et$od i-,*e-entations to enforce c*ass in"ariantsXconstraints on t$e state of t$e objects > co--on usage of access s,ecifiers is to se,arate t$e interna* data of a c*ass fro- its interface: t$e interna* structure is -ade ,ri"ate< w$i*e ,ub*ic accessor -et$ods can be used to ins,ect or a*ter suc$ ,ri"ate data >ccess s,ecifiers do not necessari*0 contro* visibility< in t$at e"en ,ri"ate -e-bers -a0 be "isib*e to c*ient e1terna* code !n so-e *anguages< an inaccessib*e but "isib*e -e-ber -a0 be referred to at runti-e (for e1a-,*e< b0 a ,ointer returned fro- a -e-ber function)< but an atte-,t to use it b0 referring to t$e na-e of t$e -e-ber fro- c*ient code wi** be ,re"ented b0 t$e t0,e c$ec?er J10W #$e "arious object-oriented ,rogra--ing *anguages enforce -e-ber accessibi*it0 and "isibi*it0 to "arious degrees< and de,ending on t$e *anguage4s t0,e s0ste- and co-,i*ation ,o*icies< enforced at eit$er co-,i*e-ti-e or run-ti-e Aor e1a-,*e< t$e Ia"a *anguage does not a**ow c*ient code t$at accesses t$e ,ri"ate data of a c*ass to co-,i*e J11W !n t$e CBB *anguage< ,ri"ate -et$ods are "isib*e< but not accessib*e in t$e interfaceG $owe"er< t$e0 -a0 be -ade in"isib*e b0 e1,*icit*0 dec*aring fu**0 abstract c*asses t$at re,resent t$e interfaces of t$e c*ass J12W So-e *anguages feature ot$er accessibi*it0 sc$e-es: Instance vs3 class accessibility: 5ub0 su,,orts instance(private and instance(protected access s,ecifiers in *ieu of c*ass-,ri"ate and c*ass-,rotected< res,ecti"e*0 #$e0 differ in t$at t$e0 restrict access based on t$e instance itse*f< rat$er t$an t$e instance4s c*ass J13W 'riend: CBB su,,orts a -ec$anis- w$ere a function e1,*icit*0 dec*ared as a friend function of t$e c*ass -a0 access t$e -e-bers designated as ,ri"ate or ,rotected J1'W ath(based: Ia"a su,,orts restricting access to a -e-ber wit$in a Ia"a ,ac?age< w$ic$ is roug$*0 t$e ,at$ of a fi*e J&W

#nter-class relationships
!n addition to t$e design of standa*one c*asses< ,rogra--ing *anguages -a0 su,,ort -ore ad"anced c*ass design based u,on re*ations$i,s between c*asses #$e inter-c*ass re*ations$i, design ca,abi*ities co--on*0 ,ro"ided are com!ositional and hierarchical

Co,+ositional
C*asses can be co-,osed of ot$er c*asses< t$ereb0 estab*is$ing a co-,ositiona* re*ations$i, between t$e enc*osing c*ass and its e-bedded c*asses Co-,ositiona* re*ations$i, between c*asses is a*so - 1(1 -

Object-Oriented Software Engineering (CS350) co--on*0 ?nown as a has(a re*ations$i, J15W Aor e1a-,*e< a c*ass HCarH cou*d be co-,osed of and contain a c*ass HEngineH #$erefore< a Car has an Engine One as,ect of co-,osition is contain-ent< w$ic$ is t$e enc*osure of co-,onent instances b0 t$e instance t$at $as t$e- !f an enc*osing object contains co-,onent instances b0 "a*ue< t$e co-,onents and t$eir enc*osing object $a"e a si-i*ar *ifeti-e !f t$e co-,onents are contained b0 reference< t$e0 -a0 not $a"e a si-i*ar *ifeti-e J1(W E1a-,*e (Objecti"e-C 2 0 code):
&cla$$ 'ngine# &inter%ace (ar ) *S+b,ect &-ro-erty !nonatomic. retain" *SString /name# &-ro-erty !nonatomic. retain" 'ngine /engine &-ro-erty !nonatomic. retain" *S0rray /tyre$# &end

#$is Car c*ass have an instance of NSString< an Engine< and an NS>rra0

9ierarc$ical
C*asses can be derived fro- one or -ore e1isting c*asses< t$ereb0 estab*is$ing a $ierarc$ica* re*ations$i, between t$e deri"ed-fro- c*asses (base classes< !arent classes or su!erclasses) and t$e deri"ed c*ass (child class or subclass) #$e re*ations$i, of t$e deri"ed c*ass to t$e deri"ed-fro- c*asses is co--on*0 ?nown as an is(a re*ations$i, J12W Aor e1a-,*e< a c*ass 4+utton4 cou*d be deri"ed fro- a c*ass 4Contro*4 #$erefore< a +utton is a Contro* Structura* and be$a"iora* -e-bers of t$e ,arent c*asses are inherited b0 t$e c$i*d c*ass 8eri"ed c*asses can define additiona* structura* -e-bers (data fie*ds) andFor be$a"iora* -e-bers (-et$ods) in addition to t$ose t$at t$e0 inherit and are t$erefore s!eciali$ations of t$eir su,erc*asses >*so< deri"ed c*asses can o"erride in$erited -et$ods if t$e *anguage a**ows Not a** *anguages su,,ort -u*ti,*e in$eritance Aor e1a-,*e< Ia"a a**ows a c*ass to i-,*e-ent -u*ti,*e interfaces< but on*0 in$erit fro- one c*ass J1)W !f -u*ti,*e in$eritance is a**owed< t$e $ierarc$0 is a directed ac0c*ic gra,$ (or 8>7 for s$ort)< ot$erwise it is a tree #$e $ierarc$0 $as c*asses as nodes and in$eritance re*ations$i,s as *in?s C*asses in t$e sa-e *e"e* are -ore *i?e*0 to be associated t$an c*asses in different *e"e*s #$e *e"e*s of t$is $ierarc$0 are ca**ed *a0ers or *e"e*s of abstraction E1a-,*e (Si-,*ified Objecti"e-C 2 0 code< fro- i%$one S8S):
&inter%ace &inter%ace &inter%ace &inter%ace 123e$-onder ) *S+b,ect //444 125ie6 ) 123e$-onder //444 12Scroll5ie6 ) 125ie6 //444 127able5ie6 ) 12Scroll5ie6 //444

!n t$is e1a-,*e< a =!#ab*e:iew is a =!Scro**:iew is a =!:iew is a =!5es,onder is an NSObject

- 1(2 -

Course Notes: Definitions of subclass /ain artic*es: !n$eritance (object-oriented ,rogra--ing)< Su,erc*ass (co-,uter science)< and Subc*ass (co-,uter science) Conce,tua**0< a su,erc*ass s$ou*d be considered as a co--on ,art of its subc*asses #$is factoring of co--ona*it0 is one -ec$anis- for ,ro"iding reuse #$us< e1tending a su,erc*ass b0 -odif0ing t$e e1isting c*ass is a*so *i?e*0 to narrow its a,,*icabi*it0 in "arious situations !n object-oriented design< carefu* ba*ance between a,,*icabi*it0 and functiona*it0 of su,erc*asses s$ou*d be considered Subc*assing is different fro- subt0,ing in t$at subt0,ing dea*s wit$ co--on be$a"ior w$ereas subc*assing is concerned wit$ co--on structure #$ere are two different ,oints of "iew as to w$et$er subc*asses of t$e sa-e c*ass are re@uired to be disjoint So-eti-es< subc*asses of a ,articu*ar c*ass are considered to be co-,*ete*0 disjoint #$at is< e"er0 instance of a c*ass $as e1act*0 one most#derived class< w$ic$ is a subc*ass of e"er0 c*ass t$at t$e instance $as #$is "iew does not a**ow d0na-ic c$ange of object4s c*ass< as objects are assu-ed to be created wit$ a fi1ed -ost-deri"ed c*ass #$e basis for not a**owing c$anges to object4s c*ass is t$at t$e c*ass is a co-,i*e-ti-e t0,e< w$ic$ does not usua**0 c$ange at runti-e< and ,o*0-or,$is- is uti*iDed for an0 d0na-ic c$ange to t$e object4s be$a"ior< so t$is abi*it0 is not necessar0 8esign t$at does not need to ,erfor- c$anges to object4s t0,e wi** be -ore robust and eas0-to-use fro- t$e ,oint of "iew of t$e users of t$e c*ass Aro- anot$er ,oint of "iew< subc*asses are not re@uired to be disjoint #$en t$ere is no conce,t of a -ost-deri"ed c*ass< and a** t0,es in t$e in$eritance $ierarc$0 t$at are t0,es of t$e instance are considered to be e@ua**0 t0,es of t$e instance #$is "iew is based on a d0na-ic c*assification of objects< suc$ t$at an object -a0 c$ange its c*ass at runti-e #$en object4s c*ass is considered to be its current structure< but c$anges to it are a**owed #$e basis for a**owing c$anges to object4s c*ass is a ,ercei"ed incon"enience caused b0 re,*acing an instance wit$ anot$er instance of a different t0,e< since t$is wou*d re@uire c$ange of a** references to t$e origina* instance to be c$anged to refer to t$e new instance 3$en c$anging t$e object4s c*ass< references to t$e e1isting instances do not need to be re,*aced wit$ references to new instances w$en t$e c*ass of t$e object c$anges ;owe"er< t$is abi*it0 is not readi*0 a"ai*ab*e in a** ,rogra--ing *anguages #$is ana*0sis de,ends on t$e ,ro,osition t$at d0na-ic c$anges to object structure are co--on #$is -a0 or -a0 not be t$e case in ,ractice

Ort$ogonalit/ of t$e class conce+t and in$eritance


>*t$oug$ c*ass-based *anguages are co--on*0 assu-ed to su,,ort in$eritance< in$eritance is not an intrinsic as,ect of t$e conce,t of c*asses So-e *anguages< often referred to as Hobject-based *anguagesH< su,,ort c*asses 0et do not su,,ort in$eritance E1a-,*es of object-based *anguages inc*ude ear*ier "ersions of :isua* +asic

1it$in object-oriented anal/sis


!n object-oriented ana*0sis and in =/.< an association between two c*asses re,resents a co**aboration between t$e c*asses or t$eir corres,onding instances >ssociations $a"e directionG for e1a-,*e< a bidirectiona* association between two c*asses indicates t$at bot$ of t$e c*asses are aware of t$eir re*ations$i, J1&W >ssociations -a0 be *abe*ed according to t$eir na-e or ,ur,ose J20W - 1(3 -

Object-Oriented Software Engineering (CS350) >n association ro*e is gi"en end of an association and describes t$e ro*e of t$e corres,onding c*ass Aor e1a-,*e< a HsubscriberH ro*e describes t$e wa0 instances of t$e c*ass H%ersonH ,artici,ate in a Hsubscribes-toH association wit$ t$e c*ass H/agaDineH >*so< a H/agaDineH $as t$e Hsubscribed -agaDineH ro*e in t$e sa-e association >ssociation ro*e -u*ti,*icit0 describes $ow -an0 instances corres,ond to eac$ instance of t$e ot$er c*ass of t$e association Co--on -u*ti,*icities are H0 1H< H1 1H< H1 \H and H0 \H< w$ere t$e H\H s,ecifies an0 nu-ber of instances J1&W

"a$onomy of classes
#$ere are -an0 categories of c*assesG $owe"er< t$ese categories do not necessari*0 di"ide c*asses into distinct ,artitions

<bstract and Concrete


/ain artic*e: >bstract t0,e !n a *anguage t$at su,,orts in$eritance< an abstract class< or abstract base class (>+C)< is a c*ass t$at cannot be instantiated because it is eit$er *abe*ed as abstract or it si-,*0 s,ecifies abstract -et$ods (or virtual methods) >bstract c*asses s,ecif0 "irtua* -et$ods "ia signatures t$at are to be i-,*e-ented b0 direct or indirect descendents of t$e abstract c*ass +efore a c*ass deri"ed fro- an abstract c*ass can be instantiated< a** abstract -et$ods of its ,arent c*asses -ust be i-,*e-ented b0 so-e c*ass in t$e deri"ation c$ain J21W /ost object oriented ,rogra--ing *anguages a**ow t$e ,rogra--er to s,ecif0 w$ic$ c*asses are considered abstract and wi** not a**ow t$ese to be instantiated Aor e1a-,*e< in Ia"a and %;%< t$e ?e0word abstract is used J22WJ23W !n CBB< an abstract c*ass is a c*ass $a"ing at *east one abstract -et$od gi"en b0 t$e a,,ro,riate s0nta1 in t$at *anguage (a ,ure "irtua* function in CBB ,ar*ance) J21W > c*ass consisting of on*0 "irtua* -et$ods is ca**ed a %ure >bstract +ase C*ass (or /ure B.) in CBB and is a*so ?nown as an interface b0 users of t$e *anguage J12W Ot$er *anguages< notab*0 Ia"a and CU< su,,ort a "ariant of abstract c*asses ca**ed an interface "ia a ?e0word in t$e *anguage !n t$ese *anguages< -u*ti,*e in$eritance is not a**owed< but a c*ass can i-,*e-ent -u*ti,*e interfaces Suc$ a c*ass can on*0 contain abstract ,ub*ic*0 accessib*e -et$ods J1)W J2'W J25W > concrete class is a c*ass t$at can be instantiated< as o,,osed to abstract c*asses< w$ic$ cannot

-ocal and inner


!n so-e *anguages< c*asses can be dec*ared in sco,es ot$er t$an t$e g*oba* sco,e #$ere are "arious t0,es of suc$ c*asses

- 1(' -

Course Notes: >n Inner class is a c*ass defined wit$in anot$er c*ass #$e re*ations$i, between an inner c*ass and its containing c*ass can a*so be treated as anot$er t0,e of c*ass association >n inner c*ass is t0,ica**0 neit$er associated wit$ instances of t$e enc*osing c*ass nor instantiated a*ong wit$ its enc*osing c*ass 8e,ending on *anguage< it -a0 or -a0 not be ,ossib*e to refer to t$e c*ass fro- outside t$e enc*osing c*ass > re*ated conce,t is inner ty!es< a*so ?nown as inner data ty!e or nested ty!e< w$ic$ is a genera*iDation of t$e conce,t of inner c*asses CBB is an e1a-,*e of a *anguage t$at su,,orts bot$ inner c*asses and inner t0,es ("ia ty!edef dec*arations) J2(W J22W >not$er t0,e is a local class< w$ic$ is a c*ass defined wit$in a ,rocedure or function #$is *i-its references to t$e c*ass na-e to wit$in t$e sco,e w$ere t$e c*ass is dec*ared 8e,ending on t$e se-antic ru*es of t$e *anguage< t$ere -a0 be additiona* restrictions on *oca* c*asses co-,ared non-*oca* ones One co--on restriction is to disa**ow *oca* c*ass -et$ods to access *oca* "ariab*es of t$e enc*osing function Aor e1a-,*e< in CBB< a *oca* c*ass -a0 refer to static "ariab*es dec*ared wit$in its enc*osing function< but -a0 not access t$e function4s auto-atic "ariab*es J2)W

.etaclasses
)etaclasses are c*asses w$ose instances are c*asses J2&W > -etac*ass describes a co--on structure of a co**ection of c*asses and can i-,*e-ent a design ,attern or describe ,articu*ar ?inds of c*asses /etac*asses are often used to describe fra-ewor?s !n so-e *anguages< suc$ as %0t$on< 5ub0 or S-a**ta*?< a c*ass is a*so an objectG t$us eac$ c*ass is an instance of a uni@ue -etac*ass w$ic$ is bui*t into t$e *anguage J'W J30W J31W Aor e1a-,*e< in Objecti"eC< eac$ object and c*ass is an instance of NSObject J32W #$e Co--on .is, Object S0ste- (C.OS) ,ro"ides -etaobject ,rotoco*s (/O%s) to i-,*e-ent t$ose c*asses and -etac*asses J33W

Non-subclassable
Non-subc*assab*e c*asses a**ow ,rogra--ers to design c*asses and $ierarc$ies of c*asses w$ic$ at so-e *e"e* in t$e $ierarc$0< furt$er deri"ation is ,ro$ibited (> stand-a*one c*ass -a0 be a*so designated as non-subc*assab*e< ,re"enting t$e for-ation of an0 $ierarc$0) Contrast t$is to abstract c*asses< w$ic$ i-,*0< encourage< and re@uire deri"ation in order to be used at a** > non-subc*assab*e c*ass is i-,*icit*0 concrete > non-subc*assab*e c*ass is created b0 dec*aring t$e c*ass as $ealed in CU or as %inal in Ia"a J3'W J35W Aor e1a-,*e< Ia"a4s String c*ass is designated as final J3(W Non-subc*assab*e c*asses -a0 a**ow a co-,i*er (in co-,i*ed *anguages) to ,erfor- o,ti-iDations t$at are not a"ai*ab*e for subc*assab*e c*asses

%artial
!n *anguages su,,orting t$e feature< a partial class is a c*ass w$ose definition -a0 be s,*it into -u*ti,*e ,ieces< wit$in a sing*e source-code fi*e or across -u*ti,*e fi*es #$e ,ieces are -erged at co-,i*e-ti-e< -a?ing co-,i*er out,ut t$e sa-e as for a non-,artia* c*ass #$e ,ri-ar0 -oti"ation for introduction of ,artia* c*asses is to faci*itate t$e i-,*e-entation of code generators< suc$ as "isua* designers !t is ot$erwise a c$a**enge or co-,ro-ise to de"e*o, code - 1(5 -

Object-Oriented Software Engineering (CS350) generators t$at can -anage t$e generated code w$en it is inter*ea"ed wit$in de"e*o,er-written code =sing ,artia* c*asses< a code generator can ,rocess a se,arate fi*e or coarse-grained ,artia* c*ass wit$in a fi*e< and is t$us a**e"iated fro- intricate*0 interjecting generated code "ia e1tensi"e ,arsing< increasing co-,i*er efficienc0 and e*i-inating t$e ,otentia* ris? of corru,ting de"e*o,er code !n a si-,*e i-,*e-entation of ,artia* c*asses< t$e co-,i*er can ,erfor- a ,$ase of ,reco-,i*ation w$ere it HunifiesH a** t$e ,arts of a ,artia* c*ass #$en< co-,i*ation can ,roceed as usua* Ot$er benefits and effects of t$e ,artia* c*ass feature inc*ude: Enab*es se,aration of a c*ass4s interface and i-,*e-entation code in a uni@ue wa0 Eases na"igation t$roug$ *arge c*asses wit$in a editor Enab*es se,aration of concerns< in a wa0 si-i*ar to as,ect-oriented ,rogra--ing but wit$out using an0 e1tra too*s Enab*es -u*ti,*e de"e*o,ers to wor? on a sing*e c*ass concurrent*0 wit$out t$e need to -erge indi"idua* code into one fi*e at a *ater ti-e %artia* c*asses $a"e e1isted in S-a**ta*? under t$e na-e of .lass E"tensions for considerab*e ti-e 3it$ t$e arri"a* of t$e NE# fra-ewor? 2< /icrosoft introduced ,artia* c*asses< su,,orted in bot$ CU 2 0 and :isua* +asic 2005 3in5# a*so su,,orts ,artia* c*asses E$ample in !&05E" #$is si-,*e e1a-,*e< written in :isua* +asic NE#< s$ows $ow ,arts of t$e sa-e c*ass are defined in two different fi*es fi*e1 "b
Partial (la$$ 8y(la$$ Private _name 0$ String 'nd (la$$

fi*e2 "b
Partial (la$$ 8y(la$$ Public 3eadonly Pro-erty *ame!" 0$ String 9et 3eturn _name 'nd 9et 'nd Pro-erty 'nd (la$$

3$en co-,i*ed< t$e resu*t is t$e sa-e as if t$e two fi*es were written as one< *i?e t$is:
(la$$ 8y(la$$ Private _name 0$ String Public 3eadonly Pro-erty *ame!" 0$ String 9et 3eturn _name 'nd 9et 'nd Pro-erty

- 1(( -

Course Notes:
'nd (la$$

E$ample in Ob'ective-C !n Objecti"e-C< ,artia* c*asses< a?a categories -a0 e"en s,read o"er -u*ti,*e *ibraries and e1ecutab*es< *i?e t$is e1a-,*e: !n Aoundation< $eader fi*e NS8ata $:
&inter%ace *SData ) *S+b,ect - !id"init:it;(ontent$+%13<)!*S13< /"13<# //444 &end

!n user-su,,*ied *ibrar0< a se,arate binar0 fro- Aoundation fra-ewor?< $eader fi*e NS8ataBbase(' $:
#im-ort = oundation/ oundation4;> &inter%ace *SData !ba$e?@" - !*SString /"ba$e?@String# - !id"init:it;Aa$e?@String)!*SString /"ba$e?@String# &end

>nd in an a,,< 0et anot$er se,arate binar0 fi*e< source code fi*e -ain -:
#im-ort = oundation/ oundation4;> #im-ort B*SData+ba$e?@4;B int main!int argc. c;ar /argv[]" C i% !argc = D" return 'E27_ 02<13'# *SString /$ource13<String = [*SString $tring:it;(String)argv[F]]# *SData /data = [[*SData alloc] init:it;(ontent$+%13<)[*S13< 13<:it;String)$ource13<String]]# *S<og!&BG&B. [data ba$e?@String]"# return 'E27_S1(('SS# H

#$e dis,atc$er wi** find bot$ -et$ods ca**ed o"er t$e NS8ata instance and in"o?e bot$ of t$ecorrect*0

;ninstantiable
Uninstantiable classes a**ow ,rogra--ers to grou, toget$er ,er-c*ass fie*ds and -et$ods t$at are accessib*e at runti-e wit$out an instance of t$e c*ass !ndeed< instantiation is ,ro$ibited for t$is ?ind of c*ass - 1(2 -

Object-Oriented Software Engineering (CS350) Aor e1a-,*e< in CU< a c*ass -ar?ed HstaticH can not be instantiated< can on*0 $a"e static -e-bers (fie*ds< -et$ods< ot$er)< -a0 not $a"e instance constructors< and is sealed J32W

;nna,ed
>n unnamed class or anonymous class is a c*ass w$ic$ is not bound to a na-e or identifier u,on definition #$is is ana*ogous to na-ed "ersus unna-ed functions

&enefits
Co-,uter ,rogra-s usua**0 -ode* as,ects of so-e rea* or abstract wor*d (t$e 8o-ain) +ecause eac$ c*ass -ode*s a conce,t< c*asses ,ro"ide a -ore natura* wa0 to create suc$ -ode*s Eac$ c*ass in t$e -ode* re,resents a noun in t$e do-ain< and t$e -et$ods of t$e c*ass re,resent "erbs t$at -a0 a,,*0 to t$at noun (:erbs can a*so be -ode*ed as c*asses< see Co--and %attern) Aor e1a-,*e in a t0,ica* business s0ste-< "arious as,ects of t$e business are -ode*ed< using suc$ c*asses as .ustomer< /roduct< (or&er< *nvoice< Cob< etc >n *nvoice -a0 $a"e -et$ods *i?e .reate< /rint or Send< a Cob -a0 be /erformed or .anceled< etc Once t$e s0ste- can -ode* as,ects of t$e business accurate*0< it can ,ro"ide users of t$e s0ste- wit$ usefu* infor-ation about t$ose as,ects C*asses a**ow a c*ear corres,ondence (-a,,ing) between t$e -ode* and t$e do-ain< -a?ing it easier to design< bui*d< -odif0 and understand t$ese -ode*s C*asses ,ro"ide so-e contro* o"er t$e often c$a**enging co-,*e1it0 of suc$ -ode*s C*asses can acce*erate de"e*o,-ent b0 reducing redundant ,rogra- code< testing and bug fi1ing !f a c*ass $as been t$oroug$*0 tested and is ?nown to be a 4so*id wor?4< it is usua**0 true t$at using or e1tending t$e we**-tested c*ass wi** reduce t$e nu-ber of bugs - as co-,ared to t$e use of fres$*0 de"e*o,ed or ad $oc code - in t$e fina* out,ut !n addition< efficient c*ass reuse -eans t$at -an0 bugs need to be fi1ed in on*0 one ,*ace w$en ,rob*e-s are disco"ered >not$er reason for using c*asses is to si-,*if0 t$e re*ations$i,s of interre*ated data 5at$er t$an writing code to re,eated*0 ca** a gra,$ica* user interface (7=!) window drawing subroutine on t$e ter-ina* screen (as wou*d be t0,ica* for structured ,rogra--ing)< it is -ore intuiti"e 3it$ c*asses< 7=! ite-s t$at are si-i*ar to windows (suc$ as dia*og bo1es) can si-,*0 in$erit -ost of t$eir functiona*it0 and data structures fro- t$e window c*ass #$e ,rogra--er t$en need on*0 add code to t$e dia*og c*ass t$at is uni@ue to its o,eration !ndeed< 7=!s are a "er0 co--on and usefu* a,,*ication of c*asses< and 7=! ,rogra--ing is genera**0 -uc$ easier wit$ a good c*ass fra-ewor?

3un-ti,e re+resentation
>s a data t0,e< a c*ass is usua**0 considered as a co-,i*e-ti-e construct > *anguage -a0 a*so su,,ort ,rotot0,e or factor0 -etaobjects t$at re,resent run-ti-e infor-ation about c*asses< or e"en re,resent -etadata t$at ,ro"ides access to ref*ection faci*ities and abi*it0 to -ani,u*ate data structure for-ats at run-ti-e /an0 *anguages distinguis$ t$is ?ind of run-ti-e t0,e infor-ation about c*asses fro- a c*ass on t$e basis t$at t$e infor-ation is not needed at run-ti-e So-e d0na-ic *anguages do not -a?e strict distinctions between run-ti-e and co-,i*e-ti-e constructs< and t$erefore -a0 not distinguis$ between -etaobjects and c*asses

- 1() -

Course Notes: Aor e1a-,*e< if ;u-an is a -etaobject re,resenting t$e c*ass %erson< t$en instances of c*ass %erson can be created b0 using t$e faci*ities of t$e ;u-an -etaobject

- 1(& -

Object-Oriented Software Engineering (CS350)

&! Class libraries


Microsoft *oundation Classes 6M*C7
#$e )icrosoft 'oundation !lass 1ibrary (a*so )icrosoft 'oundation !lasses or )'!) is a *ibrar0 t$at wra,s ,ortions of t$e 3indows >%! in CBB c*asses< inc*uding functiona*it0 t$at enab*es t$e- to use a defau*t a,,*ication fra-ewor? C*asses are defined for -an0 of t$e $and*e--anaged 3indows objects and a*so for ,redefined windows and co--on contro*s

9istor/
/AC was introduced in 1&&2 wit$ /icrosoft4s .D.AA E%? co-,i*er for use wit$ 1(-bit "ersions of 3indows as an e1tre-e*0 t$in object-oriented CBB wra,,er for t$e 3indows >%! CBB was just beginning to re,*ace C for de"e*o,-ent of co--ercia* a,,*ication software at t$e ti-e !n an /AC ,rogra-< direct 3indows >%! ca**s are rare*0 needed !nstead< ,rogra-s create objects fro- /AC c*asses and ca** -e-ber functions be*onging to t$ose objects /an0 of t$ose functions s$are t$eir na-es wit$ corres,onding >%! functions J'W One interesting @uir? of /AC is t$e use of H>f1H as t$e ,refi1 for -an0 functions< -acros and t$e standard ,reco-,i*ed $eader na-e Hstdaf1 $H 8uring ear*0 de"e*o,-ent w$at beca-e /AC was ca**ed H>,,*ication Ara-ewor? E1tensionsH and abbre"iated H>f1H #$e na-e /icrosoft Aoundation C*asses (/AC) was ado,ted too *ate in t$e re*ease c0c*e to c$ange t$ese references /AC ) 0 was re*eased wit$ :isua* Studio 2005 /AC & 0 was re*eased wit$ :isua* Studio 200) /AC is not inc*uded in t$e free edition of :isua* CBB 2005F200)F2010 E1,ress J5W #$e Object 3indows .ibrar0 (O3.)< designed for use wit$ +or*and4s #urbo CBB co-,i*er< was a co-,eting ,roduct introduced b0 +or*and around t$e sa-e ti-e E"entua**0< +or*and discontinued O3. de"e*o,-ent and *icensed t$e distribution of t$e /AC $eaders< *ibraries and 8..s fro/icrosoftJ(W for a s$ort ti-e< t$oug$ it ne"er offered fu**0 integrated su,,ort for /AC +or*and *ater re*eased :C. (:isua* Co-,onent .ibrar0) to re,*ace t$e O3. fra-ewor? /icrosoft4s e-,$asis on /AC $as been reduced in fa"or of its NE# Ara-ewor? /AC 2< ) and & bridge e*e-ents of /AC wit$ t$e NE# Ara-ewor? to aid de"e*o,ers in -igrating to t$e new fra-ewor? #$e /S:CBB co-,i*er bac?end can e-it -anaged and nati"e object fi*e(s) #$e *in?er can t$en bui*d t$e- toget$er< generating -i1ed (bot$ -anaged and nati"e) a,,*ications< a**owing e1isting nati"e a,,*ications to use -anaged e1tensions in a sea-*ess -anner #$oug$ /icrosoft $as dee-,$asiDed /AC< it re-ains a ,o,u*ar and wide*0 used fra-ewor? > *ig$tweig$t a*ternati"e to /AC is t$e 3indows #e-,*ate .ibrar0 (3#.) CBB E1,ress "ersion co-,i*es 3#. a,,*ications (if 0ou $a"e >#. insta**ed)< but does not inc*ude t$e !8E su,,ort of t$e Standard< %rofessiona* and #ea- editions

- 120 -

Course Notes:

Features
>t t$e ti-e of its introduction< /AC ,ro"ided CBB -acros for 3indows -essage-$and*ing ("ia /essage /a,s)< e1ce,tions< run-ti-e t0,e identification (5##!)< seria*iDation and d0na-ic c*ass instantiation #$e -acros for -essage-$and*ing ai-ed to reduce -e-or0 consu-,tion b0 a"oiding gratuitous "irtua* tab*e use and a*so to ,ro"ide a -ore concrete structure for "arious :isua* CBB-su,,*ied too*s to edit and -ani,u*ate code wit$out ,arsing t$e fu** *anguage #$e -essage-$and*ing -acros re,*aced t$e "irtua* function -ec$anis- ,ro"ided b0 CBB #$e -acros for seria*iDation< e1ce,tions< and 5##! ,redated a"ai*abi*it0 of t$ese features in /icrosoft CBB b0 a nu-ber of 0ears 32-bit "ersions of /AC< for 3indows N# 3 1 and *ater 3indows o,erating s0ste-s< used co-,i*ers t$at i-,*e-ented t$e *anguage features and u,dated t$e -acros to si-,*0 wra, t$e *anguage features instead of ,ro"iding custo-iDed i-,*e-entations< rea*iDing u,ward co-,atibi*it0

8isual CDD 200) Feature %ac7


On 2 >,ri* 200)< /icrosoft re*eased an u,date to t$e /AC c*asses as an out-of-band u,date to :isua* Studio 200) and /AC & J2W #$e u,date features new user interface constructs< inc*uding t$e 5ibbon user interface of /icrosoft Office 2002 and associated =! widgets< fu**0 custo-iDab*e too*bars< doc?ing ,anes *i?e :isua* Studio 2005 (w$ic$ can eit$er be free*0 f*oated or doc?ed to an0 side) and docu-ent tabs J)W #$e /AC 5ibbon resource editor a**ows t$e de"e*o,er to design t$e ribbon gra,$ica**0 instead of $a"ing to use t$e T/.-based dec*arati"e -ar?u, *i?e t$e 5ibbonT >%! in /icrosoft Office 2002 O,tiona**0< ribbon co-,onents -a0 be ,rogra--ed direct*0 b0 ca**ing a new set of ribbon c*ass -et$ods #$e de"e*o,er -a0 -i1 gra,$ica* and ,rogra--atic ribbon de"e*o,-ent as is con"enient #$e /AC a,,*ication wiDard $as a*so been u,graded to su,,ort t$e new features C inc*uding a c$ec?-bo1 to se*ect w$et$er t$e a,,*ication wi** use t$e 5ibbon or t$e :isua* Studio 2005 user interface e*e-ents #$e new functiona*it0 is ,ro"ided in new c*asses so t$at o*d a,,*ications sti** continue to run J)W #$is u,date is bui*ding on to, of +C7SoftOs +C7Contro*+ar .ibrar0 %rofessiona* Edition J&W /icrosoft $as a*so i-,osed additiona* *icensing re@uire-ents on users of t$e 5ibbon =! J10W #$ese inc*ude a re@uire-ent to ad$ere to /icrosoft =! 8esign 7uide*ines< and a ,ro$ibition against using suc$ a =! in a,,*ications w$ic$ co-,ete wit$ /icrosoft Office a,,*ications

- 121 -

Object-Oriented Software Engineering (CS350)

10!6esign wit$ reuse


Component-based development
!omponent(based soft%are engineering /!B&E0 (a*so ?nown as component(based development /!BD0) is a branc$ of software engineering t$at e-,$asiDes t$e se,aration of concerns in res,ect of t$e wide-ranging functiona*it0 a"ai*ab*e t$roug$out a gi"en software s0ste- !t is a reuse-based a,,roac$ to defining< i-,*e-enting and co-,osing *oose*0 cou,*ed inde,endent co-,onents into s0ste-s #$is ,ractice ai-s to bring about an e@ua**0 wide-ranging degree of benefits in bot$ t$e s$ort-ter- and t$e *ong-ter- for t$e software itse*f and for organiDations t$at s,onsor suc$ software Software engineersJwhoFW regard co-,onents as ,art of t$e starting ,*atfor- for ser"ice-orientation Co-,onents ,*a0 t$is ro*e< for e1a-,*e< in 3eb ser"ices< and -ore recent*0< in ser"ice-oriented arc$itectures (SO>)< w$ereb0 a co-,onent is con"erted b0 t$e 3eb ser"ice into a service and subse@uent*0 in$erits furt$er c$aracteristics be0ond t$at of an ordinar0 co-,onent Co-,onents can ,roduce or consu-e e"ents and can be used for e"ent dri"en arc$itectures (E8>)

6efinition and c$aracteristics of co,+onents


>n indi"idua* soft%are component is a software ,ac?age< a 3eb ser"ice< or a -odu*e t$at enca,su*ates a set of re*ated functions (or data) >** s0ste- ,rocesses are ,*aced into se,arate co-,onents so t$at a** of t$e data and functions inside eac$ co-,onent are se-antica**0 re*ated (just as wit$ t$e contents of c*asses) +ecause of t$is ,rinci,*e< it is often said t$at co-,onents are modular and cohesive 3it$ regard to s0ste--wide co-ordination< co-,onents co--unicate wit$ eac$ ot$er "ia interfaces 3$en a co-,onent offers ser"ices to t$e rest of t$e s0ste-< it ado,ts a !rovided interface t$at s,ecifies t$e ser"ices t$at ot$er co-,onents can uti*iDe< and $ow t$e0 can do so #$is interface can be seen as a signature of t$e co-,onent - t$e c*ient does not need to ?now about t$e inner wor?ings of t$e co-,onent (i-,*e-entation) in order to -a?e use of it #$is ,rinci,*e resu*ts in co-,onents referred to as enca!sulated #$e =/. i**ustrations wit$in t$is artic*e re,resent ,ro"ided interfaces b0 a *o**i,o,s0-bo* attac$ed to t$e outer edge of t$e co-,onent ;owe"er< w$en a co-,onent needs to use anot$er co-,onent in order to function< it ado,ts a used interface t$at s,ecifies t$e ser"ices t$at it needs !n t$e =/. i**ustrations in t$is artic*e< used interfaces are re,resented b0 an o,en soc?et s0-bo* attac$ed to t$e outer edge of t$e co-,onent >not$er i-,ortant attribute of co-,onents is t$at t$e0 are substitutable< so t$at a co-,onent can re,*ace anot$er (at design ti-e or run-ti-e)< if t$e successor co-,onent -eets t$e re@uire-ents of t$e initia* co-,onent (e1,ressed "ia t$e interfaces) Conse@uent*0< co-,onents can be re,*aced wit$ eit$er an u,dated "ersion or an a*ternati"e wit$out brea?ing t$e s0ste- in w$ic$ t$e co-,onent o,erates

- 122 -

Course Notes: >s a genera* ru*e of t$u-b for engineers substituting co-,onents< co-,onent + can i--ediate*0 re,*ace co-,onent >< if co-,onent + ,ro"ides at *east w$at co-,onent > ,ro"ided and uses no -ore t$an w$at co-,onent > used Software co-,onents often ta?e t$e for- of objects (not c*asses) or co**ections of objects (fro- objectoriented ,rogra--ing)< in so-e binar0 or te1tua* for-< ad$ering to so-e interface descri,tion *anguage (!8.) so t$at t$e co-,onent -a0 e1ist autono-ous*0 fro- ot$er co-,onents in a co-,uter 3$en a co-,onent is to be accessed or s$ared across e1ecution conte1ts or networ? *in?s< tec$ni@ues suc$ as seria*iDation or -ars$a**ing are often e-,*o0ed to de*i"er t$e co-,onent to its destination 5eusabi*it0 is an i-,ortant c$aracteristic of a $ig$-@ua*it0 software co-,onent %rogra--ers s$ou*d design and i-,*e-ent software co-,onents in suc$ a wa0 t$at -an0 different ,rogra-s can reuse t$e- Aurt$er-ore< co-,onent-based usabi*it0 testing s$ou*d be considered w$en software co-,onents direct*0 interact wit$ users !t ta?es significant effort and awareness to write a software co-,onent t$at is effecti"e*0 reusab*e #$e co-,onent needs to be: fu**0 docu-ented t$oroug$*0 tested robust - wit$ co-,re$ensi"e in,ut-"a*idit0 c$ec?ing ab*e to ,ass bac? a,,ro,riate error -essages or return codes designed wit$ an awareness t$at it will be ,ut to unforeseen uses !n t$e 1&(0s< ,rogra--ers bui*t scientific subroutine *ibraries t$at were reusab*e in a broad arra0 of engineering and scientific a,,*ications #$oug$ t$ese subroutine *ibraries reused we**-defined a*gorit$-s in an effecti"e -anner< t$e0 $ad a *i-ited do-ain of a,,*ication Co--ercia* sites routine*0 created a,,*ication ,rogra-s fro- reusab*e -odu*es written in >sse-b*er< CO+O.< %.F1 and ot$er second- and t$ird-generation *anguages using bot$ s0ste- and user a,,*ication *ibraries >s of 2010< -odern reusab*e co-,onents enca,su*ate bot$ data structures and t$e a*gorit$-s t$at are a,,*ied to t$e data structures !tJclarification neededW bui*ds on ,rior t$eories of software objects< software arc$itectures< software fra-ewor?s and software design ,atterns< and t$e e1tensi"e t$eor0 of object-oriented ,rogra--ing and t$e object oriented design of a** t$ese !t c*ai-s t$at software co-,onents< *i?e t$e idea of $ardware co-,onents< used for e1a-,*e in te*eco--unications J1W<can u*ti-ate*0 be -ade interc$angeab*e and re*iab*e On t$e ot$er $and< it is argued t$at it is a -ista?e to focus on inde,endent co-,onents rat$er t$an t$e fra-ewor? (wit$out w$ic$ t$e0 wou*d not e1ist) J2W

9istor/
#$e idea t$at software s$ou*d be co-,onentiDed - bui*t fro- ,refabricated com!onents - first beca-e ,ro-inent wit$ 8oug*as /c!*ro04s address at t$e N>#O conference on software engineering in 7ar-isc$< 7er-an0< 1&()< tit*ed Mass /roduced Software .om!onents J3W #$e conference set out to counter t$e so-ca**ed software crisis /c!*ro04s subse@uent inc*usion of ,i,es and fi*ters into t$e =ni1 o,erating s0ste- was t$e first i-,*e-entation of an infrastructure for t$is idea

- 123 -

Object-Oriented Software Engineering (CS350) +rad Co1 of Ste,stone *arge*0 defined t$e -odern conce,t of a software co-,onent J'W ;e ca**ed t$eSoftware *.s and set out to create an infrastructure and -ar?et for t$ese co-,onents b0 in"enting t$e Objecti"e-C ,rogra--ing *anguage (;e su--ariDes t$is "iew in $is boo? @b4ect#@riented /rogramming # n Evolutionary !!roach 1&)( ) !+/ *ed t$e ,at$ wit$ t$eir S0ste- Object /ode* (SO/) in t$e ear*0 1&&0s >s a reaction< /icrosoft ,a"ed t$e wa0 for actua* de,*o0-ent of co-,onent software wit$ O.E and CO/ J5W >s of 2010 -an0 successfu* software co-,onent -ode*s e1ist

6ifferences fro, object-oriented +rogra,,ing


%ro,onents of object-oriented ,rogra--ing (OO%) -aintain t$at software s$ou*d be written according to a -enta* -ode* of t$e actua* or i-agined objects it re,resents OO% and t$e re*ated disci,*ines of object-oriented ana*0sis and object-oriented design focus on -ode*ing rea*-wor*d interactions and atte-,ting to create HnounsH and H"erbsH t$at can be used in -ore $u-an-readab*e wa0s< idea**0 b0 end users as we** as b0 ,rogra--ers coding for t$ose end users Co-,onent-based software engineering< b0 contrast< -a?es no suc$ assu-,tions< and instead states t$at de"e*o,ers s$ou*d construct software b0 g*uing toget$er ,refabricated co-,onents - -uc$ *i?e in t$e fie*ds of e*ectronics or -ec$anics So-e ,eersJwhoFW wi** e"en ta*? of -odu*ariDing s0ste-s as software co-,onents as a new ,rogra--ing ,aradigSo-eJwhoFW argue t$at ear*ier co-,uter scientists -ade t$is distinction< wit$ 8ona*d Snut$4s t$eor0 of H*iterate ,rogra--ingH o,ti-istica**0 assu-ing t$ere was con"ergence between intuiti"e and for-a* -ode*s< and Edsger 8ij?stra4s t$eor0 in t$e artic*e The .ruelty of +eally Teaching .om!uter Science< w$ic$ stated t$at ,rogra--ing was si-,*0< and on*0< a branc$ of -at$e-atics J(WJ2W !n bot$ for-s< t$is notion $as *ed to -an0 acade-ic debatesJweasel wordsW about t$e ,ros and cons of t$e two a,,roac$es and ,ossib*e strategies for uniting t$e two So-eJwhoFW consider t$e different strategies not as co-,etitors< but as descri,tions of t$e sa-e ,rob*e- fro- different ,oints of "iew

<rc$itecture
> co-,uter running se"era* software co-,onents is often ca**ed an a,,*ication ser"er =sing t$is co-bination of a,,*ication ser"ers and software co-,onents is usua**0 ca**ed distributed co-,uting #$e usua* rea*-wor*d a,,*ication of t$is is in e g financia* a,,*ications or business software

Models
> co-,onent -ode* is a definition of standards for co-,onent i-,*e-entation< docu-entation and de,*o0-ent E1a-,*es of co-,onent -ode*s are: EI+ -ode* (Enter,rise Ia"a +eans)< CO/B -ode* ( NE# -ode*)< Corba Co-,onent /ode* #$e co-,onent -ode* s,ecifies $ow interfaces s$ou*d be defined and t$e e*e-ents t$at s$ou*d be inc*uded in an interface definition J)W

ec$nologies
+usiness object tec$no*ogies - 12' -

Course Notes: Newi Co-,onent-based software fra-ewor?s for s,ecific do-ains Eart$ S0ste- /ode*ing Ara-ewor? (ES/A) Co-,onent-oriented ,rogra--ing +und*es as defined b0 t$e OS7i Ser"ice %*atfor Co--on Co-,onent >rc$itecture (CC>) - Co--on Co-,onent >rc$itecture Aoru-< ScientificF;%C Co-,onent Software #>SCS - Sci8>C Center for #ec$no*og0 for >d"anced Scientific Co-,onent Software Eiffe* ,rogra--ing *anguage Enter,rise Ia"a+eans fro- Sun /icros0ste-s (now Orac*e) A*ow-based ,rogra--ing Aracta* co-,onent -ode* fro- Object3eb /idCO/ co-,onent fra-ewor? for /idgard and %;% Oberon< Co-,onent %asca*< and +*ac?+o1 Co-,onent +ui*der rCOS -et$od of co-,onent-based -ode* dri"en design fro- =N=-!!S# SOA> co-,onent s0ste- fro- Object3eb #$e Sy$tem4(om-onent8odel na-es,ace in /icrosoft NE# =nit038 de"e*o,ed b0 =nit0 #ec$no*ogies =NO fro- t$e O,enOffice org office suite :C. and C.T fro- +or*and and si-i*ar free .C. *ibrar0 :isua* +asic E1tensions< OCTF>cti"eTFCO/ and 8CO/ fro- /icrosoft T%CO/ fro- /oDi**a Aoundation Co-,ound docu-ent tec$no*ogies >cti"e 8ocu-ents in Oberon S0ste- and +*ac?+o1 Co-,onent +ui*der +onobo (co-,onent -ode*)< a ,art of 7NO/E Aresco S%art< t$e S8E co-,ound docu-ent tec$no*og0 Object *in?ing and e-bedding (O.E) O,en8oc 8istributed co-,uting software co-,onents NE# 5e-oting fro- /icrosoft &% distributed ,rotoco* de"e*o,ed for %*an &< and used b0 !nferno and ot$er s0ste-s CO5+> and t$e CO5+> Co-,onent /ode* fro- t$e Object /anage-ent 7rou, 8-+us fro- t$e freedes?to, org organiDation 8CO% fro- S8E (de,recated) 8CO/ and *ater "ersions of CO/ (and CO/B) fro- /icrosoft 8SO/ and SO/ fro- !+/ (now scra,,ed) !CE fro- YeroC Ia"a EE fro- Sun =ni"ersa* Networ? Objects (=NO) fro- O,enOffice org 3eb ser"ices - 125 -

Object-Oriented Software Engineering (CS350) 5ES# Yo,e fro- Yo,e Cor,oration 7eneric ,rogra--ing e-,$asiDes se,aration of a*gorit$-s fro- data re,resentation !nterface descri,tion *anguages (!8.s) O,en Ser"ice !nterface 8efinitions (OS!8s) %art of bot$ CO/ and CO5+> %*atfor--!nde,endent Co-,onent /ode*ing .anguage S!8. - Scientific !nterface 8efinition .anguage %art of t$e +abe* Scientific %rogra--ing .anguage !ntero,erabi*it0 S0ste(S!8. and +abe* are core tec$no*ogies of t$e CC> and t$e Sci8>C #>SCS Center - see abo"e ) SO>% !8. fro- 3or*d 3ide 3eb Consortiu- (33C) 388T T/.-5%C< t$e ,redecessor of SO>% !n"ersion of Contro* (!oC) and %*ain O*d CBBFIa"a Object (%OCOF%OIO) co-,onent fra-ewor?s %i,es and Ai*ters =ni1 o,erating s0ste-

Commercial-Off-"he-Shelf 6CO"S7
!n t$e =nited States< !ommercially available .ff(@he(&helf (!.@&) is a Aedera* >c@uisition 5egu*ation (A>5) ter- defining a nonde"e*o,-enta* ite- (N8!) of su,,*0 t$at is bot$ co--ercia* and so*d in substantia* @uantities in t$e co--ercia* -ar?et,*ace< and t$at can be ,rocured or uti*iDed under go"ern-ent contract in t$e sa-e ,recise for- as a"ai*ab*e to t$e genera* ,ub*ic Aor e1a-,*e< tec$no*og0 re*ated ite-s< suc$ as co-,uter software< $ardware s0ste-s or free software wit$ co--ercia* su,,ort< and construction -ateria*s @ua*if0< but bu*? cargo< suc$ as agricu*tura* or ,etro*eu- ,roducts< do not CO#S ,urc$ases are a*ternati"es to in-$ouse de"e*o,-ents or one-off go"ern-ent-funded de"e*o,-ents CO#S t0,ica**0 re@uires configuration t$at is tai*ored for s,ecific uses #$e use of CO#S $as been -andated across -an0 go"ern-ent and business ,rogra-s< as suc$ ,roducts -a0 offer significant sa"ings in ,rocure-ent< de"e*o,-ent< and -aintenance

Considerations
/oti"ations for using CO#S co-,onents inc*ude $o,es for reduction of o"era** s0ste--de"e*o,-ent and costs (as co-,onents can be boug$t or *icensed instead of being de"e*o,ed fro- scratc$) and reduced *ong-ter- -aintenance costs !n software de"e*o,-ent< -an0 regarded CO#S as a si*"er bu**et (to reduce costFti-e) during t$e 1&&0s< but CO#S de"e*o,-ent ca-e wit$ -an0 not-so-ob"ious tradeoffsXinitia* cost and de"e*o,-ent ti-e can definite*0 be reduced< but often at t$e e1,ense of an increase in software co-,onent-integration wor? and a de,endenc0 on t$ird-,art0 co-,onent "endors J1W !n addition< since CO#S software s,ecifications are written e1terna**0< go"ern-ent agencies so-eti-es fear inco-,atibi*ities -a0 resu*t fro- future c$anges - 12( -

Course Notes: One e1a-,*e of ,roduct obso*escence is a =S>A su,erco-,uter bui*t out of %*a0Station 3s (%S3) running t$e .inu1 o,erating s0ste- Now t$at Son0 Co-,uter Entertain-ent $as disab*ed t$e use of .inu1 on t$e %S3< no re,*ace-ent ,arts wi** be a"ai*ab*e<J2W and t$at re@uires custo-iDed su,,ort for t$e CO#S ,roducts< or con"ersion to anot$er s0ste- using ot$er ,roducts Suc$ obso*escence ,rob*e-s $a"e *ed to go"ern-ent-industr0 ,artners$i,s< w$ere "arious businesses agree to stabi*iDe so-e ,roduct "ersions for go"ern-ent use and ,*an so-e future features< in t$ose ,roduct *ines< as a joint effort ;ence< so-e ,artners$i,s $a"e *ed to co-,*aints of fa"oritis-< to a"oiding co-,etiti"e ,rocure-ent ,ractices< and to c*ai-s of t$e use of so*e-source agree-ents w$ere not actua**0 needed #$ere is a*so t$e danger of ,re-,urc$asing a -u*ti-decade su,,*0 of re,*ace-ent ,arts (and -ateria*s) w$ic$ wou*d beco-e obso*ete wit$in 10 0ears >** t$ese considerations *ead to co-,are a si-,*e so*ution (suc$ as H,a,er 9 ,enci*H) to a"oid o"er*0 co-,*e1 so*utions creating a H5ube 7o*dbergH s0ste- of cree,ing featuris-< w$ere a si-,*e so*ution wou*d $a"e sufficed instead Jclarification neededW Suc$ co-,arisons a*so consider w$et$er a grou, is creating a -a?e-wor? s0ste- to justif0 e1tra funding< rat$er t$an ,ro"iding a *ow-cost s0ste- w$ic$ -eets t$e basic needs< regard*ess of t$e use of CO#S ,roducts One of t$e successes of CO#S $as been an u,grade to t$e sonar of =nited States Na"0 sub-arines J3W

Design patterns
!n software engineering< a design pattern is a genera* reusab*e so*ution to a co--on*0 occurring ,rob*e- wit$in a gi"en conte1t in software design > design ,attern is not a finis$ed design t$at can be transfor-ed direct*0 into code !t is a descri,tion or te-,*ate for $ow to so*"e a ,rob*e- t$at can be used in -an0 different situations %atterns are for-a*iDed best ,ractices t$at t$e ,rogra--er -ust i-,*e-ent t$e-se*"es in t$e a,,*ication J1W Object-oriented design ,atterns t0,ica**0 s$ow re*ations$i,s and interactions between c*asses or objects< wit$out s,ecif0ing t$e fina* a,,*ication c*asses or objects t$at are in"o*"ed /an0 ,atterns i-,*0 object-orientation or -ore genera**0 -utab*e state< and so -a0 not be as a,,*icab*e in functiona* ,rogra--ing *anguages< in w$ic$ data is i--utab*e or treated as suc$ 8esign ,atterns reside in t$e do-ain of -odu*es and interconnections >t a $ig$er *e"e* t$ere are arc$itectura* ,atterns t$at are *arger in sco,e< usua**0 describing an o"era** ,attern fo**owed b0 an entire s0ste- J2W #$ere are -an0 t0,es of design ,atterns< *i?e $lgorithm strategy patterns addressing concerns re*ated to $ig$-*e"e* strategies describing $ow to e1,*oit a,,*ication c$aracteristics on a co-,uting ,*atfor !omputational design patterns addressing concerns re*ated to ?e0 co-,utation identification Execution patterns t$at address concerns re*ated to su,,orting a,,*ication e1ecution< inc*uding strategies in e1ecuting strea-s of tas?s and bui*ding b*oc?s to su,,ort tas? s0nc$roniDation Implementation strategy patterns addressing concerns re*ated to i-,*e-enting source code to su,,ort 1 ,rogra- organiDation< and 2 t$e co--on data structures s,ecific to ,ara**e* ,rogra--ing

- 122 -

Object-Oriented Software Engineering (CS350) &tructural design patterns addressing concerns re*ated to $ig$-*e"e* structures of a,,*ications being de"e*o,ed

- 12) -

Course Notes:

9istor/
%atterns originated as an arc$itectura* conce,t b0 C$risto,$er >*e1ander (1&22F2&) !n 1&)2< Sent +ec? and 3ard Cunning$a- began e1,eri-enting wit$ t$e idea of a,,*0ing ,atterns to ,rogra--ing and ,resented t$eir resu*ts at t$e OO%S.> conference t$at 0ear J3WJ'W !n t$e fo**owing 0ears< +ec?< Cunning$a- and ot$ers fo**owed u, on t$is wor? 8esign ,atterns gained ,o,u*arit0 in co-,uter science after t$e boo? ,esign /atterns- Elements of +eusable @b4ect#@riented Software was ,ub*is$ed in 1&&' b0 t$e so-ca**ed H7ang of AourH (7a--a et a* )< w$ic$ is fre@uent*0 abbre"iated as H7OAH #$at sa-e 0ear< t$e first %attern .anguages of %rogra--ing Conference was $e*d and t$e fo**owing 0ear< t$e %ort*and %attern 5e,ositor0 was set u, for docu-entation of design ,atterns #$e sco,e of t$e ter- re-ains a -atter of dis,ute Notab*e boo?s in t$e design ,attern genre inc*ude: 7a--a< Eric$G 5ic$ard ;e*-< 5a*,$ Io$nson< and Io$n :*issides (1&&5) ,esign /atternsElements of +eusable @b4ect#@riented Software >ddison-3es*e0 !S+N 0-201-(33(1-2 +usc$-ann< Aran?G 5egine /eunier< ;ans 5o$nert< %eter So--er*ad (1&&() /attern#@riented Software rchitecture0 >olume =- System of /atterns Io$n 3i*e0 9 Sons !S+N 0-'21-&5)(&2 Sc$-idt< 8oug*as C G /ic$ae* Sta*< ;ans 5o$nert< Aran? +usc$-ann (2000) /attern#@riented Software rchitecture0 >olume 2- /atterns for .oncurrent and Networ&ed @b4ects Io$n 3i*e0 9 Sons !S+N 0-'21-(0(&5-2 Aow*er< /artin (2002) /atterns of Enter!rise !!lication rchitecture >ddison-3es*e0 !S+N &2)-0-321-122'2-( ;o$,e< 7regorG +obb0 3oo*f (2003) Enter!rise *ntegration /atterns- ,esigning0 Building0 and ,e!loying Messaging Solutions >ddison-3es*e0 !S+N 0-321-200()-3 Aree-an< Eric #G E*isabet$ 5obson< +ert +ates< Sat$0 Sierra (200') 'ead )irst ,esign /atterns O45ei**0 /edia !S+N 0-5&(-00212-' >*t$oug$ design ,atterns $a"e been a,,*ied ,ractica**0 for a *ong ti-e< for-a*iDation of t$e conce,t of design ,atterns *anguis$ed for se"era* 0ears J5W !n 200& o"er 30 contributors co**aborated wit$ #$o-as Er* on $is boo?< S@ ,esign /atterns J(W #$e goa* of t$is boo? was to estab*is$ a de facto cata*og of design ,atterns for SO> and ser"ice-orientation J2W (O"er 200B !# ,rofessiona*s ,artici,ated wor*d-wide in re"iewing Er*4s boo? and ,atterns ) #$ese ,atterns are a*so ,ub*is$ed and discussed on t$e co--unit0 researc$ site soa,atterns org

%ractice
8esign ,atterns can s,eed u, t$e de"e*o,-ent ,rocess b0 ,ro"iding tested< ,ro"en de"e*o,-ent ,aradig-s J)W Effecti"e software design re@uires considering issues t$at -a0 not beco-e "isib*e unti* *ater in t$e i-,*e-entation 5eusing design ,atterns $e*,s to ,re"ent subt*e issues t$at can cause -ajor ,rob*e-s< and it a*so i-,ro"es code readabi*it0 for coders and arc$itects w$o are fa-i*iar wit$ t$e ,atterns !n order to ac$ie"e f*e1ibi*it0< design ,atterns usua**0 introduce additiona* *e"e*s of indirection< w$ic$ in so-e cases -a0 co-,*icate t$e resu*ting designs and $urt a,,*ication ,erfor-ance - 12& -

Object-Oriented Software Engineering (CS350) +0 definition< a ,attern -ust be ,rogra--ed anew into eac$ a,,*ication t$at uses it Since so-e aut$ors see t$is as a ste, bac?ward fro- software reuse as ,ro"ided b0 co-,onents< researc$ers $a"e wor?ed to turn ,atterns into co-,onents /e0er and >rnout were ab*e to ,ro"ide fu** or ,artia* co-,onentiDation of two-t$irds of t$e ,atterns t$e0 atte-,ted J&W Software design tec$ni@ues are difficu*t to a,,*0 to a broader range of ,rob*e-s 8esign ,atterns ,ro"ide genera* so*utions< docu-ented in a for-at t$at does not re@uire s,ecifics tied to a ,articu*ar ,rob*e-

Structure
8esign ,atterns are co-,osed of se"era* sections (see 8ocu-entation be*ow) Of ,articu*ar interest are t$e Structure< %artici,ants< and Co**aboration sections #$ese sections describe a design motif: a ,rotot0,ica* micro#architecture t$at de"e*o,ers co,0 and ada,t to t$eir ,articu*ar designs to so*"e t$e recurrent ,rob*e- described b0 t$e design ,attern > -icro-arc$itecture is a set of ,rogra- constituents (e g < c*asses< -et$ods ) and t$eir re*ations$i,s 8e"e*o,ers use t$e design ,attern b0 introducing in t$eir designs t$is ,rotot0,ica* -icro-arc$itecture< w$ic$ -eans t$at -icro-arc$itectures in t$eir designs wi** $a"e structure and organiDation si-i*ar to t$e c$osen design -otif !n addition to t$is< ,atterns a**ow de"e*o,ers to co--unicate using we**-?nown< we** understood na-es for software interactions Co--on design ,atterns can be i-,ro"ed o"er ti-e< -a?ing t$e-ore robust t$an ad#hoc designs Domain-specific patterns Efforts $a"e a*so been -ade to codif0 design ,atterns in ,articu*ar do-ains< inc*uding use of e1isting design ,atterns as we** as do-ain s,ecific design ,atterns E1a-,*es inc*ude user interface design ,atterns<J10W infor-ation "isua*iDation<J11W secure design<J12W Hsecure usabi*it0H<J13W 3eb design J1'W and business -ode* design J15W #$e annua* %attern .anguages of %rogra--ing Conference ,roceedings J1(W inc*ude -an0 e1a-,*es of do-ain s,ecific ,atterns

Classification and list


8esign ,atterns were origina**0 grou,ed into t$e categories: creationa* ,atterns< structura* ,atterns< and be$a"iora* ,atterns< and described using t$e conce,ts of de*egation< aggregation< and consu*tation Aor furt$er bac?ground on object-oriented design< see cou,*ing and co$esion< in$eritance< interface< and ,o*0-or,$is- >not$er c*assification $as a*so introduced t$e notion of arc$itectura* design ,attern t$at -a0 be a,,*ied at t$e arc$itecture *e"e* of t$e software suc$ as t$e /ode*C:iewCContro**er ,attern

- 1)0 -

Course Notes: !reational patterns Aame Description In Code In Design Complete64= .ther Patterns 7 Pes Pes
NF>

%ro"ide an interface for creating fa-i*ies of >bstract factor0 re*ated or de,endent objects wit$out s,ecif0ing t$eir concrete c*asses Se,arate t$e construction of a co-,*e1 object fro- its re,resentation a**owing t$e sa-e +ui*der construction ,rocess to create "arious re,resentations 8efine an interface for creating an object< but *et subc*asses decide w$ic$ c*ass to instantiate Aactor0 -et$od Aactor0 /et$od *ets a c*ass defer instantiation to subc*asses (de,endenc0 injectionJ1)W) #actic of de*a0ing t$e creation of an object< t$e .aD0 ca*cu*ation of a "a*ue< or so-e ot$er e1,ensi"e initia*iDation ,rocess unti* t$e first ti-e it is needed Ensure a c*ass $as on*0 na-ed instances< and /u*titon ,ro"ide g*oba* ,oint of access to t$e>"oid e1,ensi"e ac@uisition and re*ease of resources b0 rec0c*ing objects t$at are no Object ,oo* *onger in use Can be considered a genera*isation of connection ,oo* and t$read ,oo* ,atterns S,ecif0 t$e ?inds of objects to create using a %rotot0,e ,rotot0,ica* instance< and create new objects b0 co,0ing t$is ,rotot0,e 5esource Ensure t$at resources are ,ro,er*0 re*eased b0 ac@uisition is t0ing t$e- to t$e *ifes,an of suitab*e objects initia*iDation Ensure a c*ass $as on*0 one instance< and Sing*eton ,ro"ide a g*oba* ,oint of access to it

Pes

No

NF>

Pes

Pes

NF>

No No

No No

/oE J 1&W
NF>

No

No

NF>

Pes

No

NF>

No Pes

No Pes

NF>

NF>

- 1)1 -

Object-Oriented Software Engineering (CS350) &tructural patterns Aame Description Con"ert t$e interface of a c*ass into anot$er interface c*ients e1,ect >n ada,ter *ets c*asses wor? toget$er t$at cou*d not ot$erwise because of inco-,atib*e interfaces #$e enter,rise integration ,attern e@ui"a*ent is t$e #rans*ator 8ecou,*e an abstraction fro- its i-,*e-entation a**owing t$e two to "ar0 inde,endent*0 Co-,ose objects into tree structures to re,resent ,art-w$o*e $ierarc$ies Co-,osite *ets c*ients treat indi"idua* objects and co-,ositions of objects unifor-*0 >ttac$ additiona* res,onsibi*ities to an object d0na-ica**0 ?ee,ing t$e sa-e interface 8ecorators ,ro"ide a f*e1ib*e a*ternati"e to subc*assing for e1tending functiona*it0 %ro"ide a unified interface to a set of interfaces in a subs0ste- Aacade defines a $ig$er-*e"e* interface t$at -a?es t$e subs0ste- easier to use #$e ,attern re*ates to t$e design of 3eb a,,*ications !t ,ro"ides a centra*iDed entr0 ,oint for $and*ing re@uests =se s$aring to su,,ort *arge nu-bers of si-i*ar objects efficient*0 %ro"ide a surrogate or ,*ace$o*der for anot$er object to contro* access to it 7rou, se"era* re*ated e*e-ents< suc$ as c*asses< sing*etons< -et$ods< g*oba**0 used< into a sing*e conce,tua* entit0 In Code In Design Complete64= .ther Patterns 7

>da,ter or 3ra,,er or #rans*ator +ridge

Pes

Pes

NF>

Pes

Pes

NF>

Co-,osite

Pes

Pes

NF>

8ecorator

Pes

Pes

NF>

Aacade Aront Contro**er A*0weig$t %ro10 /odu*e

Pes

Pes

NF>

No Pes Pes No

Pes No No No

NF>

NF> NF>

NF>

- 1)2 -

Course Notes: Behavioral patterns Aame Description In Code In Design Complete64= .ther Patterns 7 No No
NF>

7enera*iDed obser"er< w$ic$ a**ows -u*ti,*e +*ac?board readers and writers Co--unicates infor-ation s0ste--wide >"oid cou,*ing t$e sender of a re@uest to its recei"er b0 gi"ing -ore t$an one object a c$ance C$ain of to $and*e t$e re@uest C$ain t$e recei"ing objects res,onsibi*it0 and ,ass t$e re@uest a*ong t$e c$ain unti* an object $and*es it Enca,su*ate a re@uest as an object< t$ereb0 *etting 0ou ,ara-eteriDe c*ients wit$ different re@uests< Co--and @ueue or *og re@uests< and su,,ort undoab*e o,erations 7i"en a *anguage< define a re,resentation for its gra--ar a*ong wit$ an inter,reter t$at uses t$e !nter,reter re,resentation to inter,ret sentences in t$e *anguage %ro"ide a wa0 to access t$e e*e-ents of an !terator aggregate object se@uentia**0 wit$out e1,osing its under*0ing re,resentation 8efine an object t$at enca,su*ates $ow a set of objects interact /ediator ,ro-otes *oose cou,*ing /ediator b0 ?ee,ing objects fro- referring to eac$ ot$er e1,*icit*0< and it *ets 0ou "ar0 t$eir interaction inde,endent*0 3it$out "io*ating enca,su*ation< ca,ture and /e-ento e1terna*iDe an object4s interna* state a**owing t$e object to be restored to t$is state *ater >"oid nu** references b0 ,ro"iding a defau*t Nu** object object 8efine a one-to--an0 de,endenc0 between Obser"er or objects w$ere a state c$ange in one object resu*ts %ub*is$Fsubscrib in a** its de,endents being notified and u,dated e auto-atica**0 8efine co--on functiona*it0 for a grou, of Ser"ant c*asses S,ecification 5eco-binab*e business *ogic in a +oo*ean fas$ion State >**ow an object to a*ter its be$a"ior w$en its interna* state c$anges #$e object wi** a,,ear to - 1)3 -

Pes

No

NF>

Pes

No

NF>

Pes

No

NF>

Pes

Pes

NF>

Pes

No

NF>

Pes No

No No

NF>

NF>

Pes

Pes

NF>

No No Pes

No No No

NF> NF> NF>

Object-Oriented Software Engineering (CS350) c$ange its c*ass 8efine a fa-i*0 of a*gorit$-s< enca,su*ate eac$ one< and -a?e t$e- interc$angeab*e Strateg0 *ets t$e a*gorit$- "ar0 inde,endent*0 fro- c*ients t$at use it 8efine t$e s?e*eton of an a*gorit$- in an o,eration< deferring so-e ste,s to subc*asses #e-,*ate -et$od *ets subc*asses redefine certain ste,s of an a*gorit$- wit$out c$anging t$e a*gorit$-4s structure 5e,resent an o,eration to be ,erfor-ed on t$e e*e-ents of an object structure :isitor *ets 0ou define a new o,eration wit$out c$anging t$e c*asses of t$e e*e-ents on w$ic$ it o,erates

Strateg0

Pes

Pes

NF>

#e-,*ate -et$od

Pes

Pes

NF>

:isitor

Pes

No

NF>

- 1)' -

Course Notes: !oncurrency patterns Aame Description 8ecou,*es -et$od e1ecution fro- -et$od in"ocation t$at reside in t$eir own t$read of contro* #$e goa* is to introduce concurrenc0< b0 using as0nc$ronous -et$od in"ocation and a sc$edu*er for $and*ing re@uests On*0 e1ecute an action on an object w$en t$e object is in a ,articu*ar state Co-bining -u*ti,*e obser"ers to force ,ro,erties in different objects to be s0nc$roniDed or coordinated in so-e wa0 J21W >**ows t$e interc$ange of infor-ation (i e -essages) between co-,onents and a,,*ications 5educe t$e o"er$ead of ac@uiring a *oc? b0 first testing t$e *oc?ing criterion (t$e 4*oc? $int4) in an unsafe -annerG on*0 if t$at succeeds does t$e actua* *oc? ,roceed Can be unsafe w$en i-,*e-ented in so-e *anguageF$ardware co-binations !t can t$erefore so-eti-es be considered an anti-,attern In POSA268 .ther 27 Pes
NF>

>cti"e Object

+a*?ing +inding ,ro,erties /essaging design ,attern (/8%)

No No No

NF>

NF>

NF>

8oub*e-c$ec?ed *oc?ing

Pes

NF>

E"ent-based as0nc$ronous

>ddresses ,rob*e-s wit$ t$e as0nc$ronous ,attern t$at occur in -u*tit$readed ,rogra-s J22W /anages o,erations t$at re@uire bot$ a *oc? to be ac@uired 7uarded sus,ension and a ,recondition to be satisfied before t$e o,eration can be e1ecuted One t$read ,uts a H*oc?H on a resource< ,re"enting ot$er .oc? t$reads fro- accessing or -odif0ing it J23W >n object w$ose -et$ods are subject to -utua* e1c*usion< /onitor object t$us ,re"enting -u*ti,*e objects fro- erroneous*0 tr0ing to use it at t$e sa-e ti-e > reactor object ,ro"ides an as0nc$ronous interface to 5eactor resources t$at -ust be $and*ed s0nc$ronous*0 >**ows concurrent read access to an object< but re@uires 5ead-write *oc? e1c*usi"e access for write o,erations E1,*icit*0 contro* w$en t$reads -a0 e1ecute sing*eSc$edu*er t$readed code #$read ,oo* > nu-ber of t$reads are created to ,erfor- a nu-ber of tas?s< w$ic$ are usua**0 organiDed in a @ueue #0,ica**0< t$ere are -an0 -ore tas?s t$an t$reads Can be considered - 1)5 -

No No No Pes Pes No No No

NF>

NF>

/oE J 1&W
NF>

NF> NF> NF> NF>

Object-Oriented Software Engineering (CS350) a s,ecia* case of t$e object ,oo* ,attern #$read-s,ecific storage Static or Hg*oba*H -e-or0 *oca* to a t$read Pes
NF>

6ocu,entation
#$e docu-entation for a design ,attern describes t$e conte1t in w$ic$ t$e ,attern is used< t$e forces wit$in t$e conte1t t$at t$e ,attern see?s to reso*"e< and t$e suggested so*ution J2'W #$ere is no sing*e< standard for-at for docu-enting design ,atterns 5at$er< a "ariet0 of different for-ats $a"e been used b0 different ,attern aut$ors ;owe"er< according to /artin Aow*er< certain ,attern for-s $a"e beco-e -ore we**-?nown t$an ot$ers< and conse@uent*0 beco-e co--on starting ,oints for new ,atternwriting efforts J25W One e1a-,*e of a co--on*0 used docu-entation for-at is t$e one used b0 Eric$ 7a--a< 5ic$ard ;e*-< 5a*,$ Io$nson and Io$n :*issides (co**ecti"e*0 ?nown as t$e H7ang of AourH< or 7oA for s$ort) in t$eir boo? ,esign /atterns !t contains t$e fo**owing sections: attern Aame and !lassification: > descri,ti"e and uni@ue na-e t$at $e*,s in identif0ing and referring to t$e ,attern Intent: > descri,tion of t$e goa* be$ind t$e ,attern and t$e reason for using it $lso Bno%n $s: Ot$er na-es for t$e ,attern )otivation /'orces0: > scenario consisting of a ,rob*e- and a conte1t in w$ic$ t$is ,attern can be used $pplicability: Situations in w$ic$ t$is ,attern is usab*eG t$e conte1t for t$e ,attern &tructure: > gra,$ica* re,resentation of t$e ,attern C*ass diagra-s and !nteraction diagra-s -a0 be used for t$is ,ur,ose articipants: > *isting of t$e c*asses and objects used in t$e ,attern and t$eir ro*es in t$e design !ollaboration: > descri,tion of $ow c*asses and objects used in t$e ,attern interact wit$ eac$ ot$er !onse#uences: > descri,tion of t$e resu*ts< side effects< and trade offs caused b0 using t$e ,attern Implementation: > descri,tion of an i-,*e-entation of t$e ,atternG t$e so*ution ,art of t$e ,attern &ample !ode: >n i**ustration of $ow t$e ,attern can be used in a ,rogra--ing *anguage Bno%n Uses: E1a-,*es of rea* usages of t$e ,attern Related atterns: Ot$er ,atterns t$at $a"e so-e re*ations$i, wit$ t$e ,atternG discussion of t$e differences between t$e ,attern and si-i*ar ,atterns

Criticis#$e conce,t of design ,atterns $as been criticiDed in se"era* wa0s #$e design ,atterns -a0 just be a sign of so-e -issing features of a gi"en ,rogra--ing *anguage (Ia"a or CBB for instance) %eter Nor"ig de-onstrates t$at 1( out of t$e 23 ,atterns in t$e 8esign %atterns boo? (t$at is ,ri-ari*0 focused on CBB) are si-,*ified or e*i-inated ("ia direct *anguage su,,ort) in .is, or 80*an J2(W See a*so %au* 7ra$a-4s essa0 H5e"enge of t$e NerdsH J22W /oreo"er< ina,,ro,riate use of ,atterns -a0 unnecessari*0 increase co-,*e1it0 J2)W - 1)( -

Course Notes:

11! ;ser interface design


4raphical -ser #nterface 64-#7
!n co-,uting< a graphical user interface (>UI< co--on*0 ,ronounced gooeyJ1W) is a t0,e of user interface t$at a**ows users to interact wit$ e*ectronic de"ices using i-ages rat$er t$an te1t co--ands 83*s can be used in co-,uters< $and-$e*d de"ices suc$ as /%3 ,*a0ers< ,ortab*e -edia ,*a0ers or ga-ing de"ices< $ouse$o*d a,,*iances and office e@ui,-ent > 83* re,resents t$e infor-ation and actions a"ai*ab*e to a user t$roug$ gra,$ica* icons and "isua* indicators suc$ as secondar0 notation< as o,,osed to te1t-based interfaces< t0,ed co--and *abe*s or te1t na"igation #$e actions are usua**0 ,erfor-ed t$roug$ direct -ani,u*ation of t$e gra,$ica* e*e-ents J2W #$e ter- 83* is restricted to t$e sco,e of two-di-ensiona* dis,*a0 screens wit$ dis,*a0 reso*utions ab*e to describe generic infor-ation< in t$e tradition of t$e co-,uter science researc$ at t$e %>5C (%a*o >*to 5esearc$ Center) #$e ter- 83* is rare*0 a,,*ied to ot$er $ig$-reso*ution t0,es of interfaces t$at are non-generic< suc$ as "ideo ga-es (w$ere ;=8J3W is ,referred)< or not restricted to f*at screens< *i?e "o*u-etric dis,*a0s J'W

9istor/
>n ear*0-1&&0s st0*e =ni1 des?to, running t$e T 3indow S0ste- gra,$ica* user interface /ain artic*e: ;istor0 of t$e gra,$ica* user interface Precursors > ,recursor to 7=!s was in"ented b0 researc$ers at t$e Stanford 5esearc$ !nstitute< *ed b0 8oug*as Enge*bart #$e0 de"e*o,ed t$e use of te1t-based $0,er*in?s -ani,u*ated wit$ a -ouse for t$e On-.ine S0ste- #$e conce,t of $0,er*in?s was furt$er refined and e1tended to gra,$ics b0 researc$ers at Tero1 %>5C< s,ecifica**0 >*an Sa0< w$o went be0ond te1t-based $0,er*in?s and used a 7=! as t$e ,ri-ar0 interface for t$e Tero1 >*to co-,uter /ost -odern genera*-,ur,ose 7=!s are deri"ed frot$is s0ste!"an Sut$er*and de"e*o,ed a ,ointer-based s0ste- ca**ed t$e S?etc$,ad in 1&(3 !t used a *ig$t-,en to guide t$e creation and -ani,u*ation of objects in engineering drawings P%+C user interface #$e %>5C user interface consisted of gra,$ica* e*e-ents suc$ as windows< -enus< radio buttons< c$ec? bo1es and icons #$e %>5C user interface e-,*o0s a ,ointing de"ice in addition to a ?e0board #$ese as,ects can be e-,$asiDed b0 using t$e a*ternati"e acron0- 3!/%< w$ic$ stands for windows< icons< menus and !ointing device

- 1)2 -

Object-Oriented Software Engineering (CS350) Evolution Ao**owing %>5C t$e first 7=!-centric co-,uter o,erating -ode* was t$e Tero1 )010 Star !nfor-ation S0ste- in 1&)1<J5W fo**owed b0 t$e >,,*e .isa (w$ic$ ,resented t$e conce,t of -enu bar as we** as window contro*s) in 1&)3< t$e >,,*e /acintos$ 12)S in 1&)'< and t$e >tari S# and Co--odore >-iga in 1&)5 #$e ear*0 7=! co--ands< unti* t$e ad"ent of !+/ Co--on =ser >ccess< J(W used different co--and se@uences for different ,rogra-s > co--and *i?e t$e A3 function ?e0 acti"ated $e*, in 3ord%erfect< but e1ited an !+/ ,rogra- #$e -enus were accessed b0 different ?e0s (contro* in 3ordStar< >*t or A10 in /icrosoft ,rogra-s< HFH in .otus 1-2-3< A& in Norton Co--ander to na-e a few co--on ones) #o t$is end< t$e ear*0 software ca-e wit$ ?e0board o"er*a0s #$ese are ,*astic or ,a,er -as?s w$ic$ sit o"er t$e e-,t0 s,ace between t$e ?e0s< ,ro"iding t$e user wit$ t$e na-ed a,,*ication4s use of "arious ?e0s E"en toda0< different ?e0stro?es e1ist wit$ radica**0 different ca**s Aor e1a-,*e< t$e Contro*->*t8e*ete interface is interce,ted in 3indows and =buntu to in"o?e a tas? -enu !n ot$er =ni1 %Cs0ste-s< t$is usua**0 in"o?es an auto-atic s$utdown #$e 7=!s fa-i*iar to -ost ,eo,*e toda0JtimeframeFW are /icrosoft 3indows< /ac OS T< and T 3indow S0ste- interfaces for des?to, and *a,to, co-,uters< and S0-bian< +*ac?+err0 OS< >ndroid< 3indows %$one and >,,*e4s iOS for $and$e*d (Hs-art,$oneH) de"ices >,,*e< !+/ and /icrosoft used -an0 of Tero14s ideas to de"e*o, ,roducts< and !+/4s Co--on =ser >ccess s,ecifications for-ed t$e basis of t$e user interface found in /icrosoft 3indows< !+/ OSF2 %resentation /anager< and t$e =ni1 /otif too*?it and window -anager #$ese ideas e"o*"ed to create t$e interface found in current "ersions of /icrosoft 3indows< as we** as in /ac OS T and "arious des?to, en"iron-ents for =ni1-*i?e o,erating s0ste-s< suc$ as .inu1 #$us -ost current 7=!s $a"e *arge*0 co--on idio-s

Co,+onents
/ain artic*e: E*e-ents of gra,$ica* user interfaces Aurt$er infor-ation: 3!/% (co-,uting)< 3indow -anager< and 8es?to, en"iron-ent > 7=! uses a co-bination of tec$no*ogies and de"ices to ,ro"ide a ,*atfor- t$at t$e user can interact wit$< for t$e tas?s of gat$ering and ,roducing infor-ation > series of e*e-ents confor-ing a "isua* *anguage $a"e e"o*"ed to re,resent infor-ation stored in co-,uters #$is -a?es it easier for ,eo,*e wit$ few co-,uter s?i**s to wor? wit$ and use co-,uter software #$e -ost co--on co-bination of suc$ e*e-ents in 7=!s is t$e 3!/% (Hwindow< icon< -enu< ,ointing de"iceH) ,aradig-< es,ecia**0 in ,ersona* co-,uters #$e 3!/% st0*e of interaction uses a ,$0sica* in,ut de"ice to contro* t$e ,osition of a ,ointer and ,resents infor-ation organiDed in windows and re,resented wit$ icons >"ai*ab*e co--ands are co-,i*ed toget$er in -enus< and actions are ,erfor-ed -a?ing gestures wit$ t$e ,ointing de"ice > window -anager faci*itates t$e interactions between windows< a,,*ications< and t$e windowing s0ste- #$e windowing s0ste- $and*es $ardware de"ices suc$ as ,ointing de"ices and gra,$ics $ardware< as we** as t$e ,ositioning of t$e ,ointer - 1)) -

Course Notes: !n ,ersona* co-,uters a** t$ese e*e-ents are -ode*ed t$roug$ a des?to, -eta,$or< to ,roduce a si-u*ation ca**ed a des?to, en"iron-ent in w$ic$ t$e dis,*a0 re,resents a des?to,< u,on w$ic$ docu-ents and fo*ders of docu-ents can be ,*aced 3indow -anagers and ot$er software co-bine to si-u*ate t$e des?to, en"iron-ent wit$ "ar0ing degrees of rea*is-

%ost-1".% interfaces
S-a**er -obi*e de"ices suc$ as %8>s and s-art,$ones t0,ica**0 use t$e 3!/% e*e-ents wit$ different unif0ing -eta,$ors< due to constraints in s,ace and a"ai*ab*e in,ut de"ices >,,*ications for w$ic$ 3!/% is not we** suited -a0 use newer interaction tec$ni@ues< co**ecti"e*0 na-ed as ,ost-3!/% user interfaces J2W >s of 2011< so-e touc$-screen-based o,erating s0ste-s suc$ as >,,*e4s iOS (i%$one) and >ndroid use t$e c*ass of 7=!s na-ed ,ost-3!/% #$ese su,,ort st0*es of interaction using -ore t$an one finger in contact wit$ a dis,*a0< w$ic$ a**ows actions suc$ as ,inc$ing and rotating< w$ic$ are unsu,,orted b0 one ,ointer and -ouse J)W %ost-3!/% inc*udes 38 co-,ositing window -anagers suc$ as Co-,iD< 8es?to, 3indow /anager< and .738 So-e ,ost-3!/% interfaces -a0 be better suited for a,,*ications w$ic$ -ode* i--ersi"e 38 en"iron-ents< suc$ as 7oog*e Eart$ J&W

;ser interface and interaction design


/ain artic*e: =ser interface design 8esigning t$e "isua* co-,osition and te-,ora* be$a"ior of 7=! is an i-,ortant ,art of software a,,*ication ,rogra--ing in t$e area of $u-an-co-,uter interaction !ts goa* is to en$ance t$e efficienc0 and ease of use for t$e under*0ing *ogica* design of a stored ,rogra-< a design disci,*ine ?nown as usabi*it0 /et$ods of user-centered design are used to ensure t$at t$e "isua* *anguage introduced in t$e design is we** tai*ored to t$e tas?s #$e "isib*e gra,$ica* interface features of an a,,*ication are so-eti-es referred to as Hc$ro-eH J10W J11W #0,ica**0< t$e user interacts wit$ infor-ation b0 -ani,u*ating "isua* widgets t$at a**ow for interactions a,,ro,riate to t$e ?ind of data t$e0 $o*d #$e widgets of a we**-designed interface are se*ected to su,,ort t$e actions necessar0 to ac$ie"e t$e goa*s of t$e user > -ode*-"iew-contro**er a**ows for a f*e1ib*e structure in w$ic$ t$e interface is inde,endent fro- and indirect*0 *in?ed to a,,*ication functiona*it0< so t$e 7=! can be easi*0 custo-iDed #$is a**ows t$e user to se*ect or design a different s&in at wi**< and eases t$e designer4s wor? to c$ange t$e interface as t$e user needs e"o*"e 7ood user interface design re*ates to t$e user< not t$e s0ste- arc$itecture .arge widgets< suc$ as windows< usua**0 ,ro"ide a fra-e or container for t$e -ain ,resentation content suc$ as a web ,age< e-ai* -essage or drawing S-a**er ones usua**0 act as a user-in,ut too* > 7=! -a0 be designed for t$e re@uire-ents of a "ertica* -ar?et as a,,*ication-s,ecific gra,$ica* user interfaces E1a-,*es of a,,*ication-s,ecific 7=!s are: >uto-ated te**er -ac$ines (>#/) %oint-Of-Sa*e touc$screens at restaurants J12W Se*f-ser"ice c$ec?outs used in a retai* store - 1)& -

Object-Oriented Software Engineering (CS350) >ir*ine se*f-tic?eting and c$ec?-in !nfor-ation ?ios?s in a ,ub*ic s,ace< *i?e a train station or a -useu /onitors or contro* screens in an e-bedded industria* a,,*ication w$ic$ e-,*o0 a rea* ti-e o,erating s0ste- (5#OS) #$e *atest ce** ,$ones and $and$e*d ga-e s0ste-s a*so e-,*o0 a,,*ication s,ecific touc$screen 7=!s Newer auto-obi*es use 7=!s in t$eir na"igation s0ste-s and touc$ screen -u*ti-edia centers

Co,+arison to ot$er interfaces


Command-line interfaces 7=!s were introduced in reaction to t$e ,ercei"ed stee, *earning cur"e of co--and-*ine interfaces (C.!)<J13WJ1'WJ1'W w$ic$ re@uire co--ands to be t0,ed on t$e ?e0board Since t$e co--ands a"ai*ab*e in co--and *ine interfaces can be nu-erous< co-,*icated o,erations can be co-,*eted using a s$ort se@uence of words and s0-bo*s #$is a**ows for greater efficienc0 and ,roducti"it0 once -an0 co--ands are *earned<J13WJ1'WJ1'W but reac$ing t$is *e"e* ta?es so-e ti-e because t$e co--and words are not easi*0 disco"erab*e and not -ne-onic 3!/%s (Hwindow< icon< -enu< ,ointing de"iceH)< on t$e ot$er $and< ,resent t$e user wit$ nu-erous widgets t$at re,resent and can trigger so-e of t$e s0ste-4s a"ai*ab*e co--ands On t$e ot$er $and< 7=!s can be -ade @uite $ard b0 bur0ing dia*ogs dee, in t$e s0ste-< or -o"ing dia*ogs fro- ,*ace to ,*ace >*so< dia*og bo1es are considerab*0 $arder for t$e user to scri,t 3!/%s e1tensi"e*0 use -odes as t$e -eaning of a** ?e0s and c*ic?s on s,ecific ,ositions on t$e screen are redefined a** t$e ti-e Co--and *ine interfaces use -odes on*0 in *i-ited for-s< suc$ as t$e current director0 and en"iron-ent "ariab*es /ost -odern o,erating s0ste-s ,ro"ide bot$ a 7=! and so-e *e"e* of a C.!< a*t$oug$ t$e 7=!s usua**0 recei"e -ore attention #$e 7=! is usua**0 3!/%-based< a*t$oug$ occasiona**0 ot$er -eta,$ors surface< suc$ as t$ose used in /icrosoft +ob< 3dw- or Ai*e S0ste- :isua*iDer (AS:) >,,*ications -a0 a*so ,ro"ide bot$ interfaces< and w$en t$e0 do t$e 7=! is usua**0 a 3!/% wra,,er around t$e co--and-*ine "ersion #$is is es,ecia**0 co--on wit$ a,,*ications designed for =ni1-*i?e o,erating s0ste-s #$e *atter used to be i-,*e-ented first because it a**owed t$e de"e*o,ers to focus e1c*usi"e*0 on t$eir ,roduct4s functiona*it0 wit$out bot$ering about interface detai*s suc$ as designing icons and ,*acing buttons 8esigning ,rogra-s t$is wa0 a*so a**ows users to run t$e ,rogra- noninteracti"e*0< suc$ as in a s$e** scri,t

$ree-di,ensional user interfaces


Aor t0,ica* co-,uter dis,*a0s< three#dimensional is a -isno-erXt$eir dis,*a0s are two-di-ensiona* Se-antica**0< $owe"er< -ost gra,$ica* user interfaces use t$ree di-ensions - in addition to $eig$t and widt$< t$e0 offer a t$ird di-ension of *a0ering or stac?ing screen e*e-ents o"er one anot$er #$is -a0 be re,resented "isua**0 on screen t$roug$ an i**usionar0 trans,arent effect< w$ic$ offers t$e ad"antage t$at infor-ation in bac?ground windows -a0 sti** be read< if not interacted wit$ Or t$e en"iron-ent -a0 si-,*0 $ide t$e bac?ground infor-ation< ,ossib*0 -a?ing t$e distinction a,,arent b0 drawing a - 1&0 -

Course Notes: dro, s$adow effect o"er it So-e en"iron-ents use t$e -et$ods of 38 gra,$ics to ,roject "irtua* t$ree di-ensiona* user interface objects onto t$e screen #$ese are often s$own in use in sci-fi fi*-s (see be*ow for e1a-,*es) >s t$e ,rocessing ,ower of co-,uter gra,$ics $ardware increases< t$is beco-es *ess of an obstac*e to a s-oot$ user e1,erience #$ree-di-ensiona* gra,$ics are current*0 -ost*0 used in co-,uter ga-es< art and co-,uter-aided design (C>8) > t$ree-di-ensiona* co-,uting en"iron-ent cou*d a*so be usefu* in ot$er scenarios< *i?e -o*ecu*ar gra,$ics and aircraft design Se"era* atte-,ts $a"e been -ade to create a -u*ti-user t$ree-di-ensiona* en"iron-ent< inc*uding t$e Cro@uet %roject and Sun4s %roject .oo?ing 7*ass "echnologies #$e use of t$ree-di-ensiona* gra,$ics $as beco-e increasing*0 co--on in -ainstrea- o,erating s0ste-s< fro- creating attracti"e interfacesXe0e cand0X to functiona* ,ur,oses on*0 ,ossib*e using t$ree di-ensions Aor e1a-,*e< user switc$ing is re,resented b0 rotating a cube w$ose faces are eac$ user4s wor?s,ace< and window -anage-ent is re,resented "ia a 5o*ode1-st0*e f*i,,ing -ec$anis- in 3indows :ista (see 3indows A*i, 38) !n bot$ cases< t$e o,erating s0ste- transfor-s windows ont$e-f*0 w$i*e continuing to u,date t$e content of t$ose windows !nterfaces for t$e T 3indow S0ste- $a"e a*so i-,*e-ented ad"anced t$ree-di-ensiona* user interfaces t$roug$ co-,ositing window -anagers suc$ as +er0*< Co-,iD and S3in using t$e >!7.T or T7. arc$itectures< a**owing for t$e usage of O,en7. to ani-ate t$e user4s interactions wit$ t$e des?to, >not$er branc$ in t$e t$ree-di-ensiona* des?to, en"iron-ent is t$e t$ree-di-ensiona* 7=!s t$at ta?e t$e des?to, -eta,$or a ste, furt$er< *i?e t$e +u-,#o,< w$ere a user can -ani,u*ate docu-ents and windows as if t$e0 were Hrea* wor*dH docu-ents< wit$ rea*istic -o"e-ent and ,$0sics #$e Yoo-ing =ser !nterface (Y=!) is a re*ated tec$no*og0 t$at ,ro-ises to de*i"er t$e re,resentation benefits of 38 en"iron-ents wit$out t$eir usabi*it0 drawbac?s of orientation ,rob*e-s and $idden objects !t is a *ogica* ad"ance-ent on t$e 7=!< b*ending so-e t$ree-di-ensiona* -o"e-ent wit$ twodi-ensiona* or H2 58H "ector objects !n 200(< ;i**crest .abs introduced t$e first Doo-ing user interface for te*e"ision J15W

- 1&1 -

Object-Oriented Software Engineering (CS350)

Design principles
User interface design or user interface engineering is t$e design of co-,uters< a,,*iances< -ac$ines< -obi*e co--unication de"ices< software a,,*ications< and websites wit$ t$e focus on t$e user4s e1,erience and interaction #$e goa* of user interface design is to -a?e t$e user4s interaction as si-,*e and efficient as ,ossib*e< in ter-s of acco-,*is$ing user goa*sXw$at is often ca**ed user-centered design 7ood user interface design faci*itates finis$ing t$e tas? at $and wit$out drawing unnecessar0 attention to itse*f 7ra,$ic design -a0 be uti*iDed to su,,ort its usabi*it0 #$e design ,rocess -ust ba*ance tec$nica* functiona*it0 and "isua* e*e-ents (e g < -enta* -ode*) to create a s0ste- t$at is not on*0 o,erationa* but a*so usab*e and ada,tab*e to c$anging user needs !nterface design is in"o*"ed in a wide range of ,rojects fro- co-,uter s0ste-s< to cars< to co--ercia* ,*anesG a** of t$ese ,rojects in"o*"e -uc$ of t$e sa-e basic $u-an interactions 0et a*so re@uire so-e uni@ue s?i**s and ?now*edge >s a resu*t< designers tend to s,ecia*iDe in certain t0,es of ,rojects and $a"e s?i**s centered around t$eir e1,ertise< w$et$er t$at be software design< user researc$< web design< or industria* design

%rocesses
#$ere are se"era* ,$ases and ,rocesses in t$e user interface design< so-e of w$ic$ are -ore de-anded u,on t$an ot$ers< de,ending on t$e ,roject (Note: for t$e re-ainder of t$is section< t$e word system is used to denote an0 ,roject w$et$er it is a web site< a,,*ication< or de"ice ) Aunctiona*it0 re@uire-ents gat$ering C asse-b*ing a *ist of t$e functiona*it0 re@uired b0 t$e s0ste- to acco-,*is$ t$e goa*s of t$e ,roject and t$e ,otentia* needs of t$e users =ser ana*0sis C ana*0sis of t$e ,otentia* users of t$e s0ste- eit$er t$roug$ discussion wit$ ,eo,*e w$o wor? wit$ t$e users andFor t$e ,otentia* users t$e-se*"es #0,ica* @uestions in"o*"e: 3$at wou*d t$e user want t$e s0ste- to do6 ;ow wou*d t$e s0ste- fit in wit$ t$e user4s nor-a* wor?f*ow or dai*0 acti"ities6 ;ow tec$nica**0 sa""0 is t$e user and w$at si-i*ar s0ste-s does t$e user a*read0 use6 3$at interface *oo? 9 fee* st0*es a,,ea* to t$e user6 !nfor-ation arc$itecture C de"e*o,-ent of t$e ,rocess andFor infor-ation f*ow of t$e s0ste(i e for ,$one tree s0ste-s< t$is wou*d be an o,tion tree f*owc$art and for web sites t$is wou*d be a site f*ow t$at s$ows t$e $ierarc$0 of t$e ,ages) %rotot0,ing C de"e*o,-ent of wirefra-es< eit$er in t$e for- of ,a,er ,rotot0,es or si-,*e interacti"e screens #$ese ,rotot0,es are stri,,ed of a** *oo? 9 fee* e*e-ents and -ost content in order to concentrate on t$e interface =sabi*it0 testing C testing of t$e ,rotot0,es on an actua* userXoften using a tec$ni@ue ca**ed t$in? a*oud ,rotoco* w$ere 0ou as? t$e user to ta*? about t$eir t$oug$ts during t$e e1,erience 7ra,$ic !nterface design C actua* *oo? 9 fee* design of t$e fina* gra,$ica* user interface (7=!) !t -a0 be based on t$e findings de"e*o,ed during t$e usabi*it0 testing if usabi*it0 is un,redictab*e< or based on co--unication objecti"es and st0*es t$at wou*d a,,ea* to t$e user !n rare cases< t$e gra,$ics -a0 dri"e t$e ,rotot0,ing< de,ending on t$e i-,ortance of "isua* for- 1&2 -

Course Notes: "ersus function !f t$e interface re@uires -u*ti,*e s?ins< t$ere -a0 be -u*ti,*e interface designs for one contro* ,ane*< functiona* feature or widget #$is ,$ase is often a co**aborati"e effort between a gra,$ic designer and a user interface designer< or $and*ed b0 one w$o is ,roficient in bot$ disci,*ines =ser interface design re@uires a good understanding of user needs

3e>uire,ents
#$e d0na-ic c$aracteristics of a s0ste- are described in ter-s of t$e dia*ogue re@uire-ents contained in se"en ,rinci,*es of ,art 10 of t$e ergono-ics standard< t$e !SO &2'1 #$is standard estab*is$es a fra-ewor? of ergono-ic H,rinci,*esH for t$e dia*ogue tec$ni@ues wit$ $ig$-*e"e* definitions and i**ustrati"e a,,*ications and e1a-,*es of t$e ,rinci,*es #$e ,rinci,*es of t$e dia*ogue re,resent t$e d0na-ic as,ects of t$e interface and can be -ost*0 regarded as t$e Hfee*H of t$e interface #$e se"en dia*ogue ,rinci,*es are: Suitabi*it0 for t$e tas?: t$e dia*ogue is suitab*e for a tas? w$en it su,,orts t$e user in t$e effecti"e and efficient co-,*etion of t$e tas? Se*f-descri,ti"eness: t$e dia*ogue is se*f-descri,ti"e w$en eac$ dia*ogue ste, is i--ediate*0 co-,re$ensib*e t$roug$ feedbac? fro- t$e s0ste- or is e1,*ained to t$e user on re@uest Contro**abi*it0: t$e dia*ogue is contro**ab*e w$en t$e user is ab*e to initiate and contro* t$e direction and ,ace of t$e interaction unti* t$e ,oint at w$ic$ t$e goa* $as been -et Confor-it0 wit$ user e1,ectations: t$e dia*ogue confor-s wit$ user e1,ectations w$en it is consistent and corres,onds to t$e user c$aracteristics< suc$ as tas? ?now*edge< education< e1,erience< and to co--on*0 acce,ted con"entions Error to*erance: t$e dia*ogue is error to*erant if des,ite e"ident errors in in,ut< t$e intended resu*t -a0 be ac$ie"ed wit$ eit$er no or -ini-a* action b0 t$e user Suitabi*it0 for indi"idua*iDation: t$e dia*ogue is ca,ab*e of indi"idua*iDation w$en t$e interface software can be -odified to suit t$e tas? needs< indi"idua* ,references< and s?i**s of t$e user Suitabi*it0 for *earning: t$e dia*ogue is suitab*e for *earning w$en it su,,orts and guides t$e user in *earning to use t$e s0ste#$e conce,t of usabi*it0 is defined in %art 11 of t$e !SO &2'1 standard b0 effecti"eness< efficienc0< and satisfaction of t$e user %art 11 gi"es t$e fo**owing definition of usabi*it0: =sabi*it0 is -easured b0 t$e e1tent to w$ic$ t$e intended goa*s of use of t$e o"era** s0ste- are ac$ie"ed (effecti"eness) #$e resources t$at $a"e to be e1,ended to ac$ie"e t$e intended goa*s (efficienc0) #$e e1tent to w$ic$ t$e user finds t$e o"era** s0ste- acce,tab*e (satisfaction) Effecti"eness< efficienc0< and satisfaction can be seen as @ua*it0 factors of usabi*it0 #o e"a*uate t$ese factors< t$e0 need to be deco-,osed into sub-factors< and fina**0< into usabi*it0 -easures #$e infor-ation ,resentation is described in %art 12 of t$e !SO &2'1 standard for t$e organiDation of infor-ation (arrange-ent< a*ign-ent< grou,ing< *abe*s< *ocation)< for t$e dis,*a0 of gra,$ica* objects< and for t$e coding of infor-ation (abbre"iation< co*or< siDe< s$a,e< "isua* cues) b0 se"en attributes #$e Hattributes of ,resented infor-ationH re,resent t$e static as,ects of t$e interface and can be genera**0 - 1&3 -

Object-Oriented Software Engineering (CS350) regarded as t$e H*oo?H of t$e interface #$e attributes are detai*ed in t$e reco--endations gi"en in t$e standard Eac$ of t$e reco--endations su,,orts one or -ore of t$e se"en attributes #$e se"en ,resentation attributes are: C*arit0: t$e infor-ation content is con"e0ed @uic?*0 and accurate*0 8iscri-inabi*it0: t$e dis,*a0ed infor-ation can be distinguis$ed accurate*0 Conciseness: users are not o"er*oaded wit$ e1traneous infor-ation Consistenc0: a uni@ue design< confor-it0 wit$ userOs e1,ectation 8etectabi*it0: t$e userOs attention is directed towards infor-ation re@uired .egibi*it0: infor-ation is eas0 to read Co-,re$ensibi*it0: t$e -eaning is c*ear*0 understandab*e< una-biguous< inter,retab*e< and recogniDab*e

#$e user guidance in %art 13 of t$e !SO &2'1 standard describes t$at t$e user guidance infor-ation s$ou*d be readi*0 distinguis$ab*e fro- ot$er dis,*a0ed infor-ation and s$ou*d be s,ecific for t$e current conte1t of use =ser guidance can be gi"en b0 t$e fo**owing fi"e -eans: %ro-,ts indicating e1,*icit*0 (s,ecific ,ro-,ts) or i-,*icit*0 (generic ,ro-,ts) t$at t$e s0steis a"ai*ab*e for in,ut Aeedbac? infor-ing about t$e userOs in,ut ti-e*0< ,erce,tib*e< and non-intrusi"e Status infor-ation indicating t$e continuing state of t$e a,,*ication< t$e s0ste-Os $ardware and software co-,onents< and t$e userOs acti"ities Error -anage-ent inc*uding error ,re"ention< error correction< user su,,ort for error -anage-ent< and error -essages On-*ine $e*, for s0ste--initiated and user initiated re@uests wit$ s,ecific infor-ation for t$e current conte1t of use

3esearc$ E %ast and Ongoing


=ser interface design $as been a to,ic of considerab*e researc$< inc*uding on its aest$etics J1W !n t$e ,ast standards $a"e been de"e*o,ed< as far bac? as t$e eig$ties for defining t$e usabi*it0 of software ,roducts J2W One of t$e structura* basis $as beco-e t$e !A!% userinterface reference -ode* #$e -ode* ,ro,oses four di-ensions to structure t$e user interface: #$e in,utFout,ut di-ension (t$e *oo?) #$e dia*ogue di-ension (t$e fee*) #$e tec$nica* or functiona* di-ension (t$e access to too*s and ser"ices) #$e organiDationa* di-ension (t$e co--unication and co-o,eration su,,ort)

#$is -ode* $as great*0 inf*uenced t$e de"e*o,-ent of t$e internationa* standard !SO &2'1 describing t$e interface design re@uire-ents for usabi*it0 #$e desire to understand a,,*ication-s,ecific =! issues ear*0 in software de"e*o,-ent< e"en as an a,,*ication was being de"e*o,ed< *ed to researc$ on 7=! ra,id ,rotot0,ing too*s t$at -ig$t offer con"incing si-u*ations of $ow an actua* a,,*ication -ig$t be$a"e in ,roduction use J3W So-e of t$is researc$ $as s$own t$at a wide "ariet0 of ,rogra--ing tas?s for 7=!-based software can< in fact< be s,ecified t$roug$ -eans ot$er t$an writing ,rogra- code J'W

- 1&' -

Course Notes: 5esearc$ in recent 0ears is strong*0 -oti"ated b0 t$e increasing "ariet0 of de"ices t$at can< b0 "irtue of /oore4s .aw< $ost "er0 co-,*e1 interfaces J5W #$ere is a*so researc$ on generating user interfaces auto-atica**0< to -atc$ a user4s *e"e* of abi*it0 for different ?inds of interaction J(W Cogniti"e di-ensions E*e-ents of gra,$ica* user interfaces E1,erience design =ser e1,erience design 7a-e,*a0 7ender ;C! 7ra,$ica* user interface ;u-an-co-,uter interaction ;u-an geogra,$0 ;u-an interface guide*ines !nfor-ation arc$itecture !nteraction design !nteraction design ,attern !nteracti"it0 Snow*edge "isua*iDation Natura* -a,,ing (interface design) New interfaces for -usica* e1,ression %artici,ator0 design %rinci,*es of user interface design %rogressi"e disc*osure =sabi*it0 =ser-centered design =ser interface 3eb design Co-,uter icon !con design

Data vs0 information


6ata
Data (FddeetfF DAY#tG< FddgtfF DA#tG< or FddhitfF DAH#tG) are "a*ues of @ua*itati"e or @uantitati"e "ariab*es< be*onging to a set of ite-s 8ata in co-,uting (or data ,rocessing) are often re,resented b0 a co-bination of ite-s organiDed in rows and -u*ti,*e "ariab*es organiDed in co*u-ns 8ata are t0,ica**0 t$e resu*ts of -easure-ents and can be "isua*ised using gra,$s or i-ages 8ata as an abstract - 1&5 -

#$e word data is t$e ,*ura* of datum< neuter ,ast ,artici,*e of t$e .atin dare< Hto gi"eH< $ence Hso-et$ing gi"enH !n discussions of ,rob*e-s in geo-etr0< -at$e-atics< engineering < and so on< t$e ter-s givens and data are used interc$angeab*0 Suc$ usage is t$e origin of data as a conce,t in co-,uter science or data ,rocessing: data are nu-bers< words< i-ages< etc < acce,ted as t$e0 stand

Object-Oriented Software Engineering (CS350) conce,t can be "iewed as t$e *owest *e"e* of abstraction fro- w$ic$ infor-ation and t$en ?now*edge are deri"ed +aw data< i e < un,rocessed data< refers to a co**ection of nu-bers< c$aracters and is a re*ati"e ter-G data ,rocessing co--on*0 occurs b0 stages< and t$e H,rocessed dataH fro- one stage -a0 be considered t$e Hraw dataH of t$e ne1t Aie*d data refers to raw data co**ected in an uncontro**ed in situ en"iron-ent E1,eri-enta* data refers to data generated wit$in t$e conte1t of a scientific in"estigation b0 obser"ation and recording -sage in English !n Eng*is$< t$e word datum is sti** used in t$e genera* sense of Han ite- gi"enH !n cartogra,$0< geogra,$0< nuc*ear -agnetic resonance and tec$nica* drawing it is often used to refer to a sing*e s,ecific reference datu- fro- w$ic$ distances to a** ot$er data are -easured >n0 -easure-ent or resu*t is a datum< but data !oint is -ore usua*<J1W a*beit tauto*ogica* or< -ore generous*0< ,*eonastic +ot$ datums (see usage in datu- artic*e) and t$e origina**0 .atin ,*ura* data are used as t$e ,*ura* of datum in Eng*is$< but data is co--on*0 treated as a -ass noun and used wit$ a "erb in t$e singu*ar for-< es,ecia**0 in da0-to-da0 usage Aor e1a-,*e< This is all the data from the e"!eriment #$is usage is inconsistent wit$ t$e ru*es of .atin gra--ar and traditiona* Eng*is$ (These are all the data from the e"!eriment) E"en w$en a "er0 s-a** @uantit0 of data is referenced (one nu-ber< for e1a-,*e) t$e ,$rase !iece of data is often used< as o,,osed to datum #$e debate o"er a,,ro,riate usage is ongoing J2WJ3WJ'W #$e !EEE Co-,uter Societ0 a**ows usage of data as eit$er a -ass noun or ,*ura* based on aut$or ,reference J5W Ot$er ,rofessiona* organiDations and st0*e guidesJ(W re@uire t$at aut$ors treat data as a ,*ura* noun Aor e1a-,*e< t$e >ir Aorce A*ig$t #est Center s,ecifica**0 states t$at t$e word data is a*wa0s ,*ura*< ne"er singu*ar J2W ,ata is -ost often used as a singu*ar -ass noun in educated e"er0da0 usage J)WJ&W So-e -ajor news,a,ers suc$ as The New Hor& Times use it eit$er in t$e singu*ar or ,*ura* !n t$e New Hor& Times t$e ,$rases Ht$e sur"e0 data are sti** being ana*0DedH and Ht$e first 0ear for w$ic$ data is a"ai*ab*eH $a"e a,,eared wit$in one da0 J10W #$e (all Street Cournal e1,*icit*0 a**ows t$is in its st0*e guide J11W !n scientific writing data is often treated as a ,*ura*< as in These data do not su!!ort the conclusions< but it is a*so used as a singu*ar -ass entit0 *i?e information +ritis$ usage now wide*0 acce,ts treating data as singu*ar in standard Eng*is$<J12W inc*uding e"er0da0 news,a,er usageJ13W at *east in nonscientific use J1'W =S scientific ,ub*is$ing sti** ,refers treating it as a ,*ura* J15W So-e =S uni"ersit0 st0*e guides reco--end using data for bot$ singu*ar and ,*ura* useJ1(W and so-e reco--end treating it on*0 as a singu*ar in connection wit$ co-,uters J12W Meaning of data( information and /nowledge

- 1&( -

Course Notes: #$e ter-s data< infor-ation and ?now*edge are fre@uent*0 used for o"er*a,,ing conce,ts #$e -ain difference is in t$e *e"e* of abstraction being considered 8ata is t$e *owest *e"e* of abstraction< infor-ation is t$e ne1t *e"e*< and fina**0< ?now*edge is t$e $ig$est *e"e* a-ong a** t$ree J1)W 8ata on its own carries no -eaning Aor data to beco-e infor-ation< it -ust be inter,reted and ta?e on a -eaning Aor e1a-,*e< t$e $eig$t of /t E"erest is genera**0 considered as HdataH< a boo? on /t E"erest geo*ogica* c$aracteristics -a0 be considered as Hinfor-ationH< and a re,ort containing ,ractica* infor-ation on t$e best wa0 to reac$ /t E"erest4s ,ea? -a0 be considered as H?now*edgeH !nfor-ation as a conce,t bears a di"ersit0 of -eanings< fro- e"er0da0 usage to tec$nica* settings 7enera**0 s,ea?ing< t$e conce,t of infor-ation is c*ose*0 re*ated to notions of constraint< co--unication< contro*< data< for-< instruction< ?now*edge< -eaning< -enta* sti-u*us< ,attern< ,erce,tion< and re,resentation +e0non-8a"ies uses t$e conce,t of a sign to distinguis$ between data and infor-ationG data are s0-bo*s w$i*e infor-ation occurs w$en s0-bo*s are used to refer to so-et$ing J1&W !t is ,eo,*e and co-,uters w$o co**ect data and i-,ose ,atterns on it #$ese ,atterns are seen as infor-ation w$ic$ can be used to en$ance ?now*edge #$ese ,atterns can be inter,reted as trut$< and are aut$oriDed as aest$etic and et$ica* criteria E"ents t$at *ea"e be$ind ,ercei"ab*e ,$0sica* or "irtua* re-ains can be traced bac? t$roug$ data /ar?s are no *onger considered data once t$e *in? between t$e -ar? and obser"ation is bro?en J20W /ec$anica* co-,uting de"ices are c*assified according to t$e -eans b0 w$ic$ t$e0 re,resent data >n ana*og co-,uter re,resents a datu- as a "o*tage< distance< ,osition< or ot$er ,$0sica* @uantit0 > digita* co-,uter re,resents a datu- as a se@uence of s0-bo*s drawn fro- a fi1ed a*,$abet #$e -ost co--on digita* co-,uters use a binar0 a*,$abet< t$at is< an a*,$abet of two c$aracters< t0,ica**0 denoted H0H and H1H /ore fa-i*iar re,resentations< suc$ as nu-bers or *etters< are t$en constructed fro- t$e binar0 a*,$abet So-e s,ecia* for-s of data are distinguis$ed > co-,uter ,rogra- is a co**ection of data< w$ic$ can be inter,reted as instructions /ost co-,uter *anguages -a?e a distinction between ,rogra-s and t$e ot$er data on w$ic$ ,rogra-s o,erate< but in so-e *anguages< notab*0 .is, and si-i*ar *anguages< ,rogra-s are essentia**0 indistinguis$ab*e fro- ot$er data !t is a*so usefu* to distinguis$ -etadata< t$at is< a descri,tion of ot$er data > si-i*ar 0et ear*ier ter- for -etadata is Hanci**ar0 data H #$e ,rotot0,ica* e1a-,*e of -etadata is t$e *ibrar0 cata*og< w$ic$ is a descri,tion of t$e contents of boo?s !nfor-ation Information< in its -ost restricted tec$nica* sense< is a se@uence of s0-bo*s t$at can be inter,reted as a -essage !nfor-ation can be recorded as signs< or trans-itted as signa*s !nfor-ation is an0 ?ind of e"ent t$at affects t$e state of a d0na-ic s0ste- Conce,tua**0< infor-ation is t$e -essage (utterance or e1,ression) being con"e0ed #$e -eaning of t$is conce,t "aries in different conte1ts J1W /oreo"er< t$e conce,t of infor-ation is c*ose*0 re*ated to notions of constraint< co--unication< contro*< data< for-< instruction< ?now*edge< -eaning< understanding< -enta* sti-u*i< ,attern< ,erce,tion< re,resentation< and entro,0 Etymology See a*so: ;istor0 of t$e word and conce,t Hinfor-ationH - 1&2 -

Object-Oriented Software Engineering (CS350) #$e Eng*is$ word was a,,arent*0 deri"ed fro- t$e .atin ste- (information#) of t$e no-inati"e (informatio): t$is noun is in its turn deri"ed fro- t$e "erb Hinfor-areH (to infor-) in t$e sense of Hto gi"e for- to t$e -indH< Hto disci,*ineH< HinstructH< Hteac$H: H/en so wise s$ou*d go and infor- t$eir ?ings H (1330) *nform itse*f co-es ("ia Arenc$ informer) fro- t$e .atin "erb informare< to gi"e for-< to for- an idea of Aurt$er-ore< .atin itse*f a*read0 contained t$e word informatio -eaning conce,t or idea< but t$e e1tent to w$ic$ t$is -a0 $a"e inf*uenced t$e de"e*o,-ent of t$e word information in Eng*is$ is not c*ear #$e ancient 7ree? word for form was jklmn (mor!heG cf -or,$) and a*so opqkr (eidos) H?ind< idea< s$a,e< setH< t$e *atter word was fa-ous*0 used in a tec$nica* ,$i*oso,$ica* sense b0 %*ato (and *ater >ristot*e) to denote t$e idea* identit0 or essence of so-et$ing (see #$eor0 of Aor-s) HEidosH can a*so be associated wit$ t$oug$t< ,ro,osition or e"en conce,t #nformation theory approach Aro- t$e stance of infor-ation t$eor0< information is ta?en as a se@uence of s0-bo*s fro- an a*,$abet< sa0 an in,ut a*,$abet s< and an out,ut a*,$abet t !nfor-ation ,rocessing consists of an in,ut-out,ut function t$at -a,s an0 in,ut se@uence fro- s into an out,ut se@uence fro- t #$e -a,,ing -a0 be ,robabi*istic or deter-inate !t -a0 $a"e -e-or0 or be -e-or0*ess J2W %s sensory input Often infor-ation is "iewed as a t0,e of in,ut to an organis- or s0ste- !n,uts are of two ?inds So-e in,uts are i-,ortant to t$e function of t$e organis- (for e1a-,*e< food) or s0ste- (energ0) b0 t$e-se*"es !n $is boo? Sensory Ecology0 8usenber0 ca**ed t$ese causa* in,uts Ot$er in,uts (infor-ation) are i-,ortant on*0 because t$e0 are associated wit$ causa* in,uts and can be used to ,redict t$e occurrence of a causa* in,ut at a *ater ti-e (and ,er$a,s anot$er ,*ace) So-e infor-ation is i-,ortant because of association wit$ ot$er infor-ation but e"entua**0 t$ere -ust be a connection to a causa* in,ut !n ,ractice< infor-ation is usua**0 carried b0 wea? sti-u*i t$at -ust be detected b0 s,ecia*iDed sensor0 s0ste-s and a-,*ified b0 energ0 in,uts before t$e0 can be functiona* to t$e organis- or s0ste- Aor e1a-,*e< *ig$t is often a causa* in,ut to ,*ants but ,ro"ides infor-ation to ani-a*s #$e co*ored *ig$t ref*ected fro- a f*ower is too wea? to do -uc$ ,$otos0nt$etic wor? but t$e "isua* s0ste- of t$e bee detects it and t$e bee4s ner"ous s0ste- uses t$e infor-ation to guide t$e bee to t$e f*ower< w$ere t$e bee often finds nectar or ,o**en< w$ic$ are causa* in,uts< ser"ing a nutritiona* function %s representation and comple$ity

- 1&) -

Course Notes: #$e cogniti"e scientist and a,,*ied -at$e-atician 5ona*do :igo argues t$at infor-ation is a re*ati"e conce,t t$at in"o*"es at *east two re*ated entities in order to -a?e @uantitati"e sense #$ese are: an0 di-ensiona**0 defined categor0 of objects S< and an0 of its subsets 5 5< in essence< is a re,resentation of S< or< in ot$er words< carries or con"e0s re,resentationa* (and $ence< conce,tua*) infor-ation about S :igo t$en defines t$e a-ount of infor-ation t$at 5 con"e0s about S as t$e rate of c$ange in t$e co-,*e1it0 of S w$ene"er t$e objects in 5 are re-o"ed fro- S =nder H:igo infor-ationH< ,attern< in"ariance< co-,*e1it0< re,resentation< and infor-ationXfi"e funda-enta* constructs of uni"ersa* scienceXare unified under a no"e* -at$e-atica* fra-ewor? J3W >-ong ot$er t$ings< t$e fra-ewor? ai-s to o"erco-e t$e *i-itations of S$annon-3ea"er infor-ation w$en atte-,ting to c$aracteriDe and -easure subjecti"e infor-ation %s an influence which leads to a transformation !nfor-ation is an0 t0,e of ,attern t$at inf*uences t$e for-ation or transfor-ation of ot$er ,atterns !n t$is sense< t$ere is no need for a conscious -ind to ,ercei"e< -uc$ *ess a,,reciate< t$e ,attern Consider< for e1a-,*e< 8N> #$e se@uence of nuc*eotides is a ,attern t$at inf*uences t$e for-ation and de"e*o,-ent of an organis- wit$out an0 need for a conscious -ind S0ste-s t$eor0 at ti-es see-s to refer to infor-ation in t$is sense< assu-ing infor-ation does not necessari*0 in"o*"e an0 conscious -ind< and ,atterns circu*ating (due to feedbac?) in t$e s0ste- can be ca**ed infor-ation !n ot$er words< it can be said t$at infor-ation in t$is sense is so-et$ing ,otentia**0 ,ercei"ed as re,resentation< t$oug$ not created or ,resented for t$at ,ur,ose Aor e1a-,*e< 7regor0 +ateson defines Hinfor-ationH as a Hdifference t$at -a?es a differenceH !f< $owe"er< t$e ,re-ise of Hinf*uenceH i-,*ies t$at infor-ation $as been ,ercei"ed b0 a conscious -ind and a*so inter,reted b0 it< t$e s,ecific conte1t associated wit$ t$is inter,retation -a0 cause t$e transfor-ation of t$e infor-ation into ?now*edge Co-,*e1 definitions of bot$ Hinfor-ationH and H?now*edgeH -a?e suc$ se-antic and *ogica* ana*0sis difficu*t< but t$e condition of Htransfor-ationH is an i-,ortant ,oint in t$e stud0 of infor-ation as it re*ates to ?now*edge< es,ecia**0 in t$e business disci,*ine of ?now*edge -anage-ent !n t$is ,ractice< too*s and ,rocesses are used to assist a ?now*edge wor?er in ,erfor-ing researc$ and -a?ing decisions< inc*uding ste,s suc$ as: re"iewing infor-ation in order to effecti"e*0 deri"e "a*ue and -eaning referencing -etadata if an0 is a"ai*ab*e estab*is$ing a re*e"ant conte1t< often se*ecting fro- -an0 ,ossib*e conte1ts deri"ing new ?now*edge fro- t$e infor-ation -a?ing decisions or reco--endations fro- t$e resu*ting ?now*edge

Stewart (2001) argues t$at t$e transfor-ation of infor-ation into ?now*edge is a critica* one< *0ing at t$e core of "a*ue creation and co-,etiti"e ad"antage for t$e -odern enter,rise #$e 8anis$ 8ictionar0 of !nfor-ation #er-sJ'W argues t$at infor-ation on*0 ,ro"ides an answer to a ,osed @uestion 3$et$er t$e answer ,ro"ides ?now*edge de,ends on t$e infor-ed ,erson So a genera*iDed definition of t$e conce,t s$ou*d be: H!nfor-ationH [ >n answer to a s,ecific @uestionH 3$en /ars$a** /c.u$an s,ea?s of -edia and t$eir effects on $u-an cu*tures< $e refers to t$e structure of artifacts t$at in turn s$a,e our be$a"iors and -indsets >*so< ,$ero-ones are often said to be Hinfor-ationH in t$is sense - 1&& -

Object-Oriented Software Engineering (CS350) %s a property in physics !nfor-ation $as a we**-defined -eaning in ,$0sics !n 2003 I 8 +e?enstein c*ai-ed t$at a growing trend in ,$0sics was to define t$e ,$0sica* wor*d as being -ade of infor-ation itse*f (and t$us infor-ation is defined in t$is wa0) (see 8igita* ,$0sics) E1a-,*es of t$is inc*ude t$e ,$eno-enon of @uantu- entang*e-ent w$ere ,artic*es can interact wit$out reference to t$eir se,aration or t$e s,eed of *ig$t !nfor-ation itse*f cannot tra"e* faster t$an *ig$t e"en if t$e infor-ation is trans-itted indirect*0 #$is cou*d *ead to t$e fact t$at a** atte-,ts at ,$0sica**0 obser"ing a ,artic*e wit$ an Hentang*edH re*ations$i, to anot$er are s*owed down< e"en t$oug$ t$e ,artic*es are not connected in an0 ot$er wa0 ot$er t$an b0 t$e infor-ation t$e0 carr0 >not$er *in? is de-onstrated b0 t$e /a1we**4s de-on t$oug$t e1,eri-ent !n t$is e1,eri-ent< a direct re*ations$i, between infor-ation and anot$er ,$0sica* ,ro,ert0< entro,0< is de-onstrated > conse@uence is t$at it is i-,ossib*e to destro0 infor-ation wit$out increasing t$e entro,0 of a s0ste-G in ,ractica* ter-s t$is often -eans generating $eat >not$er< -ore ,$i*oso,$ica* outco-e is t$at infor-ation cou*d be t$oug$t of as interc$angeab*e wit$ energ0 #$us< in t$e stud0 of *ogic gates< t$e t$eoretica* *ower bound of t$er-a* energ0 re*eased b0 an N, gate is $ig$er t$an for t$e N@T gate (because infor-ation is destro0ed in an N, gate and si-,*0 con"erted in a N@T gate) %$0sica* infor-ation is of ,articu*ar i-,ortance in t$e t$eor0 of @uantu- co-,uters "echnologically mediated information !t is esti-ated t$at t$e wor*d4s tec$no*ogica* ca,acit0 to store infor-ation grew fro- 2 ( (o,ti-a**0 co-,ressed) e1ab0tes in 1&)(< w$ic$ is t$e infor-ationa* e@ui"a*ent to *ess t$an one 230-/+ C85O/ ,er ,erson in 1&)( (53& /+ ,er ,erson)< to 2&5 (o,ti-a**0 co-,ressed) e1ab0tes in 2002 J5W #$is is t$e infor-ationa* e@ui"a*ent of a*-ost (1 C8-5O/ ,er ,erson in 2002 J(W #$e wor*dOs co-bined tec$no*ogica* ca,acit0 to recei"e infor-ation t$roug$ one-wa0 broadcast networ?s was t$e infor-ationa* e@ui"a*ent of 12' news,a,ers ,er ,erson ,er da0 in 2002 J5W #$e wor*d4s co-bined effecti"e ca,acit0 to e1c$ange infor-ation t$roug$ two-wa0 te*eco--unication networ?s was t$e infor-ationa* e@ui"a*ent of ( news,a,ers ,er ,erson ,er da0 in 2002 J(W %s records 5ecords are a s,ecia*iDed for- of infor-ation Essentia**0< records are infor-ation ,roduced conscious*0 or as b0-,roducts of business acti"ities or transactions and retained because of t$eir "a*ue %ri-ari*0 t$eir "a*ue is as e"idence of t$e acti"ities of t$e organiDation but t$e0 -a0 a*so be retained for t$eir infor-ationa* "a*ue Sound records -anage-ent ensures t$at t$e integrit0 of records is ,reser"ed for as *ong as t$e0 are re@uired #$e internationa* standard on records -anage-ent< !SO 15')&< defines records as Hinfor-ation created< recei"ed< and -aintained as e"idence and infor-ation b0 an organiDation or ,erson< in ,ursuance of *ega* ob*igations or in t$e transaction of businessH #$e !nternationa* Co--ittee on >rc$i"es (!C>) Co--ittee on e*ectronic records defined a record as< Ha s,ecific ,iece of recorded infor-ation generated< co**ected or recei"ed in t$e initiation< conduct or co-,*etion of an acti"it0 and t$at co-,rises sufficient content< conte1t and structure to ,ro"ide ,roof or e"idence of t$at acti"it0H

- 200 -

Course Notes: 5ecords -a0 be -aintained to retain cor,orate -e-or0 of t$e organiDation or to -eet *ega*< fisca* or accountabi*it0 re@uire-ents i-,osed on t$e organiDation 3i**is (2005) e1,ressed t$e "iew t$at sound -anage-ent of business records and infor-ation de*i"ered H si1 ?e0 re@uire-ents for good cor,orate go"ernance trans,arenc0G accountabi*it0G due ,rocessG co-,*ianceG -eeting statutor0 and co--on *aw re@uire-entsG and securit0 of ,ersona* and cor,orate infor-ation H #nformation and semiotics +e0non-8a"iesJ2WJ)W e1,*ains t$e -u*ti-faceted conce,t of infor-ation in ter-s of signs and signa*sign s0ste-s Signs t$e-se*"es can be considered in ter-s of four inter-de,endent *e"e*s< *a0ers or branc$es of se-iotics: ,rag-atics< se-antics< s0nta1< and e-,irics #$ese four *a0ers ser"e to connect t$e socia* wor*d on t$e one $and wit$ t$e ,$0sica* or tec$nica* wor*d on t$e ot$er %rag-atics is concerned wit$ t$e ,ur,ose of co--unication %rag-atics *in?s t$e issue of signs wit$ t$e conte1t wit$in w$ic$ signs are used #$e focus of ,rag-atics is on t$e intentions of *i"ing agents under*0ing co--unicati"e be$a"iour !n ot$er words< ,rag-atics *in? *anguage to action Se-antics is concerned wit$ t$e -eaning of a -essage con"e0ed in a co--unicati"e act Se-antics considers t$e content of co--unication Se-antics is t$e stud0 of t$e -eaning of signs - t$e association between signs and be$a"iour Se-antics can be considered as t$e stud0 of t$e *in? between s0-bo*s and t$eir referents or conce,tsG ,articu*ar*0 t$e wa0 in w$ic$ signs re*ate to $u-an be$a"iour S0nta1 is concerned wit$ t$e for-a*is- used to re,resent a -essage S0nta1 as an area studies t$e forof co--unication in ter-s of t$e *ogic and gra--ar of sign s0ste-s S0nta1 is de"oted to t$e stud0 of t$e for- rat$er t$an t$e content of signs and sign-s0ste-s E-,irics is t$e stud0 of t$e signa*s used to carr0 a -essageG t$e ,$0sica* c$aracteristics of t$e -ediuof co--unication E-,irics is de"oted to t$e stud0 of co--unication c$anne*s and t$eir c$aracteristics< e g < sound< *ig$t< e*ectronic trans-ission etc Nie*sen (200)) discusses t$e re*ations$i, between se-iotics and infor-ation in re*ation to dictionaries #$e conce,t of *e1icogra,$ic infor-ation costs is introduced and refers to t$e efforts users of dictionaries need to -a?e in order to< first< find t$e data soug$t and< second*0< understand t$e data so t$at t$e0 can generate infor-ation Co--unication nor-a**0 e1ists wit$in t$e conte1t of so-e socia* situation #$e socia* situation sets t$e conte1t for t$e intentions con"e0ed (,rag-atics) and t$e for- in w$ic$ co--unication ta?es ,*ace !n a co--unicati"e situation intentions are e1,ressed t$roug$ -essages w$ic$ co-,rise co**ections of inter-re*ated signs ta?en fro- a *anguage w$ic$ is -utua**0 understood b0 t$e agents in"o*"ed in t$e co--unication /utua* understanding i-,*ies t$at agents in"o*"ed understand t$e c$osen *anguage in ter-s of its agreed s0nta1 (s0ntactics) and se-antics #$e sender codes t$e -essage in t$e *anguage and sends t$e -essage as signa*s a*ong so-e co--unication c$anne* (e-,irics) #$e c$osen co--unication c$anne* wi** $a"e in$erent ,ro,erties w$ic$ deter-ine outco-es suc$ as t$e s,eed wit$ w$ic$ co--unication can ta?e ,*ace and o"er w$at distance

- 201 -

Object-Oriented Software Engineering (CS350)

12!Software testing
&oft%are testing is an in"estigation conducted to ,ro"ide sta?e$o*ders wit$ infor-ation about t$e @ua*it0 of t$e ,roduct or ser"ice under test J1W Software testing can a*so ,ro"ide an objecti"e< inde,endent "iew of t$e software to a**ow t$e business to a,,reciate and understand t$e ris?s of software i-,*e-entation #est tec$ni@ues inc*ude< but are not *i-ited to< t$e ,rocess of e1ecuting a ,rogra- or a,,*ication wit$ t$e intent of finding software bugs (errors or ot$er defects) Software testing can be stated as t$e ,rocess of "a*idating and "erif0ing t$at a software ,rogra-Fa,,*icationF,roduct: 1 2 3 ' -eets t$e re@uire-ents t$at guided its design and de"e*o,-entG wor?s as e1,ectedG can be i-,*e-ented wit$ t$e sa-e c$aracteristics satisfies t$e needs of sta?e$o*ders

Software testing< de,ending on t$e testing -et$od e-,*o0ed< can be i-,*e-ented at an0 ti-e in t$e de"e*o,-ent ,rocess #raditiona**0 -ost of t$e test effort occurs after t$e re@uire-ents $a"e been defined and t$e coding ,rocess $as been co-,*eted< but in t$e >gi*e a,,roac$es -ost of t$e test effort is on-going >s suc$< t$e -et$odo*og0 of t$e test is go"erned b0 t$e c$osen software de"e*o,-ent -et$odo*og0 8ifferent software de"e*o,-ent -ode*s wi** focus t$e test effort at different ,oints in t$e de"e*o,-ent ,rocess Newer de"e*o,-ent -ode*s< suc$ as >gi*e< often e-,*o0 test-dri"en de"e*o,-ent and ,*ace an increased ,ortion of t$e testing in t$e $ands of t$e de"e*o,er< before it reac$es a for-a* tea- of testers !n a -ore traditiona* -ode*< -ost of t$e test e1ecution occurs after t$e re@uire-ents $a"e been defined and t$e coding ,rocess $as been co-,*eted

Overview
#esting can ne"er co-,*ete*0 identif0 a** t$e defects wit$in software J2W !nstead< it furnis$es a criticism or com!arison t$at co-,ares t$e state and be$a"ior of t$e ,roduct against orac*esX,rinci,*es or -ec$anis-s b0 w$ic$ so-eone -ig$t recogniDe a ,rob*e- #$ese orac*es -a0 inc*ude (but are not *i-ited to) s,ecifications< contracts<J3W co-,arab*e ,roducts< ,ast "ersions of t$e sa-e ,roduct< inferences about intended or e1,ected ,ur,ose< user or custo-er e1,ectations< re*e"ant standards< a,,*icab*e *aws< or ot$er criteria > ,ri-ar0 ,ur,ose of testing is to detect software fai*ures so t$at defects -a0 be disco"ered and corrected #esting cannot estab*is$ t$at a ,roduct functions ,ro,er*0 under a** conditions but can on*0 estab*is$ t$at it does not function ,ro,er*0 under s,ecific conditions J'W #$e sco,e of software testing often inc*udes e1a-ination of code as we** as e1ecution of t$at code in "arious en"iron-ents and conditions as we** as e1a-ining t$e as,ects of code: does it do w$at it is su,,osed to do and do w$at it needs to do !n t$e current cu*ture of software de"e*o,-ent< a testing organiDation -a0 be se,arate fro- t$e de"e*o,-ent tea- #$ere are "arious ro*es for testing tea- -e-bers !nfor-ation deri"ed fro- software testing -a0 be used to correct t$e ,rocess b0 w$ic$ software is de"e*o,ed J5W

- 202 -

Course Notes: E"er0 software ,roduct $as a target audience Aor e1a-,*e< t$e audience for "ideo ga-e software is co-,*ete*0 different fro- ban?ing software #$erefore< w$en an organiDation de"e*o,s or ot$erwise in"ests in a software ,roduct< it can assess w$et$er t$e software ,roduct wi** be acce,tab*e to its end users< its target audience< its ,urc$asers< and ot$er sta?e$o*ders &oft%are testing is t$e ,rocess of atte-,ting to -a?e t$is assess-ent

6efects and failures


Not a** software defects are caused b0 coding errors One co--on source of e1,ensi"e defects is caused b0 re@uire-ent ga,s< e g < unrecogniDed re@uire-ents< t$at resu*t in errors of o-ission b0 t$e ,rogra- designer J(W > co--on source of re@uire-ents ga,s is non-functiona* re@uire-ents suc$ as testabi*it0< sca*abi*it0< -aintainabi*it0< usabi*it0< ,erfor-ance< and securit0 Software fau*ts occur t$roug$ t$e fo**owing ,rocesses > ,rogra--er -a?es an error (-ista?e)< w$ic$ resu*ts in a defect (fau*t< bug) in t$e software source code !f t$is defect is e1ecuted< in certain situations t$e s0ste- wi** ,roduce wrong resu*ts< causing a fai*ure J2W Not a** defects wi** necessari*0 resu*t in fai*ures Aor e1a-,*e< defects in dead code wi** ne"er resu*t in fai*ures > defect can turn into a fai*ure w$en t$e en"iron-ent is c$anged E1a-,*es of t$ese c$anges in en"iron-ent inc*ude t$e software being run on a new co-,uter $ardware ,*atfor-< a*terations in source data or interacting wit$ different software J2W > sing*e defect -a0 resu*t in a wide range of fai*ure s0-,to-s

#nput combinations and preconditions


> "er0 funda-enta* ,rob*e- wit$ software testing is t$at testing under all co-binations of in,uts and ,reconditions (initia* state) is not feasib*e< e"en wit$ a si-,*e ,roduct J'WJ)W #$is -eans t$at t$e nu-ber of defects in a software ,roduct can be "er0 *arge and defects t$at occur infre@uent*0 are difficu*t to find in testing /ore significant*0< non-functiona* di-ensions of @ua*it0 ($ow it is su,,osed to be "ersus w$at it is su,,osed to do)Xusabi*it0< sca*abi*it0< ,erfor-ance< co-,atibi*it0< re*iabi*it0X can be $ig$*0 subjecti"eG so-et$ing t$at constitutes sufficient "a*ue to one ,erson -a0 be into*erab*e to anot$er Software de"e*o,ers can4t test e"er0t$ing< but t$e0 can use co-binatoria* test design to identif0 t$e -ini-u- nu-ber of tests needed to get t$e co"erage t$e0 want Co-binatoria* test design enab*es users to get greater test co"erage wit$ fewer tests 3$et$er t$e0 are *oo?ing for s,eed or test de,t$< t$e0 can use co-binatoria* test design -et$ods to bui*d structured "ariation into t$eir test cases J&W

Economics
> stud0 conducted b0 N!S# in 2002 re,orts t$at software bugs cost t$e = S econo-0 ]5& 5 bi**ion annua**0 /ore t$an a t$ird of t$is cost cou*d be a"oided if better software testing was ,erfor-ed J10W !t is co--on*0 be*ie"ed t$at t$e ear*ier a defect is found t$e c$ea,er it is to fi1 it #$e fo**owing tab*e s$ows t$e cost of fi1ing t$e defect de,ending on t$e stage it was found J11W Aor e1a-,*e< if a ,rob*ein t$e re@uire-ents is found on*0 ,ost-re*ease< t$en it wou*d cost 10C100 ti-es -ore to fi1 t$an if it $ad a*read0 been found b0 t$e re@uire-ents re"iew 3it$ t$e ad"ent of -odern continuous de,*o0-ent ,ractices and c*oud-based ser"ices< t$e cost of re-de,*o0-ent and -aintenance -a0 *essen o"er ti-e - 203 -

Object-Oriented Software Engineering (CS350) @ime detected !ost to fix a defect @ime introduced Re#uirements $rchitecture !onstruction Re#uirements $rchitecture !onstruction 1u 3u 1u 5C10u 10u 1u &ystem test 10u 15u 10u ost(release 10C100u 25C100u 10C25u

+oles
Software testing can be done b0 software testers =nti* t$e 1&)0s t$e ter- Hsoftware testerH was used genera**0< but *ater it was a*so seen as a se,arate ,rofession 5egarding t$e ,eriods and t$e different goa*s in software testing<J12W different ro*es $a"e been estab*is$ed: manager< test lead< test designer< tester< automation develo!er< and test administrator

History
#$e se,aration of debugging fro- testing was initia**0 introduced b0 7*enford I /0ers in 1&2& J13W >*t$oug$ $is attention was on brea?age testing (Ha successfu* test is one t$at finds a bugHJ13WJ1'W) it i**ustrated t$e desire of t$e software engineering co--unit0 to se,arate funda-enta* de"e*o,-ent acti"ities< suc$ as debugging< fro- t$at of "erification 8a"e 7e*,erin and 3i**ia- C ;etDe* c*assified in 1&)) t$e ,$ases and goa*s in software testing in t$e fo**owing stages:J15W =nti* 1&5( - 8ebugging orientedJ1(W 1&52C1&2) - 8e-onstration orientedJ12W 1&2&C1&)2 - 8estruction orientedJ1)W 1&)3C1&)2 - E"a*uation orientedJ1&W 1&))C2000 - %re"ention orientedJ20W

"esting methods
Static #s! d/na,ic testing
#$ere are -an0 a,,roac$es to software testing 5e"iews< wa*?t$roug$s< or ins,ections are considered as static testing< w$ereas actua**0 e1ecuting ,rogra--ed code wit$ a gi"en set of test cases is referred to as d0na-ic testing Static testing can be (and unfortunate*0 in ,ractice often is) o-itted 80na-ic testing ta?es ,*ace w$en t$e ,rogra- itse*f is used for t$e first ti-e (w$ic$ is genera**0 considered t$e beginning of t$e testing stage) 80na-ic testing -a0 begin before t$e ,rogra- is 100N co-,*ete in order to test ,articu*ar sections of code (-odu*es or discrete functions) #0,ica* tec$ni@ues for t$is are eit$er using stubsFdri"ers or e1ecution fro- a debugger en"iron-ent Aor e1a-,*e< s,reads$eet ,rogra-s are< b0 t$eir "er0 nature< tested to a *arge e1tent interacti"e*0 (Hon t$e f*0H)< wit$ resu*ts dis,*a0ed i--ediate*0 after eac$ ca*cu*ation or te1t -ani,u*ation

- 20' -

Course Notes:

$e bo0 a++roac$
Software testing -et$ods are traditiona**0 di"ided into w$ite- and b*ac?-bo1 testing #$ese two a,,roac$es are used to describe t$e ,oint of "iew t$at a test engineer ta?es w$en designing test cases .hite-&o$ testing /ain artic*e: 3$ite-bo1 testing Chite(box testing (a*so ?nown as clear box testing< glass box testing< transparent box testing< and structural testing) tests interna* structures or wor?ings of a ,rogra-< as o,,osed to t$e functiona*it0 e1,osed to t$e end-user !n w$ite-bo1 testing an interna* ,ers,ecti"e of t$e s0ste-< as we** as ,rogra--ing s?i**s< are used to design test cases #$e tester c$ooses in,uts to e1ercise ,at$s t$roug$ t$e code and deter-ine t$e a,,ro,riate out,uts #$is is ana*ogous to testing nodes in a circuit< e g incircuit testing (!C#) 3$i*e w$ite-bo1 testing can be a,,*ied at t$e unit< integration and s0ste- *e"e*s of t$e soft%are testing ,rocess< it is usua**0 done at t$e unit *e"e* !t can test ,at$s wit$in a unit< ,at$s between units during integration< and between subs0ste-s during a s0ste-C*e"e* test #$oug$ t$is -et$od of test design can unco"er -an0 errors or ,rob*e-s< it -ig$t not detect uni-,*e-ented ,arts of t$e s,ecification or -issing re@uire-ents #ec$ni@ues used in w$ite-bo1 testing inc*ude: >%! testing (a,,*ication ,rogra--ing interface) - testing of t$e a,,*ication using ,ub*ic and ,ri"ate >%!s Code co"erage - creating tests to satisf0 so-e criteria of code co"erage (e g < t$e test designer can create tests to cause a** state-ents in t$e ,rogra- to be e1ecuted at *east once) Aau*t injection -et$ods - intentiona**0 introducing fau*ts to gauge t$e efficac0 of testing strategies /utation testing -et$ods Static testing -et$ods Code co"erage too*s can e"a*uate t$e co-,*eteness of a test suite t$at was created wit$ an0 -et$od< inc*uding b*ac?-bo1 testing #$is a**ows t$e software tea- to e1a-ine ,arts of a s0ste- t$at are rare*0 tested and ensures t$at t$e -ost i-,ortant function ,oints $a"e been tested J21W Code co"erage as a software -etric can be re,orted as a ,ercentage for: )unction coverage< w$ic$ re,orts on functions e1ecuted Statement coverage< w$ic$ re,orts on t$e nu-ber of *ines e1ecuted to co-,*ete t$e test 100N state-ent co"erage ensures t$at a** code ,at$s< or branc$es (in ter-s of contro* f*ow) are e1ecuted at *east once #$is is $e*,fu* in ensuring correct functiona*it0< but not sufficient since t$e sa-e code -a0 ,rocess different in,uts correct*0 or incorrect*0

- 205 -

Object-Oriented Software Engineering (CS350) &lac/-bo$ testing Blac*(box testing treats t$e software as a Hb*ac? bo1H< e1a-ining functiona*it0 wit$out an0 ?now*edge of interna* i-,*e-entation #$e tester is on*0 aware of w$at t$e software is su,,osed to do< not $ow it does it J22W +*ac?-bo1 testing -et$ods inc*ude: e@ui"a*ence ,artitioning< boundar0 "a*ue ana*0sis< a**,airs testing< state transition tab*es< decision tab*e testing< fuDD testing< -ode*-based testing< use case testing< e1,*orator0 testing and s,ecification-based testing &pecification(based testing ai-s to test t$e functiona*it0 of software according to t$e a,,*icab*e re@uire-ents J23W #$is *e"e* of testing usua**0 re@uires t$oroug$ test cases to be ,ro"ided to t$e tester< w$o t$en can si-,*0 "erif0 t$at for a gi"en in,ut< t$e out,ut "a*ue (or be$a"ior)< eit$er HisH or His notH t$e sa-e as t$e e1,ected "a*ue s,ecified in t$e test case #est cases are bui*t around s,ecifications and re@uire-ents< i e < w$at t$e a,,*ication is su,,osed to do !t uses e1terna* descri,tions of t$e software< inc*uding s,ecifications< re@uire-ents< and designs to deri"e test cases #$ese tests can be functiona* or non-functiona*< t$oug$ usua**0 functiona* S,ecification-based testing -a0 be necessar0 to assure correct functiona*it0< but it is insufficient to guard against co-,*e1 or $ig$-ris? situations J2'W One ad"antage of t$e b*ac? bo1 tec$ni@ue is t$at no ,rogra--ing ?now*edge is re@uired 3$ate"er biases t$e ,rogra--ers -a0 $a"e $ad< t$e tester *i?e*0 $as a different set and -a0 e-,$asiDe different areas of functiona*it0 On t$e ot$er $and< b*ac?-bo1 testing $as been said to be H*i?e a wa*? in a dar? *ab0rint$ wit$out a f*as$*ig$t HJ25W +ecause t$e0 do not e1a-ine t$e source code< t$ere are situations w$en a tester writes -an0 test cases to c$ec? so-et$ing t$at cou*d $a"e been tested b0 on*0 one test case< or *ea"es so-e ,arts of t$e ,rogra- untested #$is -et$od of test can be a,,*ied to a** *e"e*s of software testing: unit< integration< s0ste- and acce,tance !t t0,ica**0 co-,rises -ost if not a** testing at $ig$er *e"e*s< but can a*so do-inate unit testing as we** 4rey-bo$ testing >rey(box testing (>-erican s,e**ing: gray(box testing) in"o*"es $a"ing ?now*edge of interna* data structures and a*gorit$-s for ,ur,oses of designing tests< w$i*e e1ecuting t$ose tests at t$e user< or b*ac?-bo1 *e"e* #$e tester is not re@uired to $a"e fu** access to t$e software4s source code J2(WJnot in citation givenW /ani,u*ating in,ut data and for-atting out,ut do not @ua*if0 as gre0-bo1< because t$e in,ut and out,ut are c*ear*0 outside of t$e Hb*ac? bo1H t$at we are ca**ing t$e s0ste- under test #$is distinction is ,articu*ar*0 i-,ortant w$en conducting integration testing between two -odu*es of code written b0 two different de"e*o,ers< w$ere on*0 t$e interfaces are e1,osed for test ;owe"er< -odif0ing a data re,ositor0 does @ua*if0 as gre0-bo1< as t$e user wou*d not nor-a**0 be ab*e to c$ange t$e data outside of t$e s0ste- under test 7re0-bo1 testing -a0 a*so inc*ude re"erse engineering to deter-ine< for instance< boundar0 "a*ues or error -essages +0 ?nowing t$e under*0ing conce,ts of $ow t$e software wor?s< t$e tester -a?es better-infor-ed testing c$oices w$i*e testing t$e software fro- outside #0,ica**0< a gre0-bo1 tester wi** be ,er-itted to set u, $is testing en"iron-entG for instance< seeding a databaseG and t$e tester can obser"e t$e state of t$e ,roduct being tested after ,erfor-ing certain actions Aor instance< in testing a database ,roduct - 20( -

Course Notes: $eFs$e -a0 fire an SE. @uer0 on t$e database and t$en obser"e t$e database< to ensure t$at t$e e1,ected c$anges $a"e been ref*ected 7re0-bo1 testing i-,*e-ents inte**igent test scenarios< based on *i-ited infor-ation #$is wi** ,articu*ar*0 a,,*0 to data t0,e $and*ing< e1ce,tion $and*ing< and so on J22W

8isual testing
#$e ai- of "isua* testing is to ,ro"ide de"e*o,ers wit$ t$e abi*it0 to e1a-ine w$at was $a,,ening at t$e ,oint of software fai*ure b0 ,resenting t$e data in suc$ a wa0 t$at t$e de"e*o,er can easi*0 vnd t$e infor-ation $e re@uires< and t$e infor-ation is e1,ressed c*ear*0 J2)WJ2&W >t t$e core of "isua* testing is t$e idea t$at s$owing so-eone a ,rob*e- (or a test fai*ure)< rat$er t$an just describing it< great*0 increases c*arit0 and understanding :isua* testing t$erefore re@uires t$e recording of t$e entire test ,rocess C ca,turing e"er0t$ing t$at occurs on t$e test s0ste- in "ideo for-at Out,ut "ideos are su,,*e-ented b0 rea*-ti-e tester in,ut "ia ,icture-in-a-,icture webca- and audio co--entar0 fro- -icro,$ones :isua* testing ,ro"ides a nu-ber of ad"antages #$e @ua*it0 of co--unication is increased dra-atica**0 because testers can s$ow t$e ,rob*e- (and t$e e"ents *eading u, to it) to t$e de"e*o,er as o,,osed to just describing it and t$e need to re,*icate test fai*ures wi** cease to e1ist in -an0 cases #$e de"e*o,er wi** $a"e a** t$e e"idence $e re@uires of a test fai*ure and can instead focus on t$e cause of t$e fau*t and $ow it s$ou*d be fi1ed :isua* testing is ,articu*ar*0 we**-suited for en"iron-ents t$at de,*o0 agi*e -et$ods in t$eir de"e*o,-ent of software< since agi*e -et$ods re@uire greater co--unication between testers and de"e*o,ers and co**aboration wit$in s-a** tea-s >d $oc testing and e1,*orator0 testing are i-,ortant -et$odo*ogies for c$ec?ing software integrit0< because t$e0 re@uire *ess ,re,aration ti-e to i-,*e-ent< w$i*st i-,ortant bugs can be found @uic?*0 !n ad $oc testing< w$ere testing ta?es ,*ace in an i-,ro"ised< i-,ro-,tu wa0< t$e abi*it0 of a test too* to "isua**0 record e"er0t$ing t$at occurs on a s0ste- beco-es "er0 i-,ortant Jclarification neededW :isua* testing is gat$ering recognition in custo-er acce,tance and usabi*it0 testing< because t$e test can be used b0 -an0 indi"idua*s in"o*"ed in t$e de"e*o,-ent ,rocess Aor t$e custo-er< it beco-es eas0 to ,ro"ide detai*ed bug re,orts and feedbac?< and for ,rogra- users< "isua* testing can record user actions on screen< as we** as t$eir "oice and i-age< to ,ro"ide a co-,*ete ,icture at t$e ti-e of software fai*ure for t$e de"e*o,er Aurt$er infor-ation: 7ra,$ica* user interface testing

"esting levels
#ests are fre@uent*0 grou,ed b0 w$ere t$e0 are added in t$e software de"e*o,-ent ,rocess< or b0 t$e *e"e* of s,ecificit0 of t$e test #$e -ain *e"e*s during t$e de"e*o,-ent ,rocess as defined b0 t$e S3E+OS guide are unit-< integration-< and s0ste- testing t$at are distinguis$ed b0 t$e test target wit$out i-,*0ing a s,ecific ,rocess -ode* J30W Ot$er test *e"e*s are c*assified b0 t$e testing objecti"e J30W

- 202 -

Object-Oriented Software Engineering (CS350)

;nit testing
/ain artic*e: =nit testing =nit testing< a*so ?nown as co-,onent testing< refers to tests t$at "erif0 t$e functiona*it0 of a s,ecific section of code< usua**0 at t$e function *e"e* !n an object-oriented en"iron-ent< t$is is usua**0 at t$e c*ass *e"e*< and t$e -ini-a* unit tests inc*ude t$e constructors and destructors J31W #$ese t0,es of tests are usua**0 written b0 de"e*o,ers as t$e0 wor? on code (w$ite-bo1 st0*e)< to ensure t$at t$e s,ecific function is wor?ing as e1,ected One function -ig$t $a"e -u*ti,*e tests< to catc$ corner cases or ot$er branc$es in t$e code =nit testing a*one cannot "erif0 t$e functiona*it0 of a ,iece of software< but rat$er is used to assure t$at t$e bui*ding b*oc?s t$e software uses wor? inde,endent*0 of eac$ ot$er

"ntegration testing
/ain artic*e: !ntegration testing !ntegration testing is an0 t0,e of software testing t$at see?s to "erif0 t$e interfaces between co-,onents against a software design Software co-,onents -a0 be integrated in an iterati"e wa0 or a** toget$er (Hbig bangH) Nor-a**0 t$e for-er is considered a better ,ractice since it a**ows interface issues to be *oca*ised -ore @uic?*0 and fi1ed !ntegration testing wor?s to e1,ose defects in t$e interfaces and interaction between integrated co-,onents (-odu*es) %rogressi"e*0 *arger grou,s of tested software co-,onents corres,onding to e*e-ents of t$e arc$itectura* design are integrated and tested unti* t$e software wor?s as a s0ste- J32W

S/ste, testing
S0ste- testing tests a co-,*ete*0 integrated s0ste- to "erif0 t$at it -eets its re@uire-ents J33W

S/ste, integration testing


S0ste- integration testing "erifies t$at a s0ste- is integrated to an0 e1terna* or t$ird-,art0 s0ste-s defined in t$e s0ste- re@uire-ents

o+-down and botto,-u+


Bottom Up @esting is an a,,roac$ to integrated testing w$ere t$e *owest *e"e* co-,onents are tested first< t$en used to faci*itate t$e testing of $ig$er *e"e* co-,onents #$e ,rocess is re,eated unti* t$e co-,onent at t$e to, of t$e $ierarc$0 is tested >** t$e botto- or *ow-*e"e* -odu*es< ,rocedures or functions are integrated and t$en tested >fter t$e integration testing of *ower *e"e* integrated -odu*es< t$e ne1t *e"e* of -odu*es wi** be for-ed and can be used for integration testing #$is a,,roac$ is $e*,fu* on*0 w$en a** or -ost of t$e -odu*es of t$e sa-e de"e*o,-ent *e"e* are read0 #$is -et$od a*so $e*,s to deter-ine t$e *e"e*s of software de"e*o,ed and -a?es it easier to re,ort testing ,rogress in t$e for- of a ,ercentage

- 20) -

Course Notes: @op Do%n @esting is an a,,roac$ to integrated testing w$ere t$e to, integrated -odu*es are tested and t$e branc$ of t$e -odu*e is tested ste, b0 ste, unti* t$e end of t$e re*ated -odu*e

Ob'ectives of testing
"nstallation testing
>n insta**ation test assures t$at t$e s0ste- is insta**ed correct*0 and wor?ing at actua* custo-er4s $ardware

Co,+atibilit/ testing
> co--on cause of software fai*ure (rea* or ,ercei"ed) is a *ac? of its co-,atibi*it0 wit$ ot$er a,,*ication software< o,erating s0ste-s (or o,erating s0ste- "ersions< o*d or new)< or target en"iron-ents t$at differ great*0 fro- t$e origina* (suc$ as a ter-ina* or 7=! a,,*ication intended to be run on t$e des?to, now being re@uired to beco-e a web a,,*ication< w$ic$ -ust render in a web browser) Aor e1a-,*e< in t$e case of a *ac? of bac?ward co-,atibi*it0< t$is can occur because t$e ,rogra--ers de"e*o, and test software on*0 on t$e *atest "ersion of t$e target en"iron-ent< w$ic$ not a** users -a0 be running #$is resu*ts in t$e unintended conse@uence t$at t$e *atest wor? -a0 not function on ear*ier "ersions of t$e target en"iron-ent< or on o*der $ardware t$at ear*ier "ersions of t$e target en"iron-ent was ca,ab*e of using So-eti-es suc$ issues can be fi1ed b0 ,roacti"e*0 abstracting o,erating s0ste- functiona*it0 into a se,arate ,rogra- -odu*e or *ibrar0

S,o7e and sanit/ testing


Sanit0 testing deter-ines w$et$er it is reasonab*e to ,roceed wit$ furt$er testing S-o?e testing is used to deter-ine w$et$er t$ere are serious ,rob*e-s wit$ a ,iece of software< for e1a-,*e as a bui*d "erification test

3egression testing
5egression testing focuses on finding defects after a -ajor code c$ange $as occurred S,ecifica**0< it see?s to unco"er software regressions< or o*d bugs t$at $a"e co-e bac? Suc$ regressions occur w$ene"er software functiona*it0 t$at was ,re"ious*0 wor?ing correct*0 sto,s wor?ing as intended #0,ica**0< regressions occur as an unintended conse@uence of ,rogra- c$anges< w$en t$e new*0 de"e*o,ed ,art of t$e software co**ides wit$ t$e ,re"ious*0 e1isting code Co--on -et$ods of regression testing inc*ude re-running ,re"ious*0 run tests and c$ec?ing w$et$er ,re"ious*0 fi1ed fau*ts $a"e re-e-erged #$e de,t$ of testing de,ends on t$e ,$ase in t$e re*ease ,rocess and t$e ris? of t$e added features #$e0 can eit$er be co-,*ete< for c$anges added *ate in t$e re*ease or dee-ed to be ris?0< to "er0 s$a**ow< consisting of ,ositi"e tests on eac$ feature< if t$e c$anges are ear*0 in t$e re*ease or dee-ed to be of *ow ris?

- 20& -

Object-Oriented Software Engineering (CS350)

<cce+tance testing
>cce,tance testing can -ean one of two t$ings: 1 > s-o?e test is used as an acce,tance test ,rior to introducing a new bui*d to t$e -ain testing ,rocess< i e before integration or regression 2 >cce,tance testing ,erfor-ed b0 t$e custo-er< often in t$eir *ab en"iron-ent on t$eir own $ardware< is ?nown as user acce,tance testing (=>#) >cce,tance testing -a0 be ,erfor-ed as ,art of t$e $and-off ,rocess between an0 two ,$ases of de"e*o,-ent

<l+$a testing
>*,$a testing is si-u*ated or actua* o,erationa* testing b0 ,otentia* usersFcusto-ers or an inde,endent test tea- at t$e de"e*o,ers4 site >*,$a testing is often e-,*o0ed for off-t$e-s$e*f software as a for- of interna* acce,tance testing< before t$e software goes to beta testing J3'W

*eta testing
+eta testing co-es after a*,$a testing and can be considered a for- of e1terna* user acce,tance testing :ersions of t$e software< ?nown as beta "ersions< are re*eased to a *i-ited audience outside of t$e ,rogra--ing tea- #$e software is re*eased to grou,s of ,eo,*e so t$at furt$er testing can ensure t$e ,roduct $as few fau*ts or bugs So-eti-es< beta "ersions are -ade a"ai*ab*e to t$e o,en ,ub*ic to increase t$e feedbac? fie*d to a -a1i-a* nu-ber of future users

Functional #s non-functional testing


Aunctiona* testing refers to acti"ities t$at "erif0 a s,ecific action or function of t$e code #$ese are usua**0 found in t$e code re@uire-ents docu-entation< a*t$oug$ so-e de"e*o,-ent -et$odo*ogies wor? fro- use cases or user stories Aunctiona* tests tend to answer t$e @uestion of Hcan t$e user do t$isH or Hdoes t$is ,articu*ar feature wor? H Non-functiona* testing refers to as,ects of t$e software t$at -a0 not be re*ated to a s,ecific function or user action< suc$ as sca*abi*it0 or ot$er ,erfor-ance< be$a"ior under certain constraints< or securit0 #esting wi** deter-ine t$e f*a?e ,oint< t$e ,oint at w$ic$ e1tre-es of sca*abi*it0 or ,erfor-ance *eads to unstab*e e1ecution Non-functiona* re@uire-ents tend to be t$ose t$at ref*ect t$e @ua*it0 of t$e ,roduct< ,articu*ar*0 in t$e conte1t of t$e suitabi*it0 ,ers,ecti"e of its users

6estructi#e testing
8estructi"e testing atte-,ts to cause t$e software or a sub-s0ste- to fai* !t "erifies t$at t$e software functions ,ro,er*0 e"en w$en it recei"es in"a*id or une1,ected in,uts< t$ereb0 estab*is$ing t$e robustness of in,ut "a*idation and error--anage-ent routines Software fau*t injection< in t$e for- of fuDDing< is an e1a-,*e of fai*ure testing :arious co--ercia* non-functiona* testing too*s are *in?ed fro- t$e software fau*t injection ,ageG t$ere are a*so nu-erous o,en-source and free software too*s a"ai*ab*e t$at ,erfor- destructi"e testing

- 210 -

Course Notes:

Software +erfor,ance testing


%erfor-ance testing is in genera* e1ecuted to deter-ine $ow a s0ste- or sub-s0ste- ,erfor-s in ter-s of res,onsi"eness and stabi*it0 under a ,articu*ar wor?*oad !t can a*so ser"e to in"estigate< -easure< "a*idate or "erif0 ot$er @ua*it0 attributes of t$e s0ste-< suc$ as sca*abi*it0< re*iabi*it0 and resource usage :oad testing is ,ri-ari*0 concerned wit$ testing t$at t$e s0ste- can continue to o,erate under a s,ecific *oad< w$et$er t$at be *arge @uantities of data or a *arge nu-ber of users #$is is genera**0 referred to as software sca*abi*it0 #$e re*ated *oad testing acti"it0 of w$en ,erfor-ed as a non-functiona* acti"it0 is often referred to as endurance testing >olume testing is a wa0 to test software functions e"en w$en certain co-,onents (for e1a-,*e a fi*e or database) increase radica**0 in siDe Stress testing is a wa0 to test re*iabi*it0 under une1,ected or rare wor?*oads Stability testing (often referred to as *oad or endurance testing) c$ec?s to see if t$e software can continuous*0 function we** in or abo"e an acce,tab*e ,eriod #$ere is *itt*e agree-ent on w$at t$e s,ecific goa*s of ,erfor-ance testing are #$e ter-s *oad testing< ,erfor-ance testing< re*iabi*it0 testing< and "o*u-e testing< are often used interc$angeab*0 Aurt$er infor-ation: Sca*abi*it0 testing

;sabilit/ testing
=sabi*it0 testing is needed to c$ec? if t$e user interface is eas0 to use and understand !t is concerned -ain*0 wit$ t$e use of t$e a,,*ication

<ccessibilit/
>ccessibi*it0 testing -ig$t inc*ude co-,*iance wit$: >-ericans wit$ 8isabi*ities >ct of 1&&0 Section 50) >-end-ent to t$e 5e$abi*itation >ct of 1&23 3eb >ccessibi*it0 !nitiati"e (3>!) of t$e 3or*d 3ide 3eb Consortiu- (33C)

Securit/ testing
Securit0 testing is essentia* for software t$at ,rocesses confidentia* data to ,re"ent s0ste- intrusion b0 $ac?ers

"nternationali=ation and locali=ation


#$e genera* abi*it0 of software to be internationa*iDed and *oca*iDed can be auto-atica**0 tested wit$out actua* trans*ation< b0 using ,seudo*oca*iDation !t wi** "erif0 t$at t$e a,,*ication sti** wor?s< e"en after it $as been trans*ated into a new *anguage or ada,ted for a new cu*ture (suc$ as different currencies or ti-e Dones) J35W >ctua* trans*ation to $u-an *anguages -ust be tested< too %ossib*e *oca*iDation fai*ures inc*ude:

- 211 -

Object-Oriented Software Engineering (CS350) Software is often *oca*iDed b0 trans*ating a *ist of strings out of conte1t< and t$e trans*ator -a0 c$oose t$e wrong trans*ation for an a-biguous source string #ec$nica* ter-ino*og0 -a0 beco-e inconsistent if t$e ,roject is trans*ated b0 se"era* ,eo,*e wit$out ,ro,er coordination or if t$e trans*ator is i-,rudent .itera* word-for-word trans*ations -a0 sound ina,,ro,riate< artificia* or too tec$nica* in t$e target *anguage =ntrans*ated -essages in t$e origina* *anguage -a0 be *eft $ard coded in t$e source code So-e -essages -a0 be created auto-atica**0 at run ti-e and t$e resu*ting string -a0 be ungra--atica*< functiona**0 incorrect< -is*eading or confusing Software -a0 use a ?e0board s$ortcut w$ic$ $as no function on t$e source *anguage4s ?e0board *a0out< but is used for t0,ing c$aracters in t$e *a0out of t$e target *anguage Software -a0 *ac? su,,ort for t$e c$aracter encoding of t$e target *anguage Aonts and font siDes w$ic$ are a,,ro,riate in t$e source *anguage -a0 be ina,,ro,riate in t$e target *anguageG for e1a-,*e< CIS c$aracters -a0 beco-e unreadab*e if t$e font is too s-a** > string in t$e target *anguage -a0 be *onger t$an t$e software can $and*e #$is -a0 -a?e t$e string ,art*0 in"isib*e to t$e user or cause t$e software to cras$ or -a*function Software -a0 *ac? ,ro,er su,,ort for reading or writing bi-directiona* te1t Software -a0 dis,*a0 i-ages wit$ te1t t$at was not *oca*iDed .oca*iDed o,erating s0ste-s -a0 $a"e different*0-na-ed s0ste- configuration fi*es and en"iron-ent "ariab*es and different for-ats for date and currenc0 #o a"oid t$ese and ot$er *oca*iDation ,rob*e-s< a tester w$o ?nows t$e target *anguage -ust run t$e ,rogra- wit$ a** t$e ,ossib*e use cases for trans*ation to see if t$e -essages are readab*e< trans*ated correct*0 in conte1t and do not cause fai*ures

"he testing process


raditional C.." or waterfall de#elo+,ent ,odel
> co--on ,ractice of software testing is t$at testing is ,erfor-ed b0 an inde,endent grou, of testers after t$e functiona*it0 is de"e*o,ed< before it is s$i,,ed to t$e custo-er J3(W #$is ,ractice often resu*ts in t$e testing ,$ase being used as a ,roject buffer to co-,ensate for ,roject de*a0s< t$ereb0 co-,ro-ising t$e ti-e de"oted to testing J32W >not$er ,ractice is to start software testing at t$e sa-e -o-ent t$e ,roject starts and it is a continuous ,rocess unti* t$e ,roject finis$es J3)W Aurt$er infor-ation: Ca,abi*it0 /aturit0 /ode* !ntegration and 3aterfa** -ode*

<gile or E0tre,e de#elo+,ent ,odel


!n contrast< so-e e-erging software disci,*ines suc$ as e1tre-e ,rogra--ing and t$e agi*e software de"e*o,-ent -o"e-ent< ad$ere to a Htest-dri"en software de"e*o,-entH -ode* !n t$is ,rocess< unit tests are written first< b0 t$e software engineers (often wit$ ,air ,rogra--ing in t$e e1tre-e ,rogra--ing -et$odo*og0) Of course t$ese tests fai* initia**0G as t$e0 are e1,ected to #$en as code is - 212 -

Course Notes: written it ,asses incre-enta**0 *arger ,ortions of t$e test suites #$e test suites are continuous*0 u,dated as new fai*ure conditions and corner cases are disco"ered< and t$e0 are integrated wit$ an0 regression tests t$at are de"e*o,ed =nit tests are -aintained a*ong wit$ t$e rest of t$e software source code and genera**0 integrated into t$e bui*d ,rocess (wit$ in$erent*0 interacti"e tests being re*egated to a ,artia**0 -anua* bui*d acce,tance ,rocess) #$e u*ti-ate goa* of t$is test ,rocess is to ac$ie"e continuous integration w$ere software u,dates can be ,ub*is$ed to t$e ,ub*ic fre@uent*0 J3&W J'0W

< sa,+le testing c/cle


>*t$oug$ "ariations e1ist between organiDations< t$ere is a t0,ica* c0c*e for testing J'1W #$e sa-,*e be*ow is co--on a-ong organiDations e-,*o0ing t$e 3aterfa** de"e*o,-ent -ode* Re#uirements analysis: #esting s$ou*d begin in t$e re@uire-ents ,$ase of t$e software de"e*o,-ent *ife c0c*e 8uring t$e design ,$ase< testers wor? wit$ de"e*o,ers in deter-ining w$at as,ects of a design are testab*e and wit$ w$at ,ara-eters t$ose tests wor? @est planning: #est strateg0< test ,*an< testbed creation Since -an0 acti"ities wi** be carried out during testing< a ,*an is needed @est development: #est ,rocedures< test scenarios< test cases< test datasets< test scri,ts to use in testing software @est execution: #esters e1ecute t$e software based on t$e ,*ans and test docu-ents t$en re,ort an0 errors found to t$e de"e*o,-ent tea @est reporting: Once testing is co-,*eted< testers generate -etrics and -a?e fina* re,orts on t$eir test effort and w$et$er or not t$e software tested is read0 for re*ease @est result analysis: Or 8efect >na*0sis< is done b0 t$e de"e*o,-ent tea- usua**0 a*ong wit$ t$e c*ient< in order to decide w$at defects s$ou*d be assigned< fi1ed< rejected (i e found software wor?ing ,ro,er*0) or deferred to be dea*t wit$ *ater Defect Retesting: Once a defect $as been dea*t wit$ b0 t$e de"e*o,-ent tea-< it is retested b0 t$e testing tea- >S> 5eso*ution testing Regression testing: !t is co--on to $a"e a s-a** test ,rogra- bui*t of a subset of tests< for eac$ integration of new< -odified< or fi1ed software< in order to ensure t$at t$e *atest de*i"er0 $as not ruined an0t$ing< and t$at t$e software ,roduct as a w$o*e is sti** wor?ing correct*0 @est !losure: Once t$e test -eets t$e e1it criteria< t$e acti"ities suc$ as ca,turing t$e ?e0 out,uts< *essons *earned< resu*ts< *ogs< docu-ents re*ated to t$e ,roject are arc$i"ed and used as a reference for future ,rojects

%utomated testing
/an0 ,rogra--ing grou,s are re*0ing -ore and -ore on auto-ated testing< es,ecia**0 grou,s t$at use test-dri"en de"e*o,-ent #$ere are -an0 fra-ewor?s to write tests in< and continuous integration software wi** run tests auto-atica**0 e"er0 ti-e code is c$ec?ed into a "ersion contro* s0ste3$i*e auto-ation cannot re,roduce e"er0t$ing t$at a $u-an can do (and a** t$e wa0s t$e0 t$in? of doing it)< it can be "er0 usefu* for regression testing ;owe"er< it does re@uire a we**-de"e*o,ed test suite of testing scri,ts in order to be tru*0 usefu*

- 213 -

Object-Oriented Software Engineering (CS350)

esting tools
%rogra- testing and fau*t detection can be aided significant*0 b0 testing too*s and debuggers #estingFdebug too*s inc*ude features suc$ as: %rogra- -onitors< ,er-itting fu** or ,artia* -onitoring of ,rogra- code inc*uding: !nstruction set si-u*ator< ,er-itting co-,*ete instruction *e"e* -onitoring and trace faci*ities %rogra- ani-ation< ,er-itting ste,-b0-ste, e1ecution and conditiona* brea?,oint at source *e"e* or in -ac$ine code Code co"erage re,orts Aor-atted du-, or s0-bo*ic debugging< too*s a**owing ins,ection of ,rogra- "ariab*es on error or at c$osen ,oints >uto-ated functiona* 7=! testing too*s are used to re,eat s0ste--*e"e* tests t$roug$ t$e 7=! +enc$-ar?s< a**owing run-ti-e ,erfor-ance co-,arisons to be -ade %erfor-ance ana*0sis (or ,rofi*ing too*s) t$at can $e*, to $ig$*ig$t $ot s,ots and resource usage So-e of t$ese features -a0 be incor,orated into an !ntegrated 8e"e*o,-ent En"iron-ent (!8E) > regression testing tec$ni@ue is to $a"e a standard set of tests< w$ic$ co"er e1isting functiona*it0 t$at resu*t in ,ersistent tabu*ar data< and to co-,are ,re-c$ange data to ,ostc$ange data< w$ere t$ere s$ou*d not be differences< using a too* *i?e diff?it 8ifferences detected indicate une1,ected functiona*it0 c$anges or HregressionH

.easure,ent in software testing


/ain artic*e: Software @ua*it0 =sua**0< @ua*it0 is constrained to suc$ to,ics as correctness< co-,*eteness< securit0< but can a*so inc*ude -ore tec$nica* re@uire-ents as described under t$e !SO standard !SOF!EC &12(< suc$ as ca,abi*it0< re*iabi*it0< efficienc0< ,ortabi*it0< -aintainabi*it0< co-,atibi*it0< and usabi*it0 #$ere are a nu-ber of fre@uent*0-used software -etrics< or -easures< w$ic$ are used to assist in deter-ining t$e state of t$e software or t$e ade@uac0 of t$e testing

"esting artifacts
#$e software testing ,rocess can ,roduce se"era* artifacts #est ,*an > test s,ecification is ca**ed a test ,*an #$e de"e*o,ers are we** aware w$at test ,*ans wi** be e1ecuted and t$is infor-ation is -ade a"ai*ab*e to -anage-ent and t$e de"e*o,ers #$e idea is to -a?e t$e- -ore cautious w$en de"e*o,ing t$eir code or -a?ing additiona* c$anges So-e co-,anies $a"e a $ig$er-*e"e* docu-ent ca**ed a test strateg0 #raceabi*it0 -atri1 > traceabi*it0 -atri1 is a tab*e t$at corre*ates re@uire-ents or design docu-ents to test - 21' -

Course Notes: docu-ents !t is used to c$ange tests w$en re*ated source docu-ents are c$anged< to se*ect test cases for e1ecution w$en ,*anning for regression tests b0 considering re@uire-ent co"erage #est case > test case nor-a**0 consists of a uni@ue identifier< re@uire-ent references fro- a design s,ecification< ,reconditions< e"ents< a series of ste,s (a*so ?nown as actions) to fo**ow< in,ut< out,ut< e1,ected resu*t< and actua* resu*t C*inica**0 defined a test case is an in,ut and an e1,ected resu*t J'2W #$is can be as ,rag-atic as 4for condition 1 0our deri"ed resu*t is 04< w$ereas ot$er test cases described in -ore detai* t$e in,ut scenario and w$at resu*ts -ig$t be e1,ected !t can occasiona**0 be a series of ste,s (but often ste,s are contained in a se,arate test ,rocedure t$at can be e1ercised against -u*ti,*e test cases< as a -atter of econo-0) but wit$ one e1,ected resu*t or e1,ected outco-e #$e o,tiona* fie*ds are a test case !8< test ste,< or order of e1ecution nu-ber< re*ated re@uire-ent(s)< de,t$< test categor0< aut$or< and c$ec? bo1es for w$et$er t$e test is auto-atab*e and $as been auto-ated .arger test cases -a0 a*so contain ,rere@uisite states or ste,s< and descri,tions > test case s$ou*d a*so contain a ,*ace for t$e actua* resu*t #$ese ste,s can be stored in a word ,rocessor docu-ent< s,reads$eet< database< or ot$er co--on re,ositor0 !n a database s0ste-< 0ou -a0 a*so be ab*e to see ,ast test resu*ts< w$o generated t$e resu*ts< and w$at s0ste- configuration was used to generate t$ose resu*ts #$ese ,ast resu*ts wou*d usua**0 be stored in a se,arate tab*e #est scri,t > test scri,t is a ,rocedure< or ,rogra-ing code t$at re,*icates user actions !nitia**0 t$e ter- was deri"ed fro- t$e ,roduct of wor? created b0 auto-ated regression test too*s #est Case wi** be a base*ine to create test scri,ts using a too* or a ,rogra#est suite #$e -ost co--on ter- for a co**ection of test cases is a test suite #$e test suite often a*so contains -ore detai*ed instructions or goa*s for eac$ co**ection of test cases !t definite*0 contains a section w$ere t$e tester identifies t$e s0ste- configuration used during testing > grou, of test cases -a0 a*so contain ,rere@uisite states or ste,s< and descri,tions of t$e fo**owing tests #est fi1ture or test data !n -ost cases< -u*ti,*e sets of "a*ues or data are used to test t$e sa-e functiona*it0 of a ,articu*ar feature >** t$e test "a*ues and c$angeab*e en"iron-enta* co-,onents are co**ected in se,arate fi*es and stored as test data !t is a*so usefu* to ,ro"ide t$is data to t$e c*ient and wit$ t$e ,roduct or a ,roject #est $arness #$e software< too*s< sa-,*es of data in,ut and out,ut< and configurations are a** referred to co**ecti"e*0 as a test $arness

- 215 -

Object-Oriented Software Engineering (CS350)

Certifications
Se"era* certification ,rogra-s e1ist to su,,ort t$e ,rofessiona* as,irations of software testers and @ua*it0 assurance s,ecia*ists No certification now offered actua**0 re@uires t$e a,,*icant to s$ow t$eir abi*it0 to test software No certification is based on a wide*0 acce,ted bod0 of ?now*edge #$is $as *ed so-e to dec*are t$at t$e testing fie*d is not read0 for certification J'3W Certification itse*f cannot -easure an indi"idua*4s ,roducti"it0< t$eir s?i**< or ,ractica* ?now*edge< and cannot guarantee t$eir co-,etence< or ,rofessiona*is- as a tester J''W Software testing certification t0,es E"am#based: Aor-a*iDed e1a-s< w$ic$ need to be ,assedG can a*so be *earned b0 se*fstud0 Je g < for !S#E+ or E>!WJ'5W Education#based: !nstructor-*ed sessions< w$ere eac$ course $as to be ,assed Je g < !nternationa* !nstitute for Software #esting (!!S#)W #esting certifications Certified >ssociate in Software #esting (C>S#) offered b0 t$e E>! J'(W C>#e offered b0 t$e *nternational *nstitute for Software TestingJ'2W Certified /anager in Software #esting (C/S#) offered b0 t$e E>! J'(W Certified Software #ester (CS#E) offered b0 t$e Eua*it0 >ssurance !nstitute (E>!)J'(W Certified Software #est %rofessiona* (CS#%) offered b0 t$e *nternational *nstitute for Software TestingJ'2W CS#% (#/) (>ustra*ian :ersion) offered b0 1% C% +oss I ssociatesJ')W !SE+ offered b0 t$e !nfor-ation S0ste-s E1a-inations +oard !S#E+ Certified #ester< Aoundation .e"e* (C#A.) offered b0 t$e !nternationa* Software #esting Eua*ification +oard J'&WJ50W !S#E+ Certified #ester< >d"anced .e"e* (C#>.) offered b0 t$e !nternationa* Software #esting Eua*ification +oard J'&WJ50W #/%A #/a, Ne1t Aoundation offered b0 t$e E"amination *nstitute for *nformation ScienceJ51W #/%> #/a, Ne1t >d"anced offered b0 t$e E"amination *nstitute for *nformation ScienceJ51W Eua*it0 assurance certifications C/SE offered b0 t$e Juality ssurance *nstitute (E>!) J'(W CSE> offered b0 t$e Juality ssurance *nstitute (E>!)J'(W CSEE offered b0 t$e >-erican Societ0 for Eua*it0 (>SE)J52W CE!> offered b0 t$e >-erican Societ0 for Eua*it0 (>SE)J52W

- 21( -

Course Notes:

Controversy
So-e of t$e -ajor software testing contro"ersies inc*ude: 3$at constitutes res,onsib*e software testing6 /e-bers of t$e Hconte1t-dri"enH sc$oo* of testingJ53W be*ie"e t$at t$ere are no Hbest ,racticesH of testing< but rat$er t$at testing is a set of s?i**s t$at a**ow t$e tester to se*ect or in"ent testing ,ractices to suit eac$ uni@ue situation J5'W >gi*e "s traditiona* S$ou*d testers *earn to wor? under conditions of uncertaint0 and constant c$ange or s$ou*d t$e0 ai- at ,rocess H-aturit0H6 #$e agi*e testing -o"e-ent $as recei"ed growing ,o,u*arit0 since 200( -ain*0 in co--ercia* circ*es<J55WJ5(W w$ereas go"ern-ent and -i*itar0J52W software ,ro"iders use t$is -et$odo*og0 but a*so t$e traditiona* test-*ast -ode*s (e g in t$e 3aterfa** -ode*) E1,*orator0 test "s scri,ted J5)W S$ou*d tests be designed at t$e sa-e ti-e as t$e0 are e1ecuted or s$ou*d t$e0 be designed before$and6 /anua* testing "s auto-ated So-e writers be*ie"e t$at test auto-ation is so e1,ensi"e re*ati"e to its "a*ue t$at it s$ou*d be used s,aring*0 J5&W /ore in ,articu*ar< test-dri"en de"e*o,-ent states t$at de"e*o,ers s$ou*d write unit-tests of t$e T=nit t0,e before coding t$e functiona*it0 #$e tests t$en can be considered as a wa0 to ca,ture and i-,*e-ent t$e re@uire-ents Software design "s software i-,*e-entation J(0W S$ou*d testing be carried out on*0 at t$e end or t$roug$out t$e w$o*e ,rocess6 3$o watc$es t$e watc$-en6 #$e idea is t$at an0 for- of obser"ation is a*so an interactionXt$e act of testing can a*so affect t$at w$ic$ is being tested J(1W

+elated processes
Software #erification and #alidation
/ain artic*e: :erification and "a*idation (software) Software testing is used in association wit$ "erification and "a*idation:J(2W :erification: ;a"e we bui*t t$e software rig$t6 (i e < does it i-,*e-ent t$e re@uire-ents) :a*idation: ;a"e we bui*t t$e rig$t software6 (i e < do t$e re@uire-ents satisf0 t$e custo-er)

- 212 -

Object-Oriented Software Engineering (CS350) #$e ter-s "erification and "a*idation are co--on*0 used interc$angeab*0 in t$e industr0G it is a*so co--on to see t$ese two ter-s incorrect*0 defined >ccording to t$e !EEE Standard 7*ossar0 of Software Engineering #er-ino*og0: :erification is t$e ,rocess of e"a*uating a s0ste- or co-,onent to deter-ine w$et$er t$e ,roducts of a gi"en de"e*o,-ent ,$ase satisf0 t$e conditions i-,osed at t$e start of t$at ,$ase :a*idation is t$e ,rocess of e"a*uating a s0ste- or co-,onent during or at t$e end of t$e de"e*o,-ent ,rocess to deter-ine w$et$er it satisfies s,ecified re@uire-ents >ccording to t$e !S0 &000 standard: :erification is confir-ation b0 e1a-ination and t$roug$ ,ro"ision of objecti"e e"idence t$at s,ecified re@uire-ents $a"e been fu*fi**ed :a*idation is confir-ation b0 e1a-ination and t$roug$ ,ro"ision of objecti"e e"idence t$at t$e re@uire-ents for a s,ecific intended use or a,,*ication $a"e been fu*fi**ed

Software >ualit/ assurance @SF<A


Software testing is a ,art of t$e software @ua*it0 assurance (SE>) ,rocess J'W !n SE>< software ,rocess s,ecia*ists and auditors are concerned for t$e software de"e*o,-ent ,rocess rat$er t$an just t$e artifacts suc$ as docu-entation< code and s0ste-s #$e0 e1a-ine and c$ange t$e software engineering ,rocess itse*f to reduce t$e nu-ber of fau*ts t$at end u, in t$e de*i"ered software: t$e so-ca**ed Hdefect rateH 3$at constitutes an Hacce,tab*e defect rateH de,ends on t$e nature of t$e softwareG > f*ig$t si-u*ator "ideo ga-e wou*d $a"e -uc$ $ig$er defect to*erance t$an software for an actua* air,*ane >*t$oug$ t$ere are c*ose *in?s wit$ SE>< testing de,art-ents often e1ist inde,endent*0< and t$ere -a0 be no SE> function in so-e co-,anies Software testing is a tas? intended to detect defects in software b0 contrasting a co-,uter ,rogra-4s e1,ected resu*ts wit$ its actua* resu*ts for a gi"en set of in,uts +0 contrast< E> (@ua*it0 assurance) is t$e i-,*e-entation of ,o*icies and ,rocedures intended to ,re"ent defects fro- occurring in t$e first ,*ace

- 21) -

Course Notes:

13!Software c$ange
Maintenance
&oft%are maintenance in software engineering is t$e -odification of a software ,roduct after de*i"er0 to correct fau*ts< to i-,ro"e ,erfor-ance or ot$er attributes J1W > co--on ,erce,tion of -aintenance is t$at it -ere*0 in"o*"es fi1ing defects ;owe"er< one stud0 indicated t$at t$e -ajorit0< o"er )0N< of t$e -aintenance effort is used for non-correcti"e actions (%igos?0 1&&2) #$is ,erce,tion is ,er,etuated b0 users sub-itting ,rob*e- re,orts t$at in rea*it0 are functiona*it0 en$ance-ents to t$e s0steSoftware -aintenance and e"o*ution of s0ste-s was first addressed b0 /eir / .e$-an in 1&(& O"er a ,eriod of twent0 0ears< $is researc$ *ed to t$e for-u*ation of .e$-an4s .aws (.e$-an 1&&2) Se0 findings of $is researc$ inc*ude t$at -aintenance is rea**0 e"o*utionar0 de"e*o,-ent and t$at -aintenance decisions are aided b0 understanding w$at $a,,ens to s0ste-s (and software) o"er ti-e .e$-an de-onstrated t$at s0ste-s continue to e"o*"e o"er ti-e >s t$e0 e"o*"e< t$e0 grow -ore co-,*e1 un*ess so-e action suc$ as code refactoring is ta?en to reduce t$e co-,*e1it0 #$e ?e0 software -aintenance issues are bot$ -anageria* and tec$nica* Se0 -anage-ent issues are: a*ign-ent wit$ custo-er ,riorities< staffing< w$ic$ organiDation does -aintenance< esti-ating costs Se0 tec$nica* issues are: *i-ited understanding< i-,act ana*0sis< testing< -aintainabi*it0 -easure-ent

$e i,+ortance of software ,aintenance


!n t$e *ate 1&20s< a fa-ous and wide*0 cited sur"e0 stud0 b0 .ientD and Swanson< e1,osed t$e "er0 $ig$ fraction of *ife-c0c*e costs t$at were being e1,ended on -aintenance #$e0 categoriDed -aintenance acti"ities into four c*asses: >da,ti"e C -odif0ing t$e s0ste- to co,e wit$ c$anges in t$e software en"iron-ent (8+/S< OS) J2W %erfecti"e C i-,*e-enting new or c$anged user re@uire-ents w$ic$ concern functiona* en$ance-ents to t$e software Correcti"e C diagnosing and fi1ing errors< ,ossib*0 ones found b0 users J2W %re"enti"e C increasing software -aintainabi*it0 or re*iabi*it0 to ,re"ent ,rob*e-s in t$e future J2W #$e sur"e0 s$owed t$at around 25N of t$e -aintenance effort was on t$e first two t0,es< and error correction consu-ed about 21N /an0 subse@uent studies suggest a si-i*ar -agnitude of t$e ,rob*eStudies s$ow t$at contribution of end user is crucia* during t$e new re@uire-ent data gat$ering and ana*0sis >nd t$is is t$e -ain cause of an0 ,rob*e- during software e"o*ution and -aintenance So software -aintenance is i-,ortant because it consu-es a *arge ,art of t$e o"era** *ifec0c*e costs and a*so t$e inabi*it0 to c$ange software @uic?*0 and re*iab*0 -eans t$at business o,,ortunities are *ost J3W J'W J5W

- 21& -

Object-Oriented Software Engineering (CS350) !-,act of ?e0 adjust-ent factors on -aintenance (sorted in order of -a1i-u- ,ositi"e i-,act) )aintenance 'actors lus Range /aintenance s,ecia*ists 35N ;ig$ staff e1,erience 3'N #ab*e-dri"en "ariab*es and data 33N .ow co-,*e1it0 of base code 32N P2S and s,ecia* searc$ engines 30N Code restructuring too*s 2&N 5e-engineering too*s 22N ;ig$ *e"e* ,rogra--ing *anguages 25N 5e"erse engineering too*s 23N Co-,*e1it0 ana*0sis too*s 20N 8efect trac?ing too*s 20N P2S Q-ass u,dateR s,ecia*ists 20N >uto-ated c$ange contro* too*s 1)N =n,aid o"erti-e 1)N Eua*it0 -easure-ents 1(N Aor-a* base code ins,ections 15N 5egression test *ibraries 15N E1ce**ent res,onse ti-e 12N >nnua* training of _ 10 da0s 12N ;ig$ -anage-ent e1,erience 12N ;E.% des? auto-ation 12N No error ,rone -odu*es 10N On-*ine defect re,orting 10N %roducti"it0 -easure-ents )N E1ce**ent ease of use 2N =ser satisfaction -easure-ents 5N ;ig$ tea- -ora*e 5N &um ;29D Not on*0 are error-,rone -odu*es troub*eso-e< but -an0 ot$er factors can degrade ,erfor-ance too Aor e1a-,*e< "er0 co-,*e1 Qs,ag$etti codeR is @uite difficu*t to -aintain safe*0 > "er0 co--on situation w$ic$ often degrades ,erfor-ance is *ac? of suitab*e -aintenance too*s< suc$ as defect trac?ing software< c$ange -anage-ent software< and test *ibrar0 software +e*ow describe so-e of t$e factors and t$e range of i-,act on software -aintenance !-,act of ?e0 adjust-ent factors on -aintenance (sorted in order of -a1i-u- negati"e i-,act)

- 220 -

Course Notes: )aintenance 'actors Error ,rone -odu*es E-bedded "ariab*es and data Staff ine1,erience ;ig$ code co-,*e1it0 No P2S of s,ecia* searc$ engines /anua* c$ange contro* -et$ods .ow *e"e* ,rogra--ing *anguages No defect trac?ing too*s No P2S Q-ass u,dateR s,ecia*ists %oor ease of use No @ua*it0 -easure-ents No -aintenance s,ecia*ists %oor res,onse ti-e No code ins,ections No regression test *ibraries No $e*, des? auto-ation No on-*ine defect re,orting /anage-ent ine1,erience No code restructuring too*s No annua* training No reengineering too*s No re"erse-engineering too*s No co-,*e1it0 ana*0sis too*s No ,roducti"it0 -easure-ents %oor tea- -ora*e No user satisfaction -easure-ents No un,aid o"erti-e &um J(W )inus Range -50N -'5N -'0N -30N -2)N -22N -25N -2'N -22N -1)N -1)N -1)N -1(N -15N -15N -15N -12N -15N -10N -10N -10N -10N -10N -2N -(N -'N 0N (;22D

Software ,aintenance +lanning


>n integra* ,art of software is t$e -aintenance one< w$ic$ re@uires an accurate -aintenance ,*an to be ,re,ared during t$e software de"e*o,-ent !t s$ou*d s,ecif0 $ow users wi** re@uest -odifications or re,ort ,rob*e-s #$e budget s$ou*d inc*ude resource and cost esti-ates > new decision s$ou*d be addressed for t$e de"e*o,ing of e"er0 new s0ste- feature and its @ua*it0 objecti"es J1W #$e software -aintenance< w$ic$ can *ast for 5C( 0ears (or e"en decades) after t$e de"e*o,-ent ,rocess< ca**s for an effecti"e ,*an w$ic$ can address t$e sco,e of software -aintenance< t$e tai*oring of t$e ,ost - 221 -

Object-Oriented Software Engineering (CS350) de*i"er0Fde,*o0-ent ,rocess< t$e designation of w$o wi** ,ro"ide -aintenance< and an esti-ate of t$e *ife-c0c*e costs J2W

Software ,aintenance +rocesses


#$is section describes t$e si1 software -aintenance ,rocesses as: 1 #$e i-,*e-entation ,rocess contains software ,re,aration and transition acti"ities< suc$ as t$e conce,tion and creation of t$e -aintenance ,*anG t$e ,re,aration for $and*ing ,rob*e-s identified during de"e*o,-entG and t$e fo**ow-u, on ,roduct configuration -anage-ent 2 #$e ,rob*e- and -odification ana*0sis ,rocess< w$ic$ is e1ecuted once t$e a,,*ication $as beco-e t$e res,onsibi*it0 of t$e -aintenance grou, #$e -aintenance ,rogra--er -ust ana*0De eac$ re@uest< confir- it (b0 re,roducing t$e situation) and c$ec? its "a*idit0< in"estigate it and ,ro,ose a so*ution< docu-ent t$e re@uest and t$e so*ution ,ro,osa*< and fina**0< obtain a** t$e re@uired aut$oriDations to a,,*0 t$e -odifications 3 #$e ,rocess considering t$e i-,*e-entation of t$e -odification itse*f ' #$e ,rocess acce,tance of t$e -odification< b0 confir-ing t$e -odified wor? wit$ t$e indi"idua* w$o sub-itted t$e re@uest in order to -a?e sure t$e -odification ,ro"ided a so*ution 5 #$e -igration ,rocess (,*atfor- -igration< for e1a-,*e) is e1ce,tiona*< and is not ,art of dai*0 -aintenance tas?s !f t$e software -ust be ,orted to anot$er ,*atfor- wit$out an0 c$ange in functiona*it0< t$is ,rocess wi** be used and a -aintenance ,roject tea- is *i?e*0 to be assigned to t$is tas? ( Aina**0< t$e *ast -aintenance ,rocess< a*so an e"ent w$ic$ does not occur on a dai*0 basis< is t$e retire-ent of a ,iece of software #$ere are a nu-ber of ,rocesses< acti"ities and ,ractices t$at are uni@ue to -aintainers< for e1a-,*e: #ransition: a contro**ed and coordinated se@uence of acti"ities during w$ic$ a s0ste- is transferred ,rogressi"e*0 fro- t$e de"e*o,er to t$e -aintainerG Ser"ice .e"e* >gree-ents (S.>s) and s,ecia*iDed (do-ain-s,ecific) -aintenance contracts negotiated b0 -aintainersG /odification 5e@uest and %rob*e- 5e,ort ;e*, 8es?: a ,rob*e--$and*ing ,rocess used b0 -aintainers to ,rioritiDe< docu-ents and route t$e re@uests t$e0 recei"eG /odification 5e@uest acce,tanceFrejection: -odification re@uest wor? o"er a certain siDeFeffortFco-,*e1it0 -a0 be rejected b0 -aintainers and rerouted to a de"e*o,er

Categories of ,aintenance in "SOB"EC 1'C('


E + Swanson initia**0 identified t$ree categories of -aintenance: correcti"e< ada,ti"e< and ,erfecti"e J2W #$ese $a"e since been u,dated and !SOF!EC 1'2(' ,resents: Correcti"e -aintenance: 5eacti"e -odification of a software ,roduct ,erfor-ed after de*i"er0 to correct disco"ered ,rob*e-s >da,ti"e -aintenance: /odification of a software ,roduct ,erfor-ed after de*i"er0 to ?ee, a software ,roduct usab*e in a c$anged or c$anging en"iron-ent - 222 -

Course Notes: %erfecti"e -aintenance: /odification of a software ,roduct after de*i"er0 to i-,ro"e ,erfor-ance or -aintainabi*it0 %re"enti"e -aintenance: /odification of a software ,roduct after de*i"er0 to detect and correct *atent fau*ts in t$e software ,roduct before t$e0 beco-e effecti"e fau*ts #$ere is a*so a notion of ,re-de*i"er0F,re-re*ease -aintenance w$ic$ is a** t$e good t$ings 0ou do to *ower t$e tota* cost of owners$i, of t$e software #$ings *i?e co-,*iance wit$ coding standards t$at inc*udes software -aintainabi*it0 goa*s #$e -anage-ent of cou,*ing and co$esion of t$e software #$e attain-ent of software su,,ortabi*it0 goa*s (S>E I>100'< I>1005 and I>100( for e1a-,*e) Note a*so t$at so-e acade-ic institutions are carr0ing out researc$ to @uantif0 t$e cost to ongoing software -aintenance due to t$e *ac? of resources suc$ as design docu-ents and s0ste-Fsoftware co-,re$ension training and resources (-u*ti,*0 costs b0 a,,ro1 1 5-2 0 w$ere t$ere is no design data a"ai*ab*e )

%rchitecture
#$e soft%are architecture of a s0ste- is t$e set of structures needed to reason about t$e s0ste-< w$ic$ co-,rise software e*e-ents< re*ations a-ong t$e-< and ,ro,erties of bot$ J1W #$e ter- a*so refers to docu-entation of a s0ste-4s Hsoftware arc$itecture H 8ocu-enting software arc$itecture faci*itates co--unication between sta?e$o*ders< docu-ents ear*0 decisions about $ig$-*e"e* design< and a**ows reuse of design co-,onents and ,atterns between ,rojects J2W

O#er#iew
#$e fie*d of co-,uter science $as encountered ,rob*e-s associated wit$ co-,*e1it0 since its for-ation J3W Ear*ier ,rob*e-s of co-,*e1it0 were so*"ed b0 de"e*o,ers b0 c$oosing t$e rig$t data structures< de"e*o,ing a*gorit$-s< and b0 a,,*0ing t$e conce,t of se,aration of concerns >*t$oug$ t$e ter- Qsoftware arc$itectureR is re*ati"e*0 new to t$e industr0< t$e funda-enta* ,rinci,*es of t$e fie*d $a"e been a,,*ied s,oradica**0 b0 software engineering ,ioneers since t$e -id 1&)0s Ear*0 atte-,ts to ca,ture and e1,*ain software arc$itecture of a s0ste- were i-,recise and disorganiDed< often c$aracteriDed b0 a set of bo1-and-*ine diagra-s J'W 8uring t$e 1&&0s t$ere was a concentrated effort to define and codif0 funda-enta* as,ects of t$e disci,*ine !nitia* sets of design patterns< st0*es< best ,ractices< descri,tion *anguages< and for-a* *ogic were de"e*o,ed during t$at ti-e #$e software arc$itecture disci,*ine is centered on t$e idea of reducing co-,*e1it0 t$roug$ abstraction and se,aration of concerns #o date t$ere is sti** no agree-ent on t$e ,recise definition of t$e terQsoftware arc$itectureR J5W ;owe"er< t$is does not -ean t$at indi"idua*s do not $a"e t$eir own definition of w$at software arc$itecture is #$is *eads to ,rob*e-s because -an0 ,eo,*e are using t$e sa-e ter-s to describe differing ideas >s a -aturing disci,*ine wit$ no c*ear ru*es on t$e rig$t wa0 to bui*d a s0ste-< designing software arc$itecture is sti** a -i1 of art and science #$e QartR as,ect of software arc$itecture arises because a co--ercia* software s0ste- su,,orts so-e as,ect of a business or a -ission ;ow a s0ste- su,,orts ?e0 business dri"ers< described "ia scenarios as non-functiona* re@uire-ents of a s0ste-< a*so ?nown as @ua*it0 attributes< deter-ine $ow a s0ste- wi** be$a"e J(W #$is cou*d be t$oug$t of as a ,ara**e* to a - 223 -

Object-Oriented Software Engineering (CS350) -ission state-ent and "a*ue s0ste- in business strateg0 E"er0 s0ste- is uni@ue to t$e business dri"ers it su,,orts< t$erefore t$e @ua*it0 attributes of eac$ s0ste- suc$ as fau*t-to*erance< bac?ward co-,atibi*it0< e1tensibi*it0< re*iabi*it0< -aintainabi*it0< a"ai*abi*it0< securit0< usabi*it0< and suc$ ot$er C i*ities wi** "ar0 wit$ eac$ i-,*e-entation J(W #o bring a software arc$itecture user4s ,ers,ecti"e into t$e software arc$itecture< it can be said t$at software arc$itecture gi"es t$e direction to ta?e ste,s and do t$e tas?s in"o*"ed in eac$ suc$ user4s s,ecia*t0 area and interest e g t$e sta?e$o*ders of software s0ste-s< t$e software de"e*o,er< t$e software s0ste- o,erationa* su,,ort grou,< t$e software -aintenance s,ecia*ists< t$e de,*o0er< t$e tester and a*so t$e business end user !n t$is sense software arc$itecture is rea**0 t$e a-a*ga-ation of t$e -u*ti,*e ,ers,ecti"es a s0ste- a*wa0s e-bodies #$e fact t$at t$ose se"era* different ,ers,ecti"es can be ,ut toget$er into a software arc$itecture stands as t$e "indication of t$e need and justification of creation of software arc$itecture before t$e software de"e*o,-ent in a ,roject attains -aturit0

9istor/
Software arc$itecture as a conce,t $as its origins in t$e researc$ of Edsger 8ij?stra in 1&() and 8a"id %arnas in t$e ear*0 1&20s #$ese scientists e-,$asiDed t$at t$e structure of a software s0ste- -atters and getting t$e structure rig$t is critica* #$e stud0 of t$e fie*d increased in ,o,u*arit0 since t$e ear*0 1&&0s wit$ researc$ wor? concentrating on arc$itectura* st0*es (,atterns)< arc$itecture descri,tion *anguages< arc$itecture docu-entation< and for-a* -et$ods J2W 5esearc$ institutions $a"e ,*a0ed a ,ro-inent ro*e in furt$ering software arc$itecture as a disci,*ine /ar0 S$aw and 8a"id 7ar*an of Carnegie /e**on wrote a boo? tit*ed Software rchitecture/ers!ectives on an Emerging ,isci!line in 1&&(< w$ic$ broug$t forward t$e conce,ts in Software >rc$itecture< suc$ as co-,onents< connectors< st0*es and so on #$e =ni"ersit0 of Ca*ifornia< !r"ine4s !nstitute for Software 5esearc$4s efforts in software arc$itecture researc$ is directed ,ri-ari*0 in arc$itectura* st0*es< arc$itecture descri,tion *anguages< and d0na-ic arc$itectures !EEE 1'21-2000< +ecommended /ractice for rchitecture ,escri!tion of Software#*ntensive Systems< was t$e first for-a* standard in t$e area of software arc$itecture !t was ado,ted in 2002 b0 !SO as !SOF!EC '2010:2002 !n No"e-ber 2011< !EEE 1'21-2000 was su,erseded b0 !SOF!ECF!EEE '2010:2011< Systems and software engineering K rchitecture descri!tion (joint*0 ,ub*is$ed b0 !EEE and !SO)

Software arc$itecture to+ics


%rchitecture description languages >rc$itecture descri,tion *anguages ($D1s) are used to describe a software arc$itecture Se"era* different >8.s $a"e been de"e*o,ed b0 different organiDations< inc*uding >>8. (S>E standard)< 3rig$t (de"e*o,ed b0 Carnegie /e**on)< >c-e (de"e*o,ed b0 Carnegie /e**on)< 1>8. (de"e*o,ed b0 =C!)< 8arwin (de"e*o,ed b0 !-,eria* Co**ege .ondon)< 8>O%->8. (de"e*o,ed b0 =ni"ersit0 of /w*aga)< and +0>8. (=ni"ersit0 of .4>@ui*a< !ta*0) Co--on e*e-ents of an >8. are co-,onent< connector and configuration

- 22' -

Course Notes: !iews Software arc$itecture descri,tions are co--on*0 organiDed into "iews< w$ic$ are ana*ogous to t$e different t0,es of b*ue,rints -ade in bui*ding arc$itecture > "iew is a re,resentation of a set of s0steco-,onents and re*ations$i,s a-ong t$e- J1W 3it$in t$e onto*og0 estab*is$ed b0 !EEE 1'21-2000< views fo**ow t$e con"entions estab*is$ed b0 t$eir view!oints< w$ere a "iew,oint is a s,ecification t$at describes t$e notations< -ode*ing tec$ni@ues to be used in a "iew to e1,ress t$e arc$itecture in @uestion fro- t$e ,ers,ecti"e of a gi"en set of sta?e$o*ders and t$eir concerns #$e "iew,oint s,ecifies not on*0 t$e concerns addressed but t$e ,resentation< -ode* ?inds used< con"entions used and an0 consistenc0 (corres,ondence) ru*es to ?ee, a "iew consistent wit$ ot$er "iews So-e e1a-,*es of ?inds of "iews (view!oints in t$e 1'21F'2010 onto*og0) are: Aunctiona*F*ogica* "iew,oint CodeF-odu*e "iew,oint 8e"e*o,-entFstructura* "iew,oint Concurrenc0F,rocessFrunti-eFt$read "iew,oint %$0sica*Fde,*o0-entFinsta** "iew,oint =ser actionFfeedbac? "iew,oint 8ata "iewFdata -ode*

Se"era* *anguages for describing software arc$itectures (architecture descri!tion language in !SOF!ECF!EEE '2010 (!EEE 1'21) ter-ino*og0) $a"e been de"ised< but no consensus e1ists on w$ic$ s0-bo*-set or *anguage s$ou*d be used to for eac$ arc$itecture "iew,oint #$e =/. is a standard t$at can be used ;for analysis0 design0 and im!lementation of software#based systems as well as for modeling business and similar !rocesses%; #$us< t$e =/. is a "isua* *anguage t$at can be used to create software arc$itecture %rchitecture framewor/s Ara-ewor?s re*ated to t$e do-ain of software arc$itecture are: 'B1 5/-O8% (5eference /ode* of O,en 8istributed %rocessing) Ser"ice-Oriented /ode*ing Ara-ewor? (SO/A) Ot$er arc$itecture fra-ewor?s suc$ as t$e Yac$-an Ara-ewor?< 8O8>A< and #O7>A re*ate to t$e fie*d of Enter,rise arc$itecture "he distinction from functional design #$e !EEE Std (10 12-1&&0 Standard 7*ossar0 of Software Engineering #er-ino*og0 defines t$e fo**owing distinctions: >rc$itectura* 8esign: t$e ,rocess of defining a co**ection of $ardware and software co-,onents and t$eir interfaces to estab*is$ t$e fra-ewor? for t$e de"e*o,-ent of a co-,uter s0ste %re*i-inar0 8esign: t$e ,rocess of ana*0Ding design a*ternati"es and defining t$e arc$itecture< co-,onents< interfaces< and ti-ingFsiDing esti-ates for a s0ste- or co-,onents - 225 -

Object-Oriented Software Engineering (CS350) 8etai*ed 8esign: t$e ,rocess of refining and e1,anding t$e ,re*i-inar0 design of a s0ste- or co-,onent to t$e e1tent t$at t$e design is sufficient*0 co-,*ete to begin i-,*e-entation Aunctiona* 8esign: t$e ,rocess of defining t$e wor?ing re*ations$i,s a-ong t$e co-,onents of a s0steSoftware arc$itecture< a*so described as strategic design< is an acti"it0 concerned wit$ g*oba* re@uire-ents go"erning how a so*ution is i-,*e-ented suc$ as ,rogra--ing ,aradig-s< arc$itectura* st0*es< co-,onent-based software engineering standards< arc$itectura* ,atterns< securit0< sca*e< integration< and *aw-go"erned regu*arities Aunctiona* design< a*so described as tactica* design< is an acti"it0 concerned wit$ *oca* re@uire-ents go"erning what a so*ution does suc$ as a*gorit$-s< design ,atterns< ,rogra--ing idio-s< refactorings< and *ow-*e"e* i-,*e-entation >ccording to t$e !ntensionF.oca*it0 ;0,ot$esis<J)W t$e distinction between arc$itectura* and detai*ed design is defined b0 t$e .oca*it0 Criterion<J)W according to w$ic$ a state-ent about software design is non-*oca* (arc$itectura*) if and on*0 if a ,rogra- t$at satisfies it can be e1,anded into a ,rogra- w$ic$ does not Aor e1a-,*e< t$e c*ientCser"er st0*e is arc$itectura* (strategic) because a ,rogra- t$at is bui*t on t$is ,rinci,*e can be e1,anded into a ,rogra- w$ic$ is not c*ientCser"erG for e1a-,*e< b0 adding ,eer-to-,eer nodes >rc$itecture is design but not a** design is arc$itectura* J1W !n ,ractice< t$e arc$itect is t$e one w$o draws t$e *ine between software arc$itecture (arc$itectura* design) and detai*ed design (nonarc$itectura* design) #$ere aren4t ru*es or guide*ines t$at fit a** cases E1a-,*es of ru*es or $euristics t$at arc$itects (or organiDations) can estab*is$ w$en t$e0 want to distinguis$ between arc$itecture and detai*ed design inc*ude: >rc$itecture is dri"en b0 non-functiona* re@uire-ents< w$i*e functiona* design is dri"en b0 functiona* re@uire-ents %seudo-code be*ongs in t$e detai*ed design docu-ent =/. co-,onent< de,*o0-ent< and ,ac?age diagra-s genera**0 a,,ear in software arc$itecture docu-entsG =/. c*ass< object< and be$a"ior diagra-s a,,ear in detai*ed functiona* design docu-ents

E0a,+les of arc$itectural st/les and +atterns


#$ere are -an0 co--on wa0s of designing co-,uter software -odu*es and t$eir co--unications< a-ong t$e-: +*ac?board C*ientCser"er -ode* (2-tier< n-tier< %eer-to-,eer< c*oud co-,uting a** use t$is -ode*) 8atabase-centric arc$itecture (broad di"ision can be -ade for ,rogra-s w$ic$ $a"e database at its center and a,,*ications w$ic$ don4t $a"e to re*0 on databases< E g des?to, a,,*ication ,rogra-s< uti*it0 ,rogra-s etc ) 8istributed co-,uting E"ent-dri"en arc$itecture (!-,*icit in"ocation) Aront end and bac? end /ono*it$ic a,,*ication - 22( -

Course Notes: %eer-to-,eer %i,es and fi*ters %*ug-in (co-,uting) 5e,resentationa* State #ransfer 5u*e e"a*uation Searc$-oriented arc$itecture Ser"ice-oriented arc$itecture (> ,ure SO> i-,*e-ents a ser"ice for e"er0 data access ,oint ) S$ared not$ing arc$itecture Software co-,onentr0 S,ace based arc$itecture Structured (/odu*e-based but usua**0 -ono*it$ic wit$in -odu*es) #$ree-tier -ode* (>n arc$itecture wit$ %resentation< +usiness .ogic and 8atabase tiers)

- 222 -

Das könnte Ihnen auch gefallen