SoftwareArchitecture(707.023)...
Transcript of SoftwareArchitecture(707.023)...
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Quality AttributesSoftware Architecture (707.023)
Roman Kern
KTI, TU Graz
2017-11-15
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 1 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Outline
1 Quality Attributes
2 Runtime QA
3 Non-runtime QA
4 Business QA
5 Non-Functional Concepts
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 2 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Quality AttributesFocus on non-functional requirements.
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 3 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Need to address QAs
Without any need for performance, scalability, ... any implementationof functionality is acceptableHowever, we always need to take into account the broader contextE.g. hardware, technological, organizational, business, ...The functionality must be there but without proper addressing of QA itis worth nothing
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 4 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Influence on QAs
Typically, a single component can not address a QA completelyAny QA is influenced bymultiple components and their interactionsE.g. a UI component has a high degree of usability: however, usabilityof the system is compromised if a data management component haspoor performance in accessing the data→ users need to wait long→poor usabilityComponents and their interactions→ software architectureQAs are directly influenced by software architecture
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 5 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Runtime Quality AttributesQAs that affect the runtime behaviour.
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 6 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
PURS
PURS (performance, usability, reliability, security)Performance: time performance, memory, disk, or network utilizationUsability: human factors, easy to learn, easy to use, ...Reliability: availability, safety, ...Security: authentication, data protection, ...
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 7 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Performance
Time performance is most obviousMeasured in the number of operations per secondAlso, latency: the time from receiving an input and producing anoutputOther measures: memory, disk, network utilization or throughput
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 8 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Performance
Different measures are typically traded off against each otherE.g. increasing throughput may increase latencyTime performancemight be increased with more memoryTrue performance of the system is not only defined by performance ofsingle componentsBut also by their interactions and the overall processes in the system
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 9 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Performance factors
1 Choice of algorithms2 Database design3 Communication4 Resource management
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 10 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Choice of algorithms
Performance of algorithms is typically measured by their complexity(bigO notation)E.g. linear complexity: O(n)Running time increases in direct proportion to the size of the dataE.g. polynomial complexity: O(n2)It does not scale: double size of the data - running time increased byfactor of 4→ “friendly” runtime complexities:Realistic goal: O(nlog(n))(typically, only theoretically achievable: O(n),O(1))However,O does only describe one aspect of the performance (worstcase behaviour vs. typical behaviour)
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 11 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Database design
Performance of database queries can dominate the overallperformanceThe design of the tables has enormous impact on the overallperformanceTechniques to improve it: lazy evaluation, replication, cachingSome additional cost to manage replication and/or cachingIn-memory databases (real-time systems)Developing a new database (search engines)
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 12 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Communication
Network overheadPackage data according to a protocol, sending data over networkEach layer means additional overheadThink how to use network: packaging binary data as XML!?Use more compact formats, e.g. JSON vs XML
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 13 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Resources management
Overloaded components need to be avoidedA chain is only as strong as its weakest link!E.g. a single-threaded shared resource is in use: all other threads areblockedVery difficult to track down
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 14 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Performance Tactics
Generate a response to an event within some time-based constraintTwo basic contributors to response time:
▶ Processing time (e.g. computation)▶ Blocking time (e.g. waiting for other components, resources)
Tactics:1 Control resource demand - reduce demand on resources2 Manage resources - work more efficiently
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 15 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Performance Tactics - Control Resource Demand
Increase performance bymanage the demand for resources:Manage the sample rate - reduce the number of events beinggeneratedLimit event response - use queueing systems (in the worst case, throwaway events if queue is full)Prioritize events - ignore low-priority eventsIncrease resource efficiency - invest time to improve algorithmsReduce overhead - e.g. merge components to reduce latency→negative effect onmodifiabilityBound execution times - sacrifice accuracy to achieve higherperformance, e.g. using faster algorithms that just approximate thecorrect behaviour
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 16 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Performance Tactics - Manage Resources
Increase performance bymanage resources:Increase resources - faster processors, additional memory, ... (scalevertically)Introduce concurrency - parallel computingMaintain multiple copies of computations - more than onemachine forcomputations (scale horizontally)Maintain multiple copies of data - caches for faster data accessBound queue size - control the number of incoming eventsSchedule resources - introduce scheduling for resources (e.g.priorities)
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 17 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Usability
Usability is a very rich fieldIf usability is important you will need a usability expertCombination of many factors: responsiveness, graphical design, userexpectations, confidenceMeasuring with time taken to complete task, error rate, time toresponse, ...
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 18 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Responsiveness and data availability
An example of relations between QAsUsability requires that the system responds to user actions within acertain period of timeIf it is a complex system this need translates into performance alongthe path of the user action
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 19 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Discussion on relations between QAs
If we support security even if it is not neededVery often QAs exercise opposing forces on the systemSecurity requires a lot of checking: performance will suffer→ usabilitywill sufferA minimalistic approach: develop only what is required!
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 20 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Usability Tactics
General advise: separate the user interface... also support modifiabilityTactics:
1 Support user initiative - how easy it is for the user to accomplish a task2 Support system initiative - support of the system for the user
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 21 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Usability Tactics
Support user initiativeCancel - allow the user to cancel long running operationsUndo - prove means to rollback the statePause/resume - control the execution of long running operationsAggregate - prevent micro-management by allowing batch operationsonmultiple objects (e.g. select multiple files)
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 22 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Usability Tactics
Support system initiativeMaintain task model - assess the user’s context to provide assistance(e.g. word completion in a text editor)Maintain user model - system behaviour should match usersexpectations (even allow the user to control the model), e.g. scrollingspeedMaintain systemmodel - monitor the system’s behaviour, e.g. displayprogressbar for long running operations
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 23 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Reliability
In traditional engineering disciplines reliability measures the failurerate of the systemFailure rate specified by mean time to failureMTTFA relatedmeasure: mean time between failuresMTBFMTTR is mean time to repairA is availability
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 24 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Reliability
MTBF = MTTF+ MTTRA = MTTF
MTBF
A = MTTFMTTF+MTTR
E.g. expected (theoretically optimal) availability of productionsystems:
1 (always up-and-running)=⇒ MTTF→ ∞
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 25 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Reliability
MTBF = MTTF+ MTTRA = MTTF
MTBF
A = MTTFMTTF+MTTR
E.g. expected (theoretically optimal) availability of productionsystems: 1 (always up-and-running)=⇒ MTTF→ ∞
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 25 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Reliability
Increasing reliability involves testingHowever, impossible to prove that a system is correct, i.e. withoutbugsAcceptability of errors depends on the nature of a systemPersonal desktop use: bugs are typically toleratedEnterprise level: medium reliability levelHigh-reliable systems: bugs can be fatalFailure analysis: combine the probability of a failure with its effect
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 26 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Reliability Tactics
Use higher level programming languagesUse existing proven componentsTactics:
1 Detect faults - identify non-working components2 Recover from faults - what to do in case of faults3 Prevent faults - how to increase availability
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 27 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Reliability Tactics
Detect faultsMonitor - explicit component to monitor the systemPing/echo - test the reachability of components by asynchronous testmessagesHeartbeat - fault detection mechanism by periodic messagesTime stamp - detect incorrect sequence of messagesSanity checking - check the validity of messagesCondition monitoring - e.g. checksums for messagesVoting - e.g. three systems do the same thing to detect inconsistenciesException detection - e.g. CPU register for division by zero, read accessto uninitialised memorySelf-test - deliberate health checks by the components themselves
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 28 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Reliability Tactics
Recover from faultsActive redundancy - identical system running a backup, instantaneousup-to-date (hot spare)Passive redundancy - identical system running a backup, periodicupdates (warm spare)Spare - backup system needs to be started in case of fault (cold spare)Exception handling - how to deal with exceptional behaviourRollback - go back to an older (good) system stateSoftware upgrade - patch the system (or sub-systems)Retry - repeat failed actionIgnore faulty behaviour - only, if the error messages are spuriousDegradation - explicit state of reduced functionalityReconfiguration - reassign jobs to unaffected components
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 29 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Reliability Tactics
Prevent faultsRemoval from service - take components off-line to prevent (or restart)Transactions - prevent race conditions by clear transaction semanticsPredictive model - state of the health of a systemException prevention - e.g. smart pointers (specialised data structure)Increase competence set - improve components to deal withexceptional states
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 30 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Security
Increasingly important aspect of systems is securityBecause systems are exposed to threatsEspecially networked systemsAs with other QAs security is a set of related responses to user needs
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 31 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Authentication
Requirement for identification of users with a systemUsers present credentials so that the system can identify themTypically username and passwordOther forms: certificates, smart cards, biometric features
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 32 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Authorization
After authentication authorization which functions and what data isavailable for usersThis information is captured in an authorization modelAccess control lists (ACL) define who can access and how a resourcemight be accessedE.g. read access, write access, delete access, ...
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 33 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Authorization
Drawbacks of ACLsIt is resource based, e.g. a page in a CMSOften, authorization needs to address functions or tasksAlso, managing of ACLs is difficult, e.g. subresources of resourcesAlso, performance problems with checking
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 34 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Authorization
Another model: role-based access control (RBAC)Roles are used to managemany-to-many relations between users andpermissionsRoles are used to represent the job functions, e.g. author, teacher,student in an E-learning systemPermissions are modelled as parts of roles, e.g. create page, createtests, ...Users are than assigned to a role and acquire automaticallypermissions of that role
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 35 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Security Tactics
Tactics:1 Resist attacks - prevent attacks before they happen2 Detect attacks - identify ongoing attacks3 React to attacks - response in case of attack4 Recover from attacks - actions taken after an attack
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 36 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Security Tactics
Resist attacksIdentify actors - identify the source of an external inputAuthenticate actorsAuthorize actorsLimit access - restrict access to resources, e.g. firewallsLimit exposure - restrict the number of access points of the systemEncrypt data - protect the communicationSeparate entities - have components on different machines (or virtualmachines)Change default settings - force users to change the default settings of asystem
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 37 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Security Tactics
Detect attacksDetect intrusion - e.g. monitor network traffic and identify maliciousbehaviourDetect service denial - e.g. compare service requests pattern withknown denial-of-service attacksVerify message integrity - e.g. checksums, hash valuesDetect message delays - e.g. monitor time to deliver messages
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 38 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Security Tactics
React to attacksRevoke access - restrict access to potentially compromised resourcesLock account - e.g. repeated failed logins as a trigger to lock anaccountInform actors - means to notify relevant actors, e.g. mail to sysadmin
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 39 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Security Tactics
Recover from attacksRestore - rollback the system (and its data) to a known state (prior tothe intrusion)Audit trail - keep a record of user and system actions to allowcomputer forensics
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 40 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Non-runtime Quality AttributesQA not related to runtime behaviour.
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 41 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
MeTRiCS
MeTRiCS (maintainability, evolvability, testability, reusability,integrability, configurability, scalability)Maintainability: how easy can you fix bugs and add new featuresEvolvability: how easy your system copes with changesTestability: how easy can you test the system for correctness
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 42 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
MeTRiCS
Reusability: how easy is to use software elements in other contexts,e.g. a software libraryIntegrability: how easy you canmake the separately developedcomponents of the systemwork correctly togetherConfigurability: how easy can a system be configured for differentinstallations and target groupsScalability: how easy the system copes with a higher performancedemand
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 43 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Maintainability
This QA considers the whole lifecycle of a systemWhat happens during system operation?Property that allows a system to bemodified after deployment witheaseE.g. extensible, modified behaviour, fixing errors
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 44 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Maintainability
At the design and implementation levelCode commentsObject-oriented principles and design rulesConsistent programming stylesDocumentation
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 45 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Maintainability
Maintainability is very important because any software systemwillchange over timeExperience shows that such changes tend to degrade the system overtimeSoftware systems are subject to entropyThe cumulative effect of changes degrades the quality of the system
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 46 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Maintainability
The systems tend to becomemessy systemsRegardless of how a nice plan you had at beginningDesign for change - recollect OO design rulesAbstract messy parts of the system so that they can be exchanged
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 47 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Maintainability
Don’t be afraid to refactor and rewrite and redesignEach software vendor does this with major versionsCreate throw-away prototypesThink out-of-box and innovateDon’t always follow a hype - very often nothing new in hypesE.g. Web services
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 48 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Maintainability Tactics
Tactics:1 Reduce size of components2 Increase cohesion3 Reduce coupling4 Defer binding
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 49 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Maintainability Tactics
Reduce size of componentsSplit component - divide big components into smallersub-components
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 50 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Maintainability Tactics
Increase cohesionIncrease semantic coherence - if a single component has manyresponsibilities then divide this component into multiple, smallercomponents
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 51 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Maintainability Tactics
Reduce couplingEncapsulate - introduce interfaces and APIs, and allow access onlythrough the interfaceUse an intermediary - break dependencies, e.g. by publish-subscribearchitecturesRestrict dependencies - reduce the visibility of components, e.g. n-tierarchitecturesRefactor - avoid duplication by refactoring out common functionalityinto new componentsAbstract common services - for similar, but not identical functionality,build a more general, abstract components
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 52 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Maintainability Tactics
Defer bindingParameters - plan components with built in flexibility to anticipatefuture changes and feature requests
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 53 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Testability
Means to improve testabilityTest cases: if something fails there is a bugSeparation of the testing framework and the system, i.e. testing withscripts from outsideLogging
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 54 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Testability Tactics
Tactics:1 Control and observe system state - make testing easier2 Limit complexity - complex systems are harder to test, thus make them
simpler
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 55 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Testability Tactics
Control and observe system stateSpecialised interfaces - additional testing interfaces (e.g. enableverbose output, set state)Record/playback - means to track in internal stateLocalise state storage - store a specific system stateAbstract data sources - e.g. mock object data access instead a “real”databaseSandbox - e.g. by virtualisationExecutable assertions - pre/post conditions with documentation
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 56 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Testability Tactics
Limit complexityLimit structural complexity - remove dependencies, reduce couplingLimit non-determinism - limit behaviour complexity by identifyingsources of non-determinism (e.g. unconstrained parallelism)
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 57 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Configurability
Ability of a system to vary its operational parameters withoutre-compiling or re-installingE.g. selecting appropriate database drivers, configuring networkparameters, ...Typically, realized by a set of configuration filesE.g. Apache Web server configuration file sets host name, virtual hosts,...
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 58 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Configurability
Configurability interacts with other QAs such as testability,maintainability, reliabilityHigh degree of configurability tends to have a negative impact onthose QAsTesting of different system configuration becomesmore difficult→reliability compromisedConfigurable components will be strongly parametrized→ decreasedmaintainability
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 59 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Scalability
Ability of a system to increase its capacity without re-compiling orre-installingE.g. serving additional Web pages means only copying these Webpages into a Web server file systemSometimes increasing capacity means increasing hardware, e.g. Webserver clustersManaging user session on the client side, means only providingadditional code-on-demand from the server
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 60 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Business Quality AttributesQAs focused on the business quality goals.
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 61 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Overview
Two types of business quality attributesRelated to costs and scheduleRelated to marketing
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 62 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Overview
Time tomarketTime it takes to ship the (finished) productHighly depends on already existing components... relates to reusability... and the selection of the infrastructure components
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 63 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Overview
CostsThe budget to develop the systemArchitecture plays an important role in the actual costs
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 64 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Overview
Lifetime of projectThe type of the project plays an important (business) roleProject, that does not need to bemaintained afterwardsProducts, which are planned to bemaintained
▶ Multiple releases in the future▶ ... will require an architecture more focused on evolvability
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 65 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Overview
Market and target usersFor the mass market vs. niche marketsExpectations will be different for eachmarket (e.g. level of usability)... need to take this into account
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 66 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Overview
Integration with other/legacy systemsWhat is the expected infrastructure?Which other components/systems will be present... need to integrate interfaces to these systems
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 67 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Non-Functional ConceptsImplications of cross-cutting concerns.
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 68 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Functionality Shared between Software Components
Requirements not covered by individual componentsInstead requirements needed to be addressed by each componentOr constraints imposed on each component⇒ Cross-cutting concerns
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 69 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Examples for Cross-Cutting Concerns
LoggingAuditingMonitoringException/error handlingSecurity (e.g. authentication, authorisation)CachingLocalisationConfiguration management
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 70 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Cross-Cutting Functionality Implications
Why are cross-cutting aspects a problem?They do need to be consistently used/implemented by all componentsSome components might not allow thisIf the cross-cutting functionality need to be adapted, all componentsneed to bemodifiedE.g. changes due to new security constraints require all components tobe inspected
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 71 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Cross-Cutting Concerns on the Implementation Level
Cross-cutting concerns also exist on the implementation levelAddressed by aspect oriented programmingAspects are factored out andmoved away from the functionalityE.g. logging is done in a separate module and at runtime injected intothe method calls
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 72 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Cross-Cutting Concerns on the SA Level
Keep cross-cutting functionality in separate components (is possible)E.g. dedicated component for authentication/authorisationUse/develop components that allowmodificationsE.g. Interceptor architectural pattern
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 73 / 74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
The EndNext: Service architectures
Roman Kern (KTI, TU Graz) Quality Attributes 2017-11-15 74 / 74