eece443 assignment 7 sdp - wordpress.com€¦ · complexity made simple march 2013 philippe...

19
Complexity made simple March 2013 Philippe Kruchten 1 Complexity Made Simple Tackling Complexity in So?ware Intensive Systems Philippe Kruchten Lockheed MarEn, March 14, 2013 Philippe Kruchten, Ph.D., P.Eng., CSDP Professor of So)ware Engineering NSERC Chair in Design Engineering Department of Electrical and Computer Engineering University of BriEsh Columbia Vancouver, BC Canada [email protected] Founder and president Kruchten Engineering Services Ltd Vancouver, BC Canada [email protected] 2

Upload: others

Post on 05-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   1  

Complexity  Made  Simple  Tackling  Complexity  in  So?ware-­‐

Intensive  Systems  

Philippe  Kruchten  

Lockheed  MarEn,  March  14,  2013  

Philippe  Kruchten,  Ph.D.,  P.Eng.,  CSDP  

Professor  of  So)ware  Engineering  NSERC  Chair  in  Design  Engineering  Department  of  Electrical  and  Computer  Engineering  

University  of  BriEsh  Columbia  Vancouver,  BC  Canada  [email protected]          Founder  and  president  Kruchten  Engineering  Services  Ltd  Vancouver,  BC  Canada    [email protected]    

2

Page 2: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   2  

Complexity  Made  Simple  Philippe  Kruchten  

 This  presentaEon  was  prepared  with  

contribuEons  from  Dr.  Rick  Kazman,  from  the  SEI  and  the  University  of  Hawai’i  

 

3  March  2013  

 “Complexity  is  the  enemy  of  computer  science,  and  it  behooves  us,  as  designers,  to  minimize  it.”                Charles  Thacker,  CACM,  July  2010.        “The  task  of  the  so?ware  development  team  is  to  engineer  the  illusion  of  simplicity.”            Grady  Booch,  OOAD  Book,  1994  

March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten   6  

Page 3: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   3  

March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten   12  

Complexity  •  What  make  a  system  complex?  – Scale  •  Many  “things”  

– Diversity  •  Many  different  kinds  of  “things”  

–  InterconnecEvity  •  Many  “things”  connected  to  many  things  in  different  ways  •  Apparent  lack  of  determinism,  predictability  

•  “things”  =  features,  developers,  stakeholders,  users,  classes,  SLoC,  changes,  technologies,….  

Copyright  ©  2005-­‐13  by  Philippe  Kruchten   13  

Source:  McDermid    2000  

March  2013  

Page 4: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   4  

Complexity  (2)  •  Perceived  complexity  vs.  real  complexity  •  Intrinsic  complexity  (<=  nature  of  the  system)  –  Scale,  Diversity,  InterconnecEvity  

•  Extrinsic  complexity  (<=  environment)  –  Embedding  in  organizaEon  –  Embedding  in  other  larger  systems  – Dependencies,  visible  and  hidden  –  Success  (Eme  to  market,  etc.)  – Dependability  – Autonomy  

Copyright  ©  2005-­‐13  by  Philippe  Kruchten   23  

Source:  McDermid    2000  

March  2013  

The  System  The  Community  around  the  system          

Copyright  ©  2005-­‐13  by  Philippe  Kruchten  March  2013   26  

Page 5: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   5  

March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Classifying  Systems  Higher  Technical  Complexity  

   -­‐    Embedded,  real-­‐<me,  distributed,  fault-­‐tolerant      -­‐    Custom,  unprecedented,  architecture  reengineering      -­‐    High  performance  

Lower  Technical  Complexity  -­‐    Mostly  4GL,  or  component-­‐based  -­‐    Applica<on  reengineering  -­‐    Interac<ve  performance  

Higher  Management    Complexity      -­‐  Large  scale      -­‐  Contractual      -­‐  Many  stake  holders      -­‐  “Projects”  

Lower  Management    Complexity      -­‐  Small  scale      -­‐  Informal      -­‐  Single  stakeholder      -­‐  “Products”  

DoD  MIS  System  

DoD  Weapon  System  

Enterprise  IS  (Family  of  IS  ApplicaEons)  

Telecom    Switch  

Case  Tool  (Rose,  SoDA)  

NaEonal  ATC  System  

Commercial  Compiler  

Business  Spreadsheet  

IS  ApplicaEon  Distributed  Objects    

(Order  Entry)  

Small  ScienEfic  SimulaEon  

Large-­‐Scale  OrganizaEon/EnEty  

SimulaEon      

 An  average  so?ware  project:                5-­‐10  people                10-­‐15  month  duraEon                3-­‐5  external  interfaces                Some  unknowns,  risks  

Embedded  AutomoEve    So?ware  

IS  ApplicaEon  GUI/RDB    

(Order  Entry)  

27  

Walker  Royce  1998  

March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Process  Tailoring  Higher  Technical  Complexity  

Lower  Technical  Complexity  

Higher  Management    Complexity    

Lower  Management    Complexity    •   Less  emphasis  on  management  perspecEve  •   More  process  freedom  •   More  emphasis  on  individual  skills  •   More  emphasis  producEon/transiEon  

•   More  emphasis  on  management  perspecEve  •   More  process  formality/ceremony  •   More  emphasis  on  teamwork  and  win/win  •   Longer  IncepEon/elaboraEon  

•   More  emphasis  on  domain  experience  •   Longer  incepEon/elaboraEon  phase  •   More  iteraEons,  risk  management  •   Less  predictable  costs/schedules  

•   More  emphasis  on  exisEng  assets/knowledge  base  •   Shorter  incepEon/elaboraEon  phases    •   Fewer  iteraEons  •   More  predictable  costs/schedules  

28  

Walker  Royce  1998  

Page 6: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   6  

Simplicity      inverse  of  complexity?  

 Parsimony  Uniformity    Predictability  

Copyright  ©  2005-­‐13  by  Philippe  Kruchten  March  2013   32  

     “Make  things  as  simple  as  possible,  but  no  simpler.”    

           Albert  Einstein    

 Occam’s  Razor  or  Lex  parsimoniae:  “EnEa  non  sunt  mulEplicanda  praeter  necessitatem”  

 William  of  Ockham,  14th  century        

Copyright  ©  2005-­‐13  by  Philippe  Kruchten  March  2013   35  

Page 7: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   7  

“…  perfecEon  is  achieved  not  when  there  is  nothing  le?  to  add,  but  when  there  is  nothing  le?  to  take  away.”        Antoine  de  St.  Exupéry,  Terre  des  Hommes,  1939,  chap.3  

Copyright  ©  2005-­‐13  by  Philippe  Kruchten   36  March  2013  

Simplicity  

•  Parsimony  •  Uniformity,  regularity  •  Clear  parEEon  of  concerns  

•  Inverse  of  complexity?  

March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten   37  

Page 8: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   8  

PercepEon  of  simplicity  

•  In  the  eye  of  the  beholder  •  Not  perceived  uniformly  by  all  stakeholders  –  EducaEon,  culture,  frequency  of  interacEon,  etc.  

•  CogniEve  aspects  •  Increased  sense  of  determinism  – Not  chaoEc  system  

•  Simplicity  =  paucity  ?  •  Simplicity  =  limitaEon  ?  •  Simplicity  =  overconstraints  ?  

March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten   38  

Kurtz  Snowden  2003  

Towards  simple  

•  Limit  number  of  (visible)  things  –  Few  technologies,  people,  interfaces,  etc…  

•  Limit  number  of  (visible)  types  of  things  – Harder  

•  Limit  interconnecEons,  dependencies  –  Both  in  numbers  and  in  kinds  

•  Increase  perceived  determinism  –  “if  I  do  this,  this  will  happen”  

•  Engineer  the  illusion  of  simplicity  

March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten   39  

Page 9: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   9  

HeurisEcs  to  Address  Complexity  

•  John  Maeda  has  provided  some  “Laws  of  Simplicity”—heurisEcs  for  managing  complexity  – Reduce:  the  number  of  kinds  of  things  – Hide:  removing  elements  from  select  viewpoints  – Shrink:  expose  a  simplified  view  – Organize:  impose  a  pasern  

•  But  how  do  we  realize  these  heurisEcs?  

40  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

A  “Simple”  Example  

•  The  internet:  – Large  numbers  of  things  – Large  numbers  of  types  of  things  (servers,  routers,  nodes,  protocols,  …)  

– Large  numbers  of  relaEonships  

•  How  have  Maeda’s  heurisEcs  been  applied  to  the  internet?  

41  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Page 10: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   10  

A  “Simple”  Example  -­‐  2  

•  Reduce:  strict  control  on  the  number  of  types  of  things  (managed  by  the  W3C)  

•  Hide:  lower  level  protocols  and  physical  infrastructure  are  all  hidden  

•  Shrink:  Google.com  is  a  shrunk  representaEon  of  millions  of  nodes  

•  Organize:  many  paserns—e.g.  P2P,  client-­‐server,  SOA,  broker—are  used  to  structure  the  internet  

42  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

How  do  we  design  for  complexity?  Architecture  to  the  Rescue!  

 

March  2013   43  Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Page 11: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   11  

System  and  So?ware  Architecture  as  a  parEal  answer  to  complexity  

•  Level  of  abstracEon  •  Divide-­‐and-­‐conquer  approaches  •  Filter  for  “things”  – Technologies,  requirements,  teams,  etc…  

•  Blueprints  for  other  acEviEes    

•  Congruence  (Conway’s  Law)  

March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten   44  

Simplicity,  driven  by  architecture  

•  Parsimony  •  Uniformity,  regularity  •  Clear  parEEon  of  concerns  

•  Right  level  of  abstracEon  •  Modularity,  encapsulaEon  

March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten   45  

Page 12: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   12  

The  System  Architect’s  Toolkit  •  System  architects  have  developed  tools  for  dealing  with  complexity  over  the  decades:  – Knowledge  management:  representaEon,  modeling,  design  methods,  ontologies,  …  

– Design  principles:  modularity,  abstracEon,  separaEon  of  concerns,  …  

– PaRerns:  brokers,  layers,  SOA,  P2P,  …  – TacScs:  building  blocks,  aggregaEon,  interacEon    

•  We  will  focus  on  paserns  and  tacEcs.  46  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Paserns  An  architectural  pasern    –  is  a  package  of  design  decisions  that  is  found  repeatedly  in  pracEce,  

– has  known  properEes  that  permit  reuse,  and    

– describes  a  class  of  architectures.      “I  have  not  failed.  I've  just  found  10,000  ways  that  won't  work.”    -­‐  Thomas  Edison  

47  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Page 13: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   13  

Paserns  

48  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

TacEcs  

An  architectural  tacEc  is  a  design  decision  that  affects  a  quality  asribute  response      Paserns  describe  holisEc  soluEons;  tacEcs  describe  “atomic”  architectural  strategies.    

49  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Page 14: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   14  

A  Pasern:  Hierarchy  

•  Herb  Simon:  “complexity  frequently  takes  the  form  of  hierarchy”  (1962)    – Such  hierarchies  need  to  be  “nearly  decomposable”  

•  The  hierarchy  pasern  aids  in  taming  complexity  by:  –  prevenEng  arbitrary  relaEonships  –  enforcing  selecEve  visibility  –  simplifying  pruning  

50  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

A  Pasern:  P2P  Peer-­‐to-­‐peer  

•  The  largest  complex  systems  are  organized  as  a  set  of  peers  

•  The  peer-­‐to-­‐peer  pasern  aids  in  taming  complexity  by:  –  avoiding  centralized  resources  –  allowing  for  flexible  organizaEon  –  allowing  for  dynamic  reorganizaEon  

51  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Page 15: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   15  

A  Pasern:  CP  Core-­‐Periphery  

•  The  module  structure  of  many  complex  systems  is  bifurcated  into:    1.  a  core  (kernel)  infrastructure,  and    2.  a  set  of  peripheral  funcEons  or  services    

•  The  C-­‐P  pasern  tames  complexity  by  dividing  the  engineering  problem:  –  the  core  provides  lisle  end-­‐user  funcEonality;  it  provides  the  foundaEon  

–  the  majority  of  the  funcEonality  lives  in  the  periphery  

52  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

TacEcs  for  scalability  

53  

Scalability  

Building  blocks   AggregaEon   InteracEon  

Modularity  

Self  descripEon  

Environment  Models  

Self-­‐similar  structure  

Heterogeneity  

Parallelism  

Abstract  ConnecEons  

ConnecEon  Shuffling  

Load  Balancing  

Gossiping  

Tagging  March  2013  

Page 16: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   16  

A  Scalability  TacEc:  Modularity  

•  A  Eme-­‐honored  principle  of  so?ware  engineering    

•  It  has  been  argued  to  support  super-­‐linear  growth  in  so?ware.  

55  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

A  Scalability  TacEc:  Gossiping  

•  Nodes  need  to  interact  to  adapt  to  their  ever-­‐changing  state  and  environment.      

•  Neighboring  nodes  need  to  be  constantly  “gossiping”,  exchanging  topological  and  task-­‐specific  informaEon  .  

56  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Page 17: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   17  

A  Scalability  TacEc:  Self-­‐similar  structure  

•  Complex  systems  must  treat  collecEons  of  enEEes  (and  collecEons  of  collecEons)  similarly  to  individual  agents:  a  fractal  structure.  

•  This  makes  it  easy  for  the  system  to  be  self-­‐configuring  and  self-­‐adapEng.  

57  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

A  Brief  Example:  MANETs  Mobile  Ad  hoc  NETworks  

•  MANETs  (Mobile  Ad  hoc  NETworks)  exhibit  many  of  these  design  approaches:  –  PaKern:  Nodes  are  independent  peers,  operaEng  in  parallel  with  all  others    

–  Tac<c:  Nodes  are  modular:  do  not  expose  internals;  interact  via  a  well-­‐defined  interface  

–  Tac<c:  Nodes  may  be  heterogeneous,  sharing  only  a  common  communicaEon  protocol    to  gossip  

–  Tac<c:  Nodes  may  be  nested  (i.e.,  a  hierarchy).  In  fact,  nodes  exhibit  self-­‐similar  (fractal)  structure.  

58  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Page 18: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   18  

Conclusions  (1)  

•  A  designer  needs  to  reduce,  hide,  shrink,  and  organize  to  be  able  to  tame  complexity.  SomeEmes,  expose.  •  Paserns  and  TacEcs  are  templates  for  achieving  these  goals  in  a  systemaEc  way.  

59  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Conclusions  -­‐  2  With  paserns  and  tacEcs,  a  designer  is  faced  with  a  simpler,  more  constrained  set  of  tasks  than  designing  from  scratch:    1.  choosing  the  set  of  primiEves  to  cover  all  

system  funcEonality,  while  keeping  the  number  of  primiEves  small  

2.  finding  regular,  systemaEc  ways  of  assembling  the  primiEves  into  more  complex  aggregates  

3.  minimizing  the  forms  of  interacEon  between  the  primiEves,  or  aggregates,  and  keeping  these  interacEons  flexible  and  adaptable.    

60  March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten  

Page 19: EECE443 Assignment 7 SDP - WordPress.com€¦ · Complexity made simple March 2013 Philippe Kruchten 2 Complexity Made Simple Philippe Kruchten This presentaEon was prepared with

Complexity  made  simple   March  2013  

Philippe  Kruchten   19  

More  details…  •  Kazman, R., & Kruchten, P. (2012). Design

approaches for taming complexity. Proceedings of the IEEE International Systems Conference (Syscon2012), Vancouver, BC.DOI: 10.1109/SysCon.2012.6189488  #

•  Kruchten, P. (2012). Complexity made simple. Proceeding of the 2012 Canadian Engineering Education Association Conference (CEEA12), Winnipeg, MB.URL: #

March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten   61  

Further  readings  •  McDermid, J. A. (2000). Complexity: concept, causes and control. Paper

presented at the Sixth IEEE International Conference on Engineering of Complex Computer Systems (ICECCS 2000).#

•  Maeda, J. (2006). The laws of simplicity. Cambridge, MA: MIT Press.#•  Cook, R. I. (2000). How complex systems fail. Cognitive Technologies

laboratory, University of Chicago.#•  Kurtz, C. F., & Snowden, D. J. (2003). The new dynamics of strategy:

Sense-making in a complex and complicated world. IBM Systems Journal, 42(3), 462-483. (see also Cynefin framework)#

•  Nielsen, J (1993). Usability Engineering, Morgan Kaufman. (see 10 usability guidelines at: http://www.useit.com/papers/heuristic/heuristic_list.html)#

•  Booch, G. (2004). The illusion of simplicity Available from http://www.ibm.com/developerworks/rational/library/2096.html #

•  Sha, L. (2001). Using Simplicity to Control Complexity. IEEE Software, 18(4), 20-28.#

•  Suh, N.-P. (2005). Complexity in Engineering. Annals of the CIRP, 54(2), 46-63.  

March  2013   Copyright  ©  2005-­‐13  by  Philippe  Kruchten   62