SE Unit - 4
SE Unit - 4
,NGIT)
Unit 4
Design contd...
Architectural Design
• It depicts
• Software components include program modules and the various data representations that are manipulated
by the program
• The choice of a software architecture highlights early design decisions and provides a mechanism for
considering the benefits of alternative architectures
• Data design translates the data objects defined in the analysis model into data structures that reside in
the software
• A number of different architectural styles are available that encompass a set of component types, a set of
connectors, semantic constraints, and a topological layout
– Identify and refine components within the context of various architectural styles
• Once a software architecture has been derived, it is elaborated and then analyzed against quality criteria
Definitions
• The software architecture of a program or computing system is the structure or structures of the system
which comprise
• Software architectural design represents the structure of the data and program components that are
required to build a computer-based system
• Basic Steps
– Analysis of alternative architectural styles to choose the one best suited to customer requirements
and quality attributes
• A database designer creates the data architecture for a system to represent the data components
• A system architect selects an appropriate architectural style derived during system engineering and software
requirements analysis
– Consider architectural alternatives at a stage when making design changes is still relatively easy
– A program module
– An object-oriented class
– A database
– Middleware
• Representations of software architecture are an enabler for communication between all stakeholders
interested in the development of a computer-based system
• The software architecture highlights early design decisions that will have a profound impact on all software
engineering work that follows and, as important, on the ultimate success of the system as an operational
entity
• The software architecture constitutes a relatively small, intellectually graspable model of how the system is
structured and how its components work together
Data Design
• Data design translates data objects defined as part of the analysis model into
• It focuses on the representation of data structures that are directly accessed by one or more software
components
• The challenge is to store and retrieve the data in such way that useful information can be extracted from the
data environment
• "Data quality is the difference between a data warehouse and a data garbage dump"
• The systematic analysis principles that are applied to function and behavior should also be applied to data
• All data structures and the operations to be performed on each one should be identified
• A mechanism for defining the content of each data object should be established and used to define
both data and the operations applied to it
• Low-level data design decisions should be deferred until late in the design process
• The representation of a data structure should be known only to those modules that must make direct use
of the data contained within the structure
• A library of useful data structures and the operations that may be applied to them should be developed
• A software programming language should support the specification and realization of abstract data types
• The software that is built for computer-based systems exhibit one of many architectural styles
– A set of connectors (subroutine call, remote procedure call, data stream, socket) that enable
communication, coordination, and cooperation among components
– Semantic constraints that define how components can be integrated to form the system
• Characterized by viewing the system as a series of transformations on successive pieces of input data
• Data enters the system and then flows through the components one at a time until they are assigned to
output or a data store
• Pipe-and-filter style
– The filters incrementally transform the data (entering and exiting via streams)
– The filters use little contextual information and retain no state between instantiations
– The pipes are stateless and simply exist to move data between filters
• Advantages
– Has a simplistic design in the limited ways in which the components interact with the environment
– Is easily made into a parallel or distributed execution in order to enhance system performance
• Disadvantages
– Implicitly encourages a batch mentality so interactive applications are difficult to create in this style
– Ordering of filters can be difficult to maintain so the filters cannot cooperatively interact to solve a
problem
• Filters typically force the least common denominator of data representation (usually ASCII
stream)
• Filter may need unlimited buffers if they cannot start producing output until they receive all
of the input
• Each filter operates as a separate process or procedure call, thus incurring overhead in
set- up and take-down time
• Use this style when it makes sense to view your system as one that produces a well-defined easily identified
output
– The output should be a direct result of sequentially transforming a well-defined easily identified
input in a time-independent fashion
Call-and-Return Style
• Has been the dominant architecture since the start of software development
– Typically has a single thread of control that travels through various components in the hierarchy
– Consists of main program and subroutine style of system that is decomposed into parts that
are resident on computers connected via a network
– Strives to increase performance by distributing the computations and taking advantage of multiple
processors
– Emphasizes the bundling of data and how to manipulate and access data
– Keeps the internal data representation hidden and allows access to the object only through provided
operations
• Layered system
– Assigns core functionality such as hardware interfacing or system kernel operations to the lowest
layer
– Builds each successive layer on its predecessor, hiding the lower layer and providing services for
the upper layer
– Is compromised by layer bridging that skips one or more layers to improve runtime performance
• Use this style when the order of computation is fixed, when interfaces are specific, and when components
can make no useful progress while awaiting the results of request to other components
Data-Centered Style
• Refers to systems in which the access and update of a widely accessed data store occur
• At its heart is a centralized data store that communicates with a number of clients
• Clients are relatively independent of each other so they can be added, removed, or changed in functionality
• Use this style when a central issue is the storage, representation, management, and retrieval of a large
amount of related persistent data
• Note that this style becomes client/server if the clients are modeled as independent processes
• Software systems in this style simulate some functionality that is not native to the hardware and/or software
on which it is implemented
– Can simulate and test hardware platforms that have not yet been built
– Can simulate "disaster modes" as in flight simulators or safety-critical systems that would be too
complex, costly, or dangerous to test with the real system
• Interpreters
– Add flexibility through the ability to interrupt and query the program and introduce modifications at
runtime
• Use this style when you have developed a program or some form of computation but have no make of
machine to directly run it on
Independent Component Style
• Sends data between processes but the processes do not directly control each other
– Individual components announce data that they wish to share (publish) with their environment
– The other components may register an interest in this class of data (subscribe)
– Makes use of a message component that manages communication among the other components
– When the data appears, the subscriber is invoked and receives the data
– Decouples component implementation from knowing the names and locations of other components
– The client originates a call to the server which services the request
– Locationally heterogeneous
• The drawing of the architecture reveals different styles in different areas (e.g., a branch of a
call-and-return system may have a shared repository)
– Hierarchically heterogeneous
– Simultaneously heterogeneous
• Two or more architectural styles may both be appropriate descriptions for the style used by
a computer-based system
2) Define archetypes
– The identification and flow of all information into and out of a system
• An ACD models the manner in which software interacts with entities external to its boundaries
– Super-ordinate systems
– Sub-ordinate systems
– Peer-level systems
– Actors
• People or devices that interact with target system to produce or consume data
2. Define Archetypes
• Archetypes indicate the important abstractions within the problem domain (i.e., they model information)
• An archetype is a class or pattern that represents a core abstraction that is critical to the design of an
architecture for the target system
• It is also an abstraction from a class of programs with a common structure and includes class-specific design
strategies and a collection of example program designs and implementations
• Only a relatively small set of archetypes is required in order to design even relatively complex systems
– They may be instantiated in different ways based on the behavior of the system
• The archetypes and their relationships can be illustrated in a UML class diagram
• Based on the archetypes, the architectural designer refines the software architecture into components to
illustrate the overall structure and architectural style of the system
– The application domain provides application components, which are the domain classes in the
analysis model that represent entities in the real world
– The infrastructure domain provides design components (i.e., design classes) that enable application
components but have no business connection
– The interfaces in the ACD imply one or more specialized components that process the data that
flow across the interface
• A UML class diagram can represent the classes of the refined architecture and their relationships
• This demonstrates that the architectural structure, style and components are appropriate
A. Ask a set of questions that provide the designer with an early assessment of design quality and lay the
foundation for more detailed analysis of the architecture
• Does a distinct control hierarchy exist, and if so, what is the role of components within this
control hierarchy?
• What is the control topology (i.e., the geometric form that the control takes)?
• Is the flow of data continuous, or are data objects passed to the system sporadically?
• What is the mode of data transfer (i.e., are data passed from one component to another or are
data available globally to be shared among system components)
• Do data components exist (e.g., a repository or blackboard), and if so, what is their role?
• Are data components passive or active (i.e., does the data component actively interact with other
components in the system)?
1) Collect scenarios representing the system from the user's point of view
2) Elicit requirements, constraints, and environment description to be certain all stakeholder concerns
have been addressed
3) Describe the candidate architectural styles that have been chosen to address the scenarios and
requirements
4) Evaluate quality attributes by considering each attribute in isolation (reliability, performance, security,
maintainability, flexibility, testability, portability, reusability, and interoperability)
5) Identify the sensitivity of quality attributes to various architectural attributes for a specific architectural style
by making small changes in the architecture
6) Critique the application of the candidate architectural styles (from step #3) using the sensitivity analysis
conducted in step #5
• The overall complexity of a software architecture can be assessed by considering the dependencies between
components within the architecture
• These dependencies are driven by the information and control flow within a system
• Represents a dependency relationship among consumers who use the same source or
producer
• Represents constraints on the relative flow of control among a set of activities such as
mutual exclusion between two components
- - - - - - - - - - - - - - -
Component-Level Design
• Component-level design occurs after the first iteration of the architectural design
• It strives to create a design model from the analysis and architectural models
– The translation can open the door to subtle errors that are difficult to find and correct later
– “Effective programmers should not waste their time debugging – they should not introduce bugs to
start with.” Edsgar Dijkstra
• A component-level design can be represented using some intermediate representation (e.g. graphical,
tabular, or text-based) that can be translated into source code
• The design of data structures, interfaces, and algorithms should conform to well-established guidelines to
help us avoid the introduction of errors
– It is a modular, deployable, and replaceable part of a system that encapsulates implementation and
exposes a set of interfaces
– Other components
– An object-oriented view
– A conventional view
– A process-related view
Object-oriented View
• Each problem domain (i.e., analysis) class and infrastructure (i.e., design) class is elaborated to identify all
attributes and operations that apply to its implementation
– This also involves defining the interfaces that enable classes to communicate and collaborate
• This elaboration activity is applied to every component defined as part of the architectural design
– Design the algorithmic detail required to implement the processing logic associated with each
operation
– Design the mechanisms required to implement the interface to include the messaging that
occurs between objects
Conventional View
– The internal data structures that are required to implement the processing logic
– A control component that coordinates the invocation of all other problem domain components
– A problem domain component that implements a complete or partial function that is required by
the customer
– An infrastructure component that is responsible for functions that support the processing required
in the problem domain
• Conventional software components are derived from the data flow diagrams (DFDs) in the analysis model
– Each transform bubble (i.e., module) represented at the lowest levels of the DFD is mapped into
a module hierarchy
– Problem domain components and infrastructure components migrate toward the bottom
– Functional independence is strived for between the transforms
• Once this is completed, the following steps are performed for each transform
– Define the interface for the transform (the order, number and types of the parameters)
– Design the algorithm used by the transform (using a stepwise refinement approach)
Process-related View
• Emphasis is placed on building systems from existing components maintained in a library rather than
creating each component from scratch
• As the software architecture is formulated, components are selected from the library and used to populate
the architecture
• Because the components in the library have been created with reuse in mind, each contains the following:
• Open-closed principle
– A module or component should be open for extension but closed for modification
– The designer should specify the component in a way that allows it to be extended without the
need to make internal code or design modifications to the existing parts of the component
– A component that uses a base class should continue to function properly if a subclass of the
base class is passed to the component instead
– The more a component depends on other concrete components (rather than on the interfaces) the
more difficult it will be to extend
– Many client-specific interfaces are better than one general purpose interface
– For a server class, specialized interfaces should be created to serve major categories of clients
– Only those operations that are relevant to a particular category of clients should be specified in the
interface
Component Packaging Principles
– Group the reusable classes into packages that can be managed, upgraded, and controlled as newer
versions are created
– Classes should be packaged cohesively; they should address the same functional or behavioral area
on the assumption that if one class experiences a change then they all will experience a change
– Classes that are grouped together may go through unnecessary integration and testing when they
have experienced no changes but when other classes in the package have been upgraded
• Components
– Establish naming conventions for components that are specified as part of the architectural model
and then refined and elaborated as part of the component-level model
– Obtain architectural component names from the problem domain and ensure that they have
meaning to all stakeholders who view the architectural model (e.g., Calculator)
– Use infrastructure component names that reflect their implementation-specific meaning (e.g., Stack)
– Model any dependencies from left to right and inheritance from top (base class) to bottom (derived
classes)
– Consider modeling any component dependencies as interfaces rather than representing them as a
direct component-to-component dependency
Cohesion
• It implies that a component or class encapsulates only attributes and operations that are closely related to
one another and to the class or component itself
• The kinds of cohesion can be ranked in order from highest (best) to lowest (worst)
– Functional
• A module performs one and only one computation and then returns a result
– Layer
• A higher layer component accesses the services of a lower layer component
– Communicational
• All operations that access the same data are defined within one class
– Sequential
• Components or operations are grouped in a manner that allows the first to provide input to
the next and so on in order to implement a sequence of operations
– Procedural
– Temporal
• Operations are grouped to perform a specific behavior or establish a certain state such as
program start-up or when an error is detected
– Utility
• Components, classes, or operations are grouped within the same category because of similar
general functions but are otherwise unrelated to each other
Coupling
• As the amount of communication and collaboration increases between operations and classes, the
complexity of the computer-based system also increases
• As complexity rises, the difficulty of implementing, testing, and maintaining software also increases
• Coupling is a qualitative measure of the degree to which operations and classes are connected to
one another
• The kinds of coupling can be ranked in order from lowest (best) to highest (worst)
• Data coupling
• Operation A() passes one or more atomic data operands to operation B(); the less the
number of operands, the lower the level of coupling
• Stamp coupling
• Control coupling
• Operation A() invokes operation B() and passes a control flag to B that directs logical flow
within B()
• Common coupling
• A number of components all make use of a global variable, which can lead to uncontrolled
error propagation and unforeseen side effects
• Content coupling
• One component secretly modifies data that is stored internally in another component
• Component A uses a data type defined in component B, such as for an instance variable or
a local variable declaration
• If/when the type definition changes, every component that declares a variable of that data
type must also change
• External coupling
1) Identify all design classes that correspond to the problem domain as defined in the analysis model and
architectural model
• These classes are usually not present in the analysis or architectural models
• These classes include GUI components, operating system components, data management
components, networking components, etc.
3) Elaborate all design classes that are not acquired as reusable components
• Elaborate attributes and define data types and data structures required to implement them (usually
in the planned implementation language)
• Describe processing flow within each operation in detail by means of pseudocode or UML activity
diagrams
4) Describe persistent data sources (databases and files) and identify the classes required to manage them
• This can be done by elaborating the UML state diagrams created for the analysis model and by
examining all use cases that are relevant to the design class
6) Elaborate deployment diagrams to provide additional implementation detail
• Illustrate the location of key packages or classes of components in a system by using class instances
and designating specific hardware and operating system environments
• Experienced designers consider all (or most) of the alternative design solutions before settling on the
final design model
• The final decision can be made by using established design principles and guidelines
• Each construct has a predictable logical structure where control enters at the top and exits at the bottom,
enabling a maintainer to easily follow the procedural flow
1) List all actions that can be associated with a specific procedure (or module)
2) List all conditions (or decisions made) during execution of the procedure
3) Associate specific sets of conditions with specific actions, eliminating impossible combinations of conditions;
alternatively, develop every possible permutation of conditions
- - - - - - - - - - - - - - -
User Interface Analysis and Design
– The design of interfaces between the software and other nonhuman producers and consumers of
information
• Graphical user interfaces (GUIs) have helped to eliminate many of the most horrific interface problems
• However, some are still difficult to learn, hard to use, confusing, counterintuitive, unforgiving, and
frustrating
• User interface analysis and design has to do with the study of people and how they relate to technology
A Spiral Process
• Focuses on the profile of the users who will interact with the system
• Studies different models of system function (as perceived from the outside)
• Delineates the human- and computer-oriented tasks that are required to achieve system
function
– Interface design
• Defines a set of interface objects and actions (and their screen representations) that enable
a user to perform all defined tasks in a manner that meets every usability goal defined for
the system
– Interface construction
• The ability of the interface to implement every user task correctly, to accommodate all task
variations, and to achieve all general user requirements
• The degree to which the interface is easy to use and easy to learn
• Define interaction modes in a way that does not force a user into unnecessary or undesired actions
– The user shall be able to enter and exit a mode with little or no effort (e.g., spell check edit text
spell check)
– The user shall be able to perform the same action via keyboard commands, mouse movement, or
voice recognition
– The user shall be able to easily interrupt a sequence of actions to do something else (without losing
the work that has been done so far)
• Streamline interaction as skill levels advance and allow the interaction to be customized
– The user shall be able to use a macro mechanism to perform a sequence of repeated interactions
and to customize the interface
– The user shall not be required to directly use operating system, file management, networking. etc.,
commands to perform any actions. Instead, these operations shall be hidden from the user and
performed "behind the scenes" in the form of a real-world abstraction
• Design for direct interaction with objects that appear on the screen
– The user shall be able to manipulate objects on the screen in a manner similar to what would occur
if the object were a physical thing (e.g., stretch a rectangle, press a button, move a slider)
– The interface shall reduce the user's requirement to remember past actions and results by providing
visual cues of such actions
– The system shall provide the user with default values that make sense to the average user but allow
the user to change these defaults
– The user shall be able to easily reset any value to its original default value
– The user shall be provided mnemonics (i.e., control or alt combinations) that tie easily to the action
in a way that is easy to remember such as the first letter
• The visual layout of the interface should be based on a real world metaphor
– The screen layout of the user interface shall contain well-understood visual cues that the user
can relate to real-world actions
– When interacting with a task, an object or some behavior, the interface shall be organized
hierarchically by moving the user progressively in a step-wise fashion from an abstract concept to a
concrete action (e.g., text format options format dialog box)
Make the Interface Consistent
– All visual information shall be organized according to a design standard that is maintained
throughout all screen displays
– Input mechanisms shall be constrained to a limited set that is used consistently throughout
the application
– Mechanisms for navigating from task to task shall be consistently defined and implemented
• Allow the user to put the current task into a meaningful context
– The interface shall provide indicators (e.g., window titles, consistent color coding) that enable the
user to know the context of the work at hand
– The user shall be able to determine where he has come from and what alternatives exist for a
transition to a new task
– A set of applications performing complimentary functionality shall all implement the same design
rules so that consistency is maintained for all interaction
• If past interactive models have created user expectations, do not make changes unless there is a compelling
reason to do so
– Once a particular interactive sequence has become a de facto standard (e.g., alt-S to save a file), the
application shall continue this expectation in every part of its funtionality
• Four different models come into play when a user interface is analyzed and designed
– User's mental model – Developed by the user when interacting with the application
• The role of the interface designer is to reconcile these differences and derive a consistent representation of
the interface
– Based on age, gender, physical abilities, education, cultural or ethnic background, motivation, goals,
and personality
– The mechanics of interaction that are required to use the interface effectively
• Categorizes users as
– Novices
• No syntactic knowledge of the system, little semantic knowledge of the application, only
general computer usage
• Reasonable semantic knowledge of the system, low recall of syntactic information to use the
interface
• Good semantic and syntactic knowledge (i.e., power user), look for shortcuts and
abbreviated modes of operation
Design Model
• Constrained by information in the requirements specification that helps define the user of the system
Implementation Model
• Consists of the look and feel of the interface combined with all supporting information (books, videos, help
files) that describe system syntax and semantics
• Strives to agree with the user's mental model; users then feel comfortable with the software and use it
effectively
• Serves as a translation of the design model by providing a realization of the information contained in the
user profile model and the user’s mental model
• Consists of the image of the system that users carry in their heads
• Accuracy of the description depends upon the user’s profile and overall familiarity with the software in the
application domain
• To perform user interface analysis, the practitioner needs to study and understand four elements
– The users who will interact with the system through the interface
User Analysis
• The analyst strives to get the end user's mental model and the design model to converge by understanding
– Sales input from the sales people who interact with customers and users on a regular basis
– Marketing input based on a market analysis to understand how different population segments might
use the software
– Support input from the support staff who are aware of what works and what doesn't, what users like
and dislike, what features generate questions, and what features are easy to use
• A set of questions should be answered during user analysis (see next slide)
3) Are the users capable of learning on their own from written materials or have they expressed a desire for
classroom training?
7) How are users compensated for the work they perform or are they volunteers?
8) Do users work normal office hours, or do they work whenever the job is required?
9) Is the software to be an integral part of the work users do, or will it be used only occasionally?
11) What are the consequences if a user makes a mistake using the system?
12) Are users experts in the subject matter that is addressed by the system?
13) Do users want to know about the technology that sits behind the interface?
– The tasks and subtasks that will be performed as the user does the work
– The specific problem domain objects that the user manipulates as work is performed
• Use cases
– Enable the software engineer to extract tasks, objects, and overall workflow of the interaction
Content Analysis
• The display content may range from character-based reports, to graphical displays, to multimedia
information
– Acquired from data stored in a database that is accessible from the application
• The format and aesthetics of the content (as it is displayed by the interface) needs to be considered
• A set of questions should be answered during content analysis (see next slide)
1) Are various types of data assigned to consistent locations on the screen (e.g., photos always in upper right
corner)?
6) Is graphical output scaled to fit within the bounds of the display device that is used?
8) How are error messages and warnings presented in order to make them quick and easy to see
and understand?
• Software products need to be designed to fit into the work environment, otherwise they may be difficult or
frustrating to use
– Type of lighting
– Surrounding noise
• User interface design is an iterative process, where each iteration elaborate and refines the information
developed in the preceding step
1) Using information developed during user interface analysis, define user interface objects and actions
(operations)
2) Define events (user actions) that will cause the state of the user interface to change; model this
behavior
3) Depict each interface state as it will actually look to the end user
4) Indicate how the user interprets the state of the system from information provided through the
interface
3) Consider the computing environment (e.g., display technology, operating system, development
tools) that will be used
Interface Objects and Actions
• Interface objects and actions are obtained from a grammatical parse of the use cases and the software
problem statement
• Interface objects are categorized into types: source, target, and application
– A source object is dragged and dropped into a target object such as to create a hardcopy of a report
– An application object represents application-specific data that are not directly manipulated as part
of screen interaction such as a list
• After identifying objects and their actions, an interface designer performs screen layout which involves
• Many software engineers do not address these issues until late in the design or construction process
• The message should describe the problem in plain language that a typical user can understand
• The message should provide constructive advice for recovering from the error
• The message should indicate any negative consequences of the error (e.g., potentially corrupted data files)
so that the user can check to ensure that they have not occurred (or correct them if they have)
• The message should be accompanied by an audible or visual cue such as a beep, momentary flashing, or a
special error color
• The message should be non-judgmental (the message should never place blame on the user)
Questions for Menu Labeling and Typed Commands
• What form will a command take? A control sequence? A function key? A typed word?
• Are submenus consistent with the function implied by a master menu item?
• Before prototyping occurs, a number of evaluation criteria can be applied during design reviews to the
design model itself
• Derived from the length and complexity of the written specification and its interfaces
• Derived from the number of user tasks specified and the average number of actions per task
– The complexity of the interface and the degree to which it will be accepted by the user
• Derived from the interface style, help facilities, and error handling procedures
• Prototype evaluation can range from an informal test drive to a formally designed study using statistical
methods and questionnaires
• The prototype evaluation cycle consists of prototype creation followed by user evaluation and back to
prototype modification until all user issues are resolved