software engineering cs2301
TRANSCRIPT
-
8/12/2019 software engineering cs2301
1/26
Unit-III
Design Concepts and PrinciplesDesign Concepts:
1. Abstraction:
It concentrate on the essential features and ignore details that are not relevant
Procedural abstraction = a named sequence of instructions that has a specific & limited
function e.g. Open (for the door)
Data abstraction= a named collection of data that describes a data object e.g. Door
Control abstraction= implies a program control mechanisms without specif internal
details
2. Software architecture
It defines overall structure of the software components and the was in which that structure
provides conceptual integrit for a sstem. Patterns
! design pattern defines a design structure that solves a particular design problem within
a specific conte"t and aimed #forces$ that ma have an impact on the manner in which thepattern is applied and used.
%ach design pattern must determine the following
'hether the pattern applicable to the current wor
'hether the pattern can be reused.
'hether the pattern can serve as a guide for developing a similar but
functionalit or structurall different pattern.
!. Infor"ation #iding:
Information (data and procedure) contained within a module is inaccessible to modulesthat have no need for such information
$. %efine"ent:
*rocess of elaboration where the designer provides successivel more detail for each
design component.
&.'odularit(+he software is divided into separatel named and addressable components sometimes
called modularit.
+here are , criteria to evaluate design method with effective modular design
-odular decomposabilit provides sstematic means for breaing problem into
sub problems
-odular composabilit supports reuse of e"isting modules in new sstems
-odular understandabilit module can be understood as a standalone unit
-odular continuit sideeffects due to module changes minimi/ed
-odular protection sideeffects due to processing errors minimi/ed
). *unctional Independence:
+he functional independence is achieved b developing the functional modules with
single minded approach.
!njalai !mmal -ahalingam %ngineering 0ollege
Department of 0omputer 1cience and %ngineering
-
8/12/2019 software engineering cs2301
2/26
Cohesion:
2unctional strength of the module.
! cohesive module perform a single tas. 3ow tightl bound or related 4a
module5s6 internal elements are to one another.
Coincidental: module performs unrelated functions #bad$ +ogical: module performs functions that are related onl logicall
,e"poral: module performs more than one function but the all happen within awelldefined time span.
Procedural: module performs more than one function but the all do functions
that are related
Co""unicational: module performs more than one function but the are all onthe same bod of data.
*unctional :
Coupling:
+he degree of interdependence between modules.
Content coupling: modules can directl refer to the contents of each other.
Co""on coupling: modules communicate via global data.
Control coupling: modules communicate b data that allows one module to
directl affect the behavior of the other.
Sta"p coupling: modules communicate b a heterogeneous set of items not allof which are used.
Data coupling: modules communicate b parameters where each parameter is a
single item or a homogeneous set that incorporate no control element.
o coupling: there is no relationship.
. %efactoring:
7efactoring is a reorgani/ation technique that simplifies the design(or code) of a componentwithout changing its function or behavior.
/. Data structure:
7epresentation of the logical relationship among individual data elements (requires at
least as much attention as algorithm design)
10. Software procedure:
*recise specification of processing (event sequences decision points repetitive
operations data organi/ation8structure)
11. Design Classes:
User interface classes9 define abstractions necessar for 30I.
usiness do"ain classes9 refinements of analsis classes.
Process classes9 lowerlevel business abstractions that manage business domain classes. Persistent classes9 data stores (databases) that persist beond e"ecution of the software
S(ste" classes9 management and control functions that enable the sstem to operateand communicate within its computing environment and with the outside world.
Design Process:
Design *rocess is a sequence of activities to develop the software design product.
Design uidelines:
-
8/12/2019 software engineering cs2301
3/26
! design should e"hibit good architectural structure
! design should be modular
! design should contain distinct representations of data architecture interfaces and
components (modules)
! design should lead to data structures that are appropriate for the objects to be
implemented and be drawn from recogni/able design patterns ! design should lead to components that e"hibit independent functional characteristics
! design should lead to interfaces that reduce the comple"it of connections between
modules and with the e"ternal environment.
! design should be derived using a reputable method that is driven b information
obtained during software requirements analsis.
Design Principles:
+he design process should not suffer from tunnel vision
+he design should be traceable to the analsis model
+he design should not reinvent the wheel
+he design should minimi/e intellectual distance between the software and the problem
as it e"ists in the real world
+he design should e"hibit uniformit and integration
+he design should be structured to accommodate change
+he design should be structured to degrade gentl even with bad data events or
operating conditions are encountered
+he design should be assessed for qualit as it is being created
+he design should be reviewed to minimi/e conceptual (semantic) errors.
Design #euristics for 3ffecti4e 'odularit(:
%valuate the first iteration of the program structure to reduce coupling and improve
cohesion.
!ttempt to minimi/e structures with high fanout: strive for fanin as structure depthincreases.
;eep the scope of effect of a module within the scope of control for that module.
%valuate module interfaces to reduce comple"it reduce redundanc and improve
consistenc.
Define modules whose function is predictable and not overl restrictive (e.g. a module
that onl implements a single sub function).
1trive for controlled entr modules avoid pathological connection (e.g. branches into themiddle of another module)
Design 'odel:
-
8/12/2019 software engineering cs2301
4/26
Data Design 3le"ents:
Data design creates a model of data that is represented at a high level of
abstraction
7efined progressivel to more implementationspecific representation for
processing b the computer base sstem +ranslation of data model into a data base is pivotal to achieving business
objective of a sstem
!t Progra" co"ponent le4el-< data structures and associated algorithms are
designed.
!t application le4el< +ranslation of data model into a data base is pivotal to
achieving business objective of a sstem
!t business le4el-< transformation of database into data warehouse.
Architectural Design 3le"ents:
!rchitectural design is equivalent to the floor plan of the house.
Derived from three sources
() Information about the application domain of the software
(>) !nalsis model such as dataflow diagrams or analsis classes.
(?) !rchitectural pattern and stles
Interface Design ele"ents:
1et of detailed drawings constituting
() @ser interface
(>) %"ternal interfaces to other sstems devices etc
(?) Internal interfaces between various components
Co"ponent le4el design ele"ents:
2ull describe the internal details of each software component
%.g. wiring plumbing within each room
@-A diagram can be used
-
8/12/2019 software engineering cs2301
5/26
-
8/12/2019 software engineering cs2301
6/26
'odels for Architectural Design:
#ori7ontal Partitioning:
It defines separate branches of the modular hierarch for each major program function Defines ? partition = Input *rocess Output
enefits:
eas to test software
eas to maintain software
Drawbac8s:
causes more data to be passed
across module interfaces complicate overall
control of program flow
9ertical Partitioning:
control (decision maing) & wor should be distributed +opDown in program structure
top level modules 9 do control function
low level modules 9 do the wors( input computation output tass ) ! change in control module will affect the subordinates.
! change in worer module will less liel effect others.
7epresentation of the logical relationship among individual elements of data.
-
8/12/2019 software engineering cs2301
7/26
enefits:
%as to maintain the changes.
7educe the change impact and error propagation.
Data Design:
+ransforming the analsis information model (data dictionar and %7D) into data
structures required to implement the software.
Data Design at architectural +e4el:
Data Design at Co"ponent +e4el:
. +he sstematic analsis principles applied to function and behavior should also beapplied to data.
>. !ll data structures and the operations to be performed on each should be identified.
?. ! data dictionar should be established and used to define both data and program design.
-
8/12/2019 software engineering cs2301
8/26
B. Aow level data design decisions should be deferred until late in the design process.
,. +he representation of data structure should be nown onl to those modules that must
mae direct use of the data contained within the structure.C. ! librar of useful data structures and the operations that ma be applied to them should
be developed.
. ! software design and programming language should support the specification andreali/ation of abstract data tpes.
Architectural St(les:
%ach stle describes a sstem categor that encompasses() ! set of components (database, clients, servers and filters)
(>) ! set of connectorsthat enables #communication and coordination(call event
broadcasting pipes)(?) Constraintsthat define how components can be integrated to form the sstem
(B Semantic modelsto understand the overall properties of a sstem
Data Centered Architecture:
! data store (e.g. a file or database) resides at the center of this architecture and is
accessed frequentl b other components that update add delete or otherwise modifdata within the store.
It promotes integrabilit.
Data *low Architecture:
1hows the flow of input data its computational components and output data
1tructure is also called pipe and 2ilter
*ipe provides path for flow of data
2ilters manipulate data and wor independent of its neighboring filter
-
8/12/2019 software engineering cs2301
9/26
Call and %eturn Architecture:
!chieves a structure that is eas to modif and scale
+wo sub stles
() -ain program8sub program architecture
0lassic program structure
-ain program invoes a number of components which in turn invoe still othercomponents
(>) 7emote procedure call architecture
0omponents of main program8subprogram are distributed across computers over
networ
;b
-
8/12/2019 software engineering cs2301
10/26
+a(ered Architecture:
! number of different laers are defined
Inner Aaer( interface with O1)
Intermediate Aaer @tilit services and application function)
Outer Aaer (@ser interface)
Architectural Design:
+he architectural design begins with representing the sstem in the conte"t i.e. definingthe e"ternal entities.
Once all e"ternal software has been described the designer specifies the structure of the
sstem b defining and refining software components.
%epresenting the s(ste" in the conte=t:
-
8/12/2019 software engineering cs2301
11/26
*ig: Architectural Conte=t Diagra" for Safe #o"e Securit( S(ste
Defining Archet(pes:
-
8/12/2019 software engineering cs2301
12/26
*ig: Arche,(pe for Safe #o"e Securit( S(ste"
%efining the Architecture into Co"ponents:
-
8/12/2019 software engineering cs2301
13/26
,ransfor" 'apping:
,ransfor" *low:
Data coming from e"ternal forms must be converted into an internal form for processing.
Design Steps for ,ransfor" 'apping:
7eview the fundamental sstem model to identif the information flow.
7eview and refine the data flow diagrams for the software.
Determine if the D2D has the transform or transaction flow characteristics.
Isolate the transform centre b specifing incoming and outgoing flow
boundaries.
*erform first level factoring.
*erform second level factoring.
7efine the firstiteration architecture using design heuristics for improved
software qualit.
,ransaction 'apping:
,ransaction *low:
Information flow is characteri/ed b a single data item called a transaction that triggers
other data flow along one of man paths.
Design Steps for ,ransaction 'apping:
7eview the fundamental sstem model to identif the information flow.
7eview and refine the data flow diagrams for the software.
Determine if the D2D has the transform or transaction flow characteristics.
Identif the transaction centre and flow characteristics along each of the action
paths.
-ap D2D into transaction processing structure
-
8/12/2019 software engineering cs2301
14/26
2actor and refine the transaction structure and structure of each action path.
7efine the firstiteration architecture using design heuristics for improved
software qualit.
User Interface Design Principles:
Define interaction modes in a wa that does not force a user into unnecessar or
undesired actions.
*rovide for fle"ible interaction.
!llow user interaction to be interruptible and undoable.
1treamline interaction as sill levels advance and allow the interaction to be customi/ed.
3ide technical internals from the casual user.
Design for direct interaction with objects that appear on the screen.
'hiledesigning the user interface the capabilit need and e"perience of sstem
user should be considered.
User *a"iliarit(: Instead of using computer terminolog mae use of user oriented
terminologies.
Consistenc(: +he appropriate level of consistenc should be maintained in the user
interface.
'ini"al Surprise:+he commands should operate in a nown wa.
%eco4erabilit(:+he sstem should provide a recovering facilit to user from his errors
so that user can correct those errors.
User uidance: +he user interface can be effectivel used b a novice user if some user
guidance such as help sstems online manuals etc.
%eal ,i"e S(ste"s:
! realtime sstem is a software sstem where the correct functioning of the sstem
depends on the results produced b the sstem and the time at which these results are produced.
Soft%eal ,i"e S(ste":-! Esoft5 realtime sstem is a sstem whose operationis degraded if results are not produced according to the specified timing requirements
#ard %eal ,i"e S(ste" ! Ehard5 realtime sstem is a sstem whose operationis incorrect if results are not produced according to the timing specification.
%eal ,i"e Software Design:
1timulus8response sstemFiven a stimulus the sstem must produce a response within aspecified time. +here are two tpes
Periodic sti"uli 1timuli which occur at predictable time intervals
G 2or e"ample a temperature sensor ma be polled H times per second
Aperiodic sti"uli:1timuli which occur at unpredictable timesG 2or e"ample a sstem power failure ma trigger an interrupt which must be
processed b the sstem
-
8/12/2019 software engineering cs2301
15/26
%eal ,i"e S(ste" Design:
Design both the hardware and the software associated with sstem. *artition functions toeither hardware or software
Design decisions should be made on the basis on nonfunctional sstem requirements
3ardware delivers better performance but potentiall longer development and less scope
for 0hange %eal ,i"e S(ste" Design Process:
. Identif the stimuli to be processed and the required responses to these stimuli
>. 2or each stimulus and response identif the timing constraints?. !ggregate the stimulus and response processing into concurrent processes. !
process ma be associated with each class of stimulus and response
B. Design algorithms to process each class of stimulus and response. +hese mustmeet the given timing requirements
,. Design a scheduling sstem which will ensure that processes are started in time to
meet their deadlines
C. Integrate using a realtime e"ecutive or operating 1stem
,i"ing constraints: -a require e"tensive simulation and e"periment to ensure that these are met b the
sstem
-a mean that certain design strategies such as objectoriented design cannot be used
because of the additional overhead involved
-a mean that lowlevel programming language features have to be used forperformance reasons
%eal ,i"e S(ste" 'odeling:
7eal +ime sstems have to respond to events occurring at irregular intervals.
+he effect of a stimulus in a realtime sstem ma trigger a transition from one state
to another.
2inite state machines can be used for modeling realtime sstems.
+he @-A includes notations for defining state machine models
-
8/12/2019 software engineering cs2301
16/26
Full power
Enabled
do: operateoven
Fullpower
Halfpower
Halfpower
Fullpower
Number
TimerDooropen
Doorclosed
Doorclosed
Systemfault
Start
do: set power = 600
Half power
do: set power = 300
Set time
do: get numberexit: set time
Disabled
Operation
Timer
Cancel
Waiting
do: display time
Waiting
do: display time
do: display 'Ready'
do: display 'Waiting'
%eal ti"e Progra""ing:
3ardreal time sstems ma have to programmed in assembl language to ensure that
deadlines are met
Aanguages such as 0 allow efficient programs to be written but do not have constructs tosupport concurrenc or shared resource management
!da as a language designed to support realtime sstems design so includes a general
purpose concurrenc mechanism
>a4a as a %eal ti"e s(ste":
ava supports lightweight concurrenc (threads and snchroni/ed methods) and can beused for some soft realtime sstems
ava >.H is not suitable for hard 7+ programming or programming where precise control
of timing is required. +he reasons are
G Jot possible to specif thread e"ecution timeG @ncontrollable garbage collection
G Jot possible to discover queue si/es for shared resources
G Kariable virtual machine implementationG Jot possible to do space or timing analsis
%eal ,i"e 3=ecuti4es:
7ealtime e"ecutives are speciali/ed operating sstems which manage the processes in
the 7+1 7esponsible for process management and resource (processor and memor) allocation
-a be based on a standard 7+% ernel which is used unchanged or modified for a
particular application
Does not include facilities such as file -anagement
,he e=ecuti4e co"ponents are:
%eal-ti"e cloc8 *rovides information for process scheduling.
-
8/12/2019 software engineering cs2301
17/26
Interrupt handler -anages aperiodic requests for service.
Scheduler 0hooses the ne"t process to be run.
%esource "anager !llocates memor and processor resources.
Despatcher 1tarts process e"ecution.
Configuration "anager-7esponsible for the dnamic reconfiguration of thesstem software and hardware. 3ardware modules ma be replaced and software
upgraded without stopping the sstems
*ault "anager 7esponsible for detecting software and hardware faults and
taing appropriate actions (e.g. switching to bacup diss) to ensure that the
sstem continues in operation
+he processing of some tpes of stimuli must sometimes tae priorit
Interrupt le4el priorit(-3ighest priorit which is allocated to processes
requiring a ver fast response
Cloc8 le4el priorit(-!llocated to periodic processes
Process resourcerequirements
Scheduler
Schedulinginformation
Resourcemanager
Despatcher
Real-timeclock
Processesawaitingresources
Readylist
Interrupthandler
Availableresource
list
Processorlist
Executingprocess
Readyprocesses
Releasedresources
Process 'anage"ent:
Resource manager
Allocatememoryand processor
Scheduler
Choose processfor execution
Despatcher
Start executionon anavailableprocessor
0oncerned with managing the set of concurrent processes
-
8/12/2019 software engineering cs2301
18/26
*eriodic processes are e"ecuted at prespecified time intervals
+he e"ecutive uses the realtime cloc to determine when to e"ecute a process
*rocess period time between e"ecutions
*rocess deadline the time b which processing must be complete
+he scheduler chooses the ne"t process to be e"ecuted b the processor. +his depends on
a scheduling strateg which ma tae the process priorit into account +he resource manager allocates memor and a processor for the process to be e"ecuted
+he despatcher taes the process from read list loads it onto a processor and startse"ecution
on pre-e"pti4e scheduling
G Once a process has been scheduled for e"ecution it runs to completion or until it
is bloced for some reason (e.g. waiting for I8O)
Pre-e"pti4e scheduling
G +he e"ecution of e"ecuting processes ma be stopped if a higher priorit process
requires service
Scheduling algorith"s
G 7oundrobinG 7ate monotonicG 1hortest deadline first
Data Ac?uisition S(ste":
0ollect data from sensors for subsequent processing and analsis.
Data collection processes and processing processes ma have different periods and
deadlines.
Data collection ma be faster than processing e.g.collecting information about an
e"plosion.
0ircular or ring buffers are a mechanism for smoothing speed differences.
%eactor Data Collector:
DisplayProcessdata
Sensor databuffer
Sensorprocess
Sensoridentifier and
value
Processedflux level
Sensors (each data flowis a sensor value)
Consumerprocess
Producerprocess
-
8/12/2019 software engineering cs2301
19/26
! sstem collects data from a set of sensors monitoring the neutron flu" from a nuclear
reactor.
2lu" data is placed in a ring buffer for later processing.
+he ring buffer is itself implemented as a concurrent process so that the collection and
processing processes ma be snchroni/ed.
'utual 3=clusion:
*roducer processes collect data and add it to the buffer. 0onsumer processes tae data
from the buffer and mae elements available
*roducer and consumer processes must be mutuall e"cluded from accessing the same
element.
+he buffer must stop producer processes adding information to a full buffer andconsumer processes tring to tae information from an empt buffer.
Software Configuration 'anage"ent @SC':
10- identifies organi/es and controls modifications to the software being built b asoftware development team throughout the software process.
eed for SC': +he software configuration management is concerned with managing the changes in the
evolving software. If the changes are not controlled at all then this stream of uncontrolledchange can cause the wellrunning software project into chaos. 3ence it is essential to
identif change control the changes ensure that the changes are properl implemented
and report these changes to others. !nd to carr out these set of activities the softwareconfiguration is essential.
3le"ents of Configuration 'anage"ent S(ste":
Co"ponent ele"ents :-! set of tools coupled with a file management (e.g. database)sstem that enables access to and management of each software configuration item
Process ele"ents:-! collection of procedures and tass that define an effective
approach to change management for all participants
Construction ele"ents:-! set of tools that automate the construction of software b
ensuring that the proper set of valid components (i.e. the correct version) is assembled
#u"an ele"ents:- ! set of tools and process features used b a software team toimplement effective 10-
aselines:
I333 Definition:! specification or product that has been formall reviewed and agreedupon and that thereafter serves as the basis for further development and that can be
changed onl through formal change control procedures
It is a milestone in the development of software and is mared b the deliver of one or
more computer software configuration items (010Is) that have been approved as aconsequence of a formal technical review
aseline Processes:
! series of software engineering tass produces a 010I
+he 010I is reviewed and possibl approved
+he approved 010I is given a new version number and placed in a project database (i.e.
software repositor)
-
8/12/2019 software engineering cs2301
20/26
-
8/12/2019 software engineering cs2301
21/26
+he 10- repositor is the set of mechanisms and data structures that allow a software
team to manage change in an effective manner
+he repositor performs or precipitates the following functions
Dataintegrit(=>Kalidates entries ensures consistenc cascades modifications
Information sharing=
Methodology enforcement=Defines objects in the repositor to guarantee a
standard approach for creation of software engineering documents
SC' *eatures:
9ersioning.
o saves all of these versions to enable effective management of product releases and
to permit developers to go bac to previous versions
Dependenc( trac8ing and change "anage"ent.
o +he repositor manages a wide variet of relationships among the data elements
stored in it.
%e?uire"ents tracing.
o *rovides the abilit to trac all the design and construction components and
deliverables that result from a specific requirement specification
Configuration "anage"ent.
o ;eeps trac of a series of configurations representing specific project milestones
or production releases. Kersion management provides the needed versions and
lin management eeps trac of interdependencies.
Audit trails.
-
8/12/2019 software engineering cs2301
22/26
o %stablishes additional information about when wh and b whom changes are
made.
SC' Process:
+he 10- process defines a series of tass that have four primar objectives. +he are
Identif all items that collectivel define the software configuration
-anage changes to one or more of these items
2acilitate construction of different versions of an application
%nsure the software qualit is maintained as the configuration evolves over time
*rovide information on changes that have occurred
Identification of ;b
-
8/12/2019 software engineering cs2301
23/26
! version control sstem implements or is directl integrated with four major
capabilities
aproject database (repository)that stores all relevant configuration objects
a version managementcapabilit that stores all versions of a configuration object (or
enables an version to be constructed using differences from past versions):
a make facility that enables the software engineer to collect all relevant configuration
objects and construct a specific version of the software.
an issues tracking(also called bug tracking) capabilit that enables the team to record
and trac the status of all outstanding issues associated with each configuration object.
+he 10- repositor maintains a change set
1erves as a collection of all changes made to a baseline configuration
@sed to create a specific version of the software
0aptures all changes to all files in the configuration along with the reason for changes
and details of who made the changes
Change Control:
0hange control is a procedural activit that ensures qualit and consistenc as changes
are made to a configuration object
! change request is submitted to a configuration control authorit which is usuall a
change control board (00M)
+he request is evaluated for technical merit potential side effects overall impact on other
configuration objects and sstem functions and projected cost in terms of mone time
and resources
!n engineering change order (%0O) is issued for each approved change request
Describes the change to be made the constraints to follow and the criteria for review and
audit
+he baselined 010I is obtained from the 10- repositor
-
8/12/2019 software engineering cs2301
24/26
!ccess control governs which software engineers have the authorit to access and modif
a particular configuration object
1nchroni/ation control helps to ensure that parallel changes performed b two different
people donNt overwrite one another.
-
8/12/2019 software engineering cs2301
25/26
Distribute the new 4ersion
Configuration Audit: 0onfiguration auditing is an 1! activit that helps to ensure that qualit is maintained
as changes are made
It complements the formal technical review and is conducted b the 1! group
It addresses the following questions
o 3as the change specified in the %0O been madeP 3ave an additional
modifications been incorporatedP
o 3as a formal technical review been conducted to assess technical correctnessP
o 3as the software process been followed and have software engineering standards
been properl appliedP
o 3as the change been QhighlightedQ and QdocumentedQ in the 010IP 3ave the
change data and change author been specifiedP Do the attributes of the
configuration object reflect the changeP
o 3ave 10- procedures for noting the change recording it and reporting it been
followedP
o 3ave all related 010Is been properl updatedP
! configuration audit ensures that the correct 010Is (b version) have been incorporated
into a specific build that all documentation is uptodate and consistent with the version that has
been built
Status %eporting:
-
8/12/2019 software engineering cs2301
26/26
0onfiguration status reporting (017) is also called status accounting.
*rovides information about each change to those personnel in an organi/ation with a need
to now
!nswers what happened who did it when did it happen and what else will be affectedP
1ources of entries for configuration status reporting. %ach time a 010I is assigned new or
updated information
%ach time a change is approved b the 00M and an %0O is issued. %ach time a
configuration audit is conducted
+he configuration status report. *laced in an online database or on a website for software
developers and maintainers to read
Fiven to management and practitioners to eep them appraised of important changes to
the project 010Is