MOSS Module 2 Note 2024
MOSS Module 2 Note 2024
REQUIREMENTS ENGINEERING
The process of establishing the services that the customer requires from a
system and the constraints under which it operates and is developed. The
requirements themselves are the descriptions of the system services and
constraints that are generated during the requirements engineering process. It
may range from a high-level abstract statement of a service or of a system constraint
to a detailed mathematical functional specification.
Types of requirement
• User requirements-
Statements in natural language plus diagrams of the services the system
provides and its operational constraints. Written for customers.
• System requirements-
A structured document setting out detailed descriptions of the system’s
functions, services and operational constraints. Defines what should be
implemented so may be part of a contract between client and contractor.
1
Readers of different types of requirement specification
Functional requirements
• Describe functionality or system services.
• Depend on the type of software, expected users and the type of system
where the software is used.
2
• Functional user requirements may be high-level statements of what the
system should do.
• Functional system requirements should describe the system services in detail.
Non-functional requirements
These define system properties and constraints e.g. reliability, response time
and storage requirements. Constraints are I/O device capability, system
representations, etc. Process requirements may also be specified mandating a
particular IDE, programming language or development method. Non-functional
requirements may be more critical than functional requirements. If these are
not met, the system may be useless.
Types of non-functional Requirements
3
Requirements which are a consequence of organizational policies and
procedures e.g. process standards used, implementation requirements, etc.
• External requirements
Requirements which arise from factors which are external to the system
development process e.g. interoperability requirements, legislative
requirements etc.
• Usability requirements
The system should be easy to use by medical staff and should be organized in
such a way that user errors are minimized. (Goal). Medical staff shall be able to
use all the system functions after four hours of training. After this training,
the average number of errors made by experienced users shall not exceed two
per hour of system use. (Testable non-functional requirement).
The processes used for Requirement Engineering vary widely depending on the
application domain, the people involved and the organisation developing the
requirements. Requirement Engineering is an iterative activity in which these
processes are interleaved.
4
Requirements engineering processes
5
Requirements elicitation and analysis
Software engineers work with a range of system stakeholders to find out about
the application domain, the services that the system should provide, the required
system performance, hardware constraints, other systems, etc.
Stages include:
• Requirements discovery and understanding: process of interacting
with stake holders to discover their requirements. Domain requirements
from stakeholders and documentation are also discovered.
6
1. Requirements discovery (Requirement elicitation techniques)
The process of gathering information about the required and existing systems and distilling the
user and system requirements from this information. Interaction is with system stakeholders
from managers to external regulators. Systems normally have a range of stakeholders.
✓ Ethnography
7
✓ Focused ethnography
• Developed in a project studying the air traffic control
process.
• Combines ethnography with prototyping
• Prototype development results in unanswered questions which
focus the ethnographic analysis.
• The problem with ethnography is that it studies existing practices which
may have some historical basis which is no longer relevant.
2. Requirements specification
98
✓ Requirements and design
In principle, requirements should state what the system should do and the design
should describe how it does this.
In practice, requirements and design are inseparable
o A system architecture may be designed to structure the requirements;
o The system may inter-operate with other systems that generate design
requirements;
o The use of a specific architecture to satisfy non-functional requirements
may be a domain requirement.
o This may be the consequence of a regulatory
requirement.
10
✓ Form-based specifications
• Definition of the function or entity.
• Description of inputs and where they come from.
• Description of outputs and where they go to.
• Information about the information needed for the computation and
other entities used.
• Description of the action to be taken.
• Pre and post conditions (if appropriate).
• The side effects (if any) of the function.
✓ Tabular specification
✓ Use cases
• Use-cases are a scenario based technique in the UML which identify the
actors in an interaction and which describe the interaction itself.
• A set of use cases should describe all possible interactions with the system
• A use case tells a stylized story about how an end user (playing one of a
number of possible roles) interacts with the system under a specific c set
of circumstances.
• The story may be narrative text, an outline of tasks or interactions, a
11
template-based description, or a diagrammatic representation.
• A use case depicts the software or system from the end user’s point of view.
• The first step in writing a use case is to define the set of “actors” that will
be involved in the story.
• Actors are the different people (or devices) that use the system or product
within the context of the function and behavior that is to be described.
• Actors represent the roles that people (or devices) play as the system operates.
• An actor is anything that communicates with the system or product
and that is external to the system itself.
• Primary actors → interact to achieve required system function and
derive the intended benefit from the system. They work directly and
frequently with the software.
• Secondary actors → support the system so that primary actors can
do their work. Once actors have been identified, use cases can be
developed
3. Requirements validation
• Concerned with demonstrating that the requirements define the system
that the customer really wants.
• Requirements error costs are high so validation is very important.
• Fixing a requirements error after delivery may cost up to 100 times the
cost of fixing an implementation error.
✓ Requirements checking
Does the system provide the functions which best support thecustomer’s
needs?
• Validity Consistency: Are there any requirements conflicts?
• Completeness: Are all functions required by the customer
included?
• Realism : Can the requirements be implemented given available
budget and technology
• Verifiability: Can the requirements be checked?
✓ Requirements validation techniques
• Requirements reviews
Systematic manual analysis of the requirements: requirements are
analysed systematically by a team of reviewers who check for errors
and inconsistencies.
• Prototyping
Using an executable model of the system to check requirements.
• Test-case generation
Developing tests for requirements to check testability.
12
✓ Software Requirements Document
• The software requirements document is the official statement of what is
required of the system developers.
• Should include both a definition of user requirements and a
specification of the system requirements.
• It is NOT a design document. As far as possible, it should set of WHAT
the system should do rather than HOW it should do it.
13
14
Fig:Users of a requirements document
15
Requirements Management
• Requirements management is the process of managing changing
requirements during the requirements engineering process and system
development.
• New requirements emerge as a system is being developed and after it has
gone into use.
• You need to keep track of individual requirements and maintain links
between dependent requirements so that you can assess the impact of
requirements changes. You need to establish a formal process for
making change proposals and linking these to system requirements.
✓ Changing requirements - Reasons
• The business and technical environment of the system always
changes after installation.
• The people who pay for a system and the users of that system are rarely
the same people.
• Large systems usually have a diverse user community, with many
users having different requirements and priorities that may be conflicting
or contradictory.
Traceability Matrix
• Is an Engg team that refers to documented links between Software
Engg work products (Eg Requirements and test cases)
• Traceability matrix allows a requirement engineer to represent the
relationship between requirements and other work products.
• Rows of the matrix are labelled using requirement names and columns
can be labelled with the name of Software Engg work product.
• A matrix cell is marked to indicate the presence of link between the two.
• A table type document that is used in the development of software
application to trace requirements.
• It can be used for both forward (from Requirements to Design or
Coding) and backward (from Coding to Requirements) tracing.
• It is also known as Requirement Traceability Matrix (RTM) or Cross
Reference Matrix (CRM).
• It is prepared before the test execution process to ensure that every
requirement is covered in the form of a Test case so that we don't miss
out any testing.
• Map all the requirements and corresponding test cases to ensure that we
have written all the test cases for each condition.
17
• This matrix can support a variety of Engg development activities.
• They can provide continuity for developers as a project moves from
one project phase to another.
• It can be used to ensure the Engg work products have taken all
requirements into account.
• As the no: of req and the number of work products [Link] become
increasingly difficult to keep the traceability up to date.
18
19
The traceability matrix can be classified into three different types which are as follows:
1. Forward traceability
2. Backward or reverse traceability
3. Bi-directional traceability
20
✓ Advantages of RTM:
• With the help of the RTM document, we can display the complete test execution
and bugs status based on requirements.
• It is used to show the missing requirements or conflicts in documents.
• We can ensure the complete test coverage, which means all the modules are tested.
• It will also consider the efforts of the testing teamwork towards reworking or
reconsidering on the test cases.
Personas, Scenarios and Stories ,Feature Identification
21
• Personas are a tool that allows team members to “step into the users’ shoes.”
Instead of thinking about what they would do in a particular situation, they can
imagine how a persona would behave and react.
• They can help you check your ideas to ensure that you are not including
product features that aren’t really needed.
• They help you to avoid making unwarranted assumptions, based on your own
knowledge, and designing an overcomplicated or irrelevant product.
• Personas, scenarios and user stories lead to features that might be
implemented in a software product.
SCENARIOS
• A scenario is a narration that describes a situation in which a user is using your
product’s features to do something that they want to do.
• Scenarios are used in the design of requirements and system features, in
system testing, and in user interface design
• It should briefly explain the user’s problem and present an imagined way
thatthe problem might be solved.
• Scenarios are high-level stories of system use.
• They should describe a sequence of interactions with the system but
shouldnot include details of these interactions.
• They are the basis for both use cases, which are extensively used in object-
oriented methods, and user stories, which are used in agile methods.
22
• Narrative, high-level scenarios, are primarily a means of facilitating
communication and stimulating design creativity.
• They are effective in communication because they are understandable and
accessible to users and to people responsible for funding and buying the
system.
• Like personas, they help developers to gain a shared understanding of the
system that they are creating.
• Scenarios are not specifications. They lack detail, they may be incomplete,
and they may not represent all types of user interactions.
Structured scenarios should include different fields such as:
✓ what the user sees at the beginning of
a scenario,
✓ a description of the normal flow of events,
✓ a description of what might go wrong, and so on.
At the early stages of product design, the scenarios be narrative rather than structured.
Writing scenarios
✓ Start with the personas that you
have created.
✓ Try to imagine several scenarios for each
persona.
✓ Not necessary to include every details you think users might do with your
product.
✓ Scenarios should always be written from the user’s perspective and should
be based on
identified personas or real users.
✓ Scenario writing is not a systematic process and different teams approach it in
differentways.
✓ Writing scenarios always gives you ideas for the features that you can include
in the system.
23
User Stories
✓ These are finer-grain narratives that set out in a more detailed and structured
way a single thing that a user wants from a software system.
✓ User stories are not intended for planning but for helping with
feature identification.
✓ Aim to develop stories that are helpful in one of 2 ways:
✓ as a way of extending and adding detail to a scenario;
✓ as part of the description of the system feature that you have identified.
24
Fea tu r e Ident i ficat ion
Identify the product features that are independent, coherent and relevant
25
26
One problem that product developers should be aware of and try to avoid is
“feature creep.”
• Feature creep the number of features in a product creeps potential uses of
the product are envisaged.
• It adds to the complexity of a product, which means that you are likely to
introduce bugs and security vulnerabilities into the software.
• It also usually makes the user interface more complex.
27
Feature identification should be a team activity, and as features are
identified, the team should discuss them and generate ideas about related
features.
• Collaborative writing
• Blogs and web pages
Feature List
The output of the feature identification process should be a list of features that
you use for designing and implementing your product.
• Add detail when you are implementing the feature.
28
provides detail about software architecture, data structures, interfaces, and
components that are necessary to implement the system.
DESIGN WITHIN THE CONTEXT OF SOFTWARE ENGINEERING
The data/class design transforms class models into design class realizations and the
requisite data structures required to implement the software. The objects and provide
the basis for the data design activity.
The architectural design defines the relationship between major structural
elements of the software, the architectural styles and patterns. The architectural
design representation—the framework of a computer-based system—is derived from
the requirements model.
The interface design describes how the software communicates with systems that
interoperate with it, and with humans who use it. An interface implies a flow of
information (e.g., data and/or control) and a specific type of behavior. Therefore,
usage scenarios and behavioral models provide much of the information required for
interface design.
29
The component-level design transforms structural elements of the software
architecture into a procedural description of software components. Information
obtained from the class-based models and behavioral models serve as the basis for
component design.
The importance of software design can be stated with a single word— quality.
Design is the only way that you can accurately translate stakeholder’s requirements
into a finished software product or system. Software design serves as the foundation
for all the software engineering and software support activities that follow.
Software design is an iterative process through which requirements are translated into
a “blueprint” for constructing the software. Initially, the blueprint depicts a holistic
view of software.
Quality Guidelines.
Consider the following guidelines:
1. A design should exhibit an architecture that (1) has been created using
recognizable architectural styles or patterns, (2) is composed of components
that exhibit good design characteristics (these are discussed later in this
chapter), and (3) can be implemented in an evolutionary fashion, thereby
facilitating implementation and testing.
2. A design should be modular; that is, the software should be logically
partitioned into elements or subsystems.
3. A design should contain distinct representations of data, architecture,
interfaces, and components.
4. A design should lead to data structures that are appropriate for the classes
to be implemented and are drawn from recognizable data patterns.
5. A design should lead to components that exhibit independent functional
characteristics.
6. A design should lead to interfaces that reduce the complexity of connections
between components and with the external environment.
7. A design should be derived using a repeatable method that is driven by
information obtained during software requirements analysis.
8. A design should be represented using a notation that effectively communicates its
meaning.
30
Quality Attributes. Hewlett-Packard [Gra87] developed a set of software quality
attributes that has been given the acronym FURPS—functionality, usability, reliability,
performance, and [Link] FURPS quality attributes represent a target for all
software design:
• Functionality is assessed by evaluating the feature set and capabilities of the
program, the generality of the functions that are delivered, and the security of
the overall system.
• Usability is assessed by considering human factors,overall aesthetics,
consistency, and documentation.
• Reliability is evaluated by measuring the frequency and severity of failure, the
accuracy of output results, the mean-time-to-failure (MTTF), the ability to
recover from failure, and the predictability of the program.
• Performance is measured using processing speed, response time, resource
consumption, throughput, and efficiency.
• Supportability combines extensibility, adaptability, and serviceability.
These three attributes represent a more common term, maintainability —
and in addition, testability, compatibility, configurability (the ability to
organize and control elements of the software configuration),the ease with
which a system can be installed, and the ease with which problems can be
localized.
Common characteristics:
(1) A mechanism for the translation of the requirements model into a design
representation,
(2) A notation for representing functional components and their interfaces,
(3) Heuristics for refinement and
partitioning
(4) Guidelines for quality assessment.
DESIGN CONCEPTS
31
Abstraction
• Abstraction is used to hide background details or unnecessary
implementation about the data.
• A procedural abstraction refers to a sequence of instructions that have a
specific and limited function. The name of a procedural abstraction implies
these functions, but specific details are suppressed.
An example of a procedural abstraction would be the word open for a
door. Open implies a long sequence of procedural steps (e.g., walk to the
door, reach out and grasp knob, turn knob and pull door, step away from
moving door, etc.).
32
• A data abstractionis a named collection of data that describes a data object.
In the context of the procedural abstraction open, we can define a data
abstraction called door. Like any data object, the data abstraction for door
would encompass a set of attributes that describe the door (e.g., door type,
swing direction, opening mechanism, weight, dimensions).
Architecture
• Software architecture alludes to “the overall structure of the software and the
ways in which that structure provides conceptual integrity for a system”.
• Architecture is the structure or organization of program components
(modules), the manner in which these components interact, and the
structure of data that are used by the components.
• A set of architectural patterns enables a software engineer to reuse design-
level concepts.
• Shaw and Garlan describe a set of properties that should be specified as part
of an architectural design.
33
➢ Functional models can be used to represent the functional hierarchy of a system.
Separation of Concerns
Separation of concerns is a design concept that suggests that any complex problem
can be more easily handled if it is subdivided into pieces that can each be
solved and/or optimized independently.
A concern is a feature or behavior that is specified as part of the requirements
model for the software. By separating concerns into smaller, and therefore more
manageable pieces, a problem takes less effort and time to solve.
Modularity
• Modularity is the way of hiding unnecessary details in modules.
• “Modularity is the single attribute of software that allows a program to be
intellectually manageable”.
34
• Given the same set of requirements, more modules means smaller
individual size. However, as the number of modules grows, the effort (cost)
associated with integrating the modules also grows. These characteristics lead
to a total cost or effort curve shown in the figure. There is a number, M, of
modules that would result in minimum development cost, but we do not have
the necessary sophistication to predict M with assurance.
Information Hiding
• The principle of information hiding suggests that modules be “characterized
by design decisions that (each) hides from all others.”
• Hiding implies that effective modularity can be achieved by defining a set of
independent modules that communicate with one another only that
information necessary to achieve software function.
Functional Independence
• Functional independence is achieved by developing modules with “single
minded” function and an “aversion” to excessive interaction with other
modules.
• Functional independence is a key to good design, and design is the key to
software quality.
• Independence is assessed using two qualitative criteria:
cohesion and coupling.
• Cohesion is an indication of the relative functional strength of a module.
• Coupling is an indication of the relative interdependence among modules.
• A cohesive module performs a single task, requiring little interaction
with other components in other parts of a program
• Coupling is an indication of interconnection among modules in a software
structure.
✓ High cohesion and low coupling make the module to be effectively design.
Refinement
• Stepwise refinement is a top-down design strategy.
• An application is developed by successively refining levels of procedural detail.
• Refinement is actually a process of elaboration. You begin with a statement
of function (or description of information) that is defined at a high level of
abstraction.
• Abstraction and refinement are complementary concepts.
• Abstraction enables you to specify procedure and data internally but suppress
the need for “outsiders” to have knowledge of low-level details.
• Refinement helps you to reveal low-level details as design progresses.
• Both concepts allow you to create a complete design model as the design evolves.
35
Aspects
• An aspect of a program is a feature linked to many other parts of the program , but which
is not related to the program’s primary function.
• Eg: Logging code
• An aspect is implemented as a separate module (component) rather than as software
fragments that are “scattered” or “tangled” throughout many components.
Refactoring
• Refactoring is a reorganization technique that simplifies the design (or
code) of a component without changing its function or behavior.
• “Refactoring is the process of changing a software system in such a way that
it does not alter the external behavior of the code [design] yet improves its
internal structure.”
• When software is refactored, the existing design is examined for
redundancy, unused design elements, inefficient or unnecessary algorithms,
poorly constructed or inappropriate data structures, or any other design failure
that can be corrected to yield a better design.
36
➢ User interface classes define all abstractions that are necessary for human-
computer interaction (HCI) .
➢ Business domain classes identify the attributes and services (methods) that
are required to implement some element of the business domain that was
defined by one or more analysis classes.
➢ Process classes implement lower-level business abstractions required to fully
manage the business domain classes.
➢ Persistent classes represent data stores (e.g., a database) that will persist
beyond the execution of the software.
➢ System classes implement software management and control functions that
enable the system to operate and communicate within its computing
environment and with the outside world.
High cohesion. A cohesive design class has a small, focused set of responsibilities
and single-mindedly applies attributes and methods to implement those
responsibilities.
Low coupling. Within the design model, it is necessary for design classes to
collaborate with one another. However, collaboration should be kept to an
acceptable minimum. If a design model is highly coupled (all design classes
collaborate with all other design classes), the system is difficult to implement, to
test, and to maintain over time. In general, design classes within a subsystem should
have only limited knowledge of other classes. This restriction, called the Law of
Demeter suggests that a method should only send messages to methods in
neighboring classes.
Design class for Floor Plan and composite aggregation for the class
37
Dependency Inversion
Dependency inversion principle which states: High-level modules(classes) should
not depend [directly] upon low-level modules. Both should depend on abstractions.
Abstractions should not depend on details. Details should depend on abstractions.
38
1 . Data Design Elements
• Data design (sometimes referred to as data architecting) creates a model of
data and/or information that is represented at a high level of abstraction (the
customer/user’s view of data). This data model is then refined into
progressively more implementation-specific representations that can be
processed by the computer-based system.
• The structure of data has always been an important part of software design. At
the program-component level, the design of data structures and the associated
algorithms required to manipulate them is essential to the creation of high-
quality applications.
• At the application level, the translation of a data model (derived as part of
requirements engineering) into a database is pivotal to achieving the business
objectives of a system.
• At the business level, the collection of information stored in disparate
databases and reorganized into a “data warehouse” enables data mining or
knowledge discovery that can have an impact on the success of the business
itself.
2. Architectural Design Elements
The architectural design for software is the equivalent to the floor plan of a house.
The floor plan depicts the overall layout of the rooms; their size, shape, and
relationship to one another; and the doors and windows that allow movement into
and out of the rooms. The floor plan gives us an overall view of the house.
Architectural design elements give us an overall view of the software.
• There are three important elements of interface design: (1) the user interface
(UI), (2) external interfaces to other systems, devices, networks, or other
producers or consumers of information, and (3) internal interfaces between
various design components. These interface design elements allow the
software to communicate externally and enable internal communication and
collaboration among the components that populate the software
architecture.
40
Sensor management sensor
------------->
41
A UML deployment diagram
42
ARCHITECTURAL DESIGN
Architectural design represents the structure of data and program components that
are required to build a computer-based system. It considers the architectural style
that the system will take, the structure and properties of the components that
constitute the system, and the interrelationships that occur among all architectural
components of a system.
An architecture model encompassing data architecture and program structure is
created during architectural design.
SOFTWARE ARCHITECTURE
The software architecture of a program or computing system is the structure or
structures of the system, which comprise software components, the externally
visible properties of those components, and the relationships among them.
ARCHITECTURAL STYLES
➢ Data-Centered Architecture:
• A data store (e.g., a file or database) resides at the center of this
architecture and is accessed frequently by other components that
update, add, delete, or otherwise modify data within the store.
43
• Figure illustrates a typical data-centered style. Client software accesses
a central repository. In some cases the data repository is passive. That
is, client software accesses the data independent of any changes to
the data or the actions of other client software. A variation on this
approach transforms the repository into a “blackboard” that sends
notifications to client software when data of interest to the client
changes.
• Data-centered architectures promote integrability. That is, existing
components can be changed and new client components added to the
architecture without concern about other clients (because the client
components operate independently). In addition, data can be passed
among clients using the blackboard mechanism (i.e., the blackboard
component serves to coordinate the transfer of information between
clients). Client components independently execute processes.
➢ Data-Flow Architectures:
• This architecture is applied when input data are to be transformed
through a series of computational or manipulative components into
output data.
• A pipe-and-filter pattern has a set of components, called filters,
connected by pipes that transmit data from one component to the
next.
• Each filter works independently of those components upstream and
downstream, is designed to expect data input of a certain form, and
produces data output (to the next filter) of a specified form.
• However, the filter does not require knowledge of the workings
44
of its neighboring filters.
• If the data flow degenerates into a single line of transforms, it is
termed batch sequential.
• This structure accepts a batch of data and then applies a series of
sequential components (filters) to transform it.
➢ Call and Return Architectures. This architectural style enables you to achieve a
program structure that is relatively easy to modify and scale. A number of substyles exist
within this category:
• Main program/subprogram architectures. This classic program structure decomposes
function into a control hierarchy where a “main” program invokes a number of program
components, which in turn may invoke still other components. Figure 13.3illustrates an
architecture of this type.
• Remote procedure call architectures. The components of a main program/ subprogram
architecture are distributed across multiple computers on a network.
45
➢ Object-Oriented Architectures: The components of a system
encapsulate data and the operations that must be applied to manipulate
the data. Communication and coordination between components are
accomplished via message passing.
➢ Layered Architectures:
46
ARCHITECTURAL CONSIDERATIONS
ARCHITECTURAL DESIGN
Referring to the figure, systems that interoperate with the target system (the system
for which an architectural design is to be developed) are represented as:
➢ Superordinate systems —those systems that use the target system as part of
some higher-level processing scheme.
➢ Subordinate systems —those systems that are used by the target system and
provide data or processing that are necessary to complete target system
functionality.
➢ Peer-level systems —those systems that interact on a peer-to-peer basis (i.e.,
information is either produced or consumed by the peers and the target system.
➢ Actors —entities (people, devices) that interact with the target system by
producing or consuming information that is necessary for requisite
processing.
Each of these external entities communicates with the target system through an
interface (the small shaded rectangles).
Defining Archetypes
48
• 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.
• In general, a relatively small set of archetypes is required to design even
relatively complex systems.
• The target system architecture is composed of these archetypes, which
represent stable elements of the architecture but may be instantiated many
different ways based on the behavior of the system.
• In many cases, archetypes can be derived by examining the analysis classes
defined as part of the requirements model. Continuing the discussion of the
Safe Home security function, you might define the following archetypes:
• Continuing the Safe Home Security function example, you might define the set
of top-level components that address the following functionality:
• External communication management —coordinates communication of
the security function with external entities such as other Internet-based
systems and external alarm notification.
• Control panel processing —manages all control panel functionality.
• Detector management —coordinates access to all detectors attached to
the system.
• Alarm processing —verifies and acts on all alarm conditions.
50
Architectural Design for web app:
• The architectural design that has been modeled to this point is still relatively
high level. The context of the system has been represented; archetypes that
indicate the important abstractions within the problem domain have been
defined, the overall structure of the system is apparent, and the major
software components have been identified. However, further refinement is
still necessary.
• To accomplish this, an actual instantiation of the architecture is developed. By
this we mean that the architecture is applied to a specific problem with the
intent of demonstrating that the structure and components are appropriate.
52
including a user interface layer, a business layer, and a data layer. With mobile
apps you have the choice of building a thin Web-based client or a rich client.
With a thin client, only the user interface resides on the mobile device, whereas
the business and data layers reside on a server. With a rich client all three layers
may reside on the mobile device itself.
Mobile devices differ from one another in terms of their physical
characteristics (e.g., screen sizes, input devices), software (e.g., operating
systems, language support), and hardware (e.g., memory, network
connections). Each of these attributes shapes the direction of the architectural
alternatives that can be selected.
A number of considerations that can influence the architectural design of a
mobile app:
(1) the type of web client (thin or rich) to be built,
(2) the categories of devices (e.g., smart phones, tablets) that are supported,
(3) the degree of connectivity (occasional or persistent) required,
(4) the bandwidth required,
(5) the constraints imposed by the mobile platform,
(6) the degree to which reuse and maintainability are important, and
(7) device resource constraints (e.g., battery life, memory size, processor speed).
C O M P O N E N T L E V E L D E S I GN
Component
A component is a modular building block for computer
software.
The OMG Unified Modeling Language Specification defines a
component as “a modular, deployable, and replaceable part of a
system that encapsulates implementation and exposes a set of
interfaces.”
53
54
Components populate the software architecture and, as a consequence, play
a role in achieving the objectives and requirements of the system to be
built. Because components reside within the software architecture, they
must communicate and collaborate with other components and with entities
(e.g., other systems, devices, and people) that exist outside the boundaries
of the software.
55
A Process-Related View
Over the past three decades, the software engineering community has
emphasized the need to build systems that make use of existing software
components or design patterns. A catalog of proven design or code-level
components is made available to you as design work proceeds. As the
software architecture is developed, we choose components or design
patterns from the catalog and use them to populate the architecture.
Because these components have been created with reusability in mind,
a complete description of their interface, the function(s) they perform,
and the communication and collaboration they require are all available
to you.
DESIGN CLASS BASED COMPONENTS
Basic design principles
The Open-Closed Principle (OCP). “A module [component] should
be open for extension but closed for modification”
Should specify the component in a way that allows it to be
extended (within the functional domain that it addresses) without the
need to make internal (code or logic-level) modifications to the
component itself.
To accomplish this, you create abstractions that serve as a buffer
between the functionality that is likely to be extended and the
design class itself.
One way to accomplish OCP for the Detector class is illustrated
in Figure .The sensor interface presents a consistent view of
sensors to the detector component. If a new type of sensor is
added no change is required for the Detector class(component).
The OCP is preserved.
The Liskov Substitution Principle (LSP).
“Subclasses should be substitutable for their base classes”.
This design principle suggests that a component that uses a base
class should continue to function properly if a class derived from
the base class is passed to the component instead
In the context, a “contract” is a pre-condition that must be true
before the component uses a base class and a post-condition that
should be true after the component uses a base class. When you
create derived classes, be sure they conform to the pre- and post-
conditions.
Dependency Inversion Principle (DIP).
“Depend on abstractions. Do not dependon concretions”.
Abstractions are the place where a design can be extended
56
without great complication. The more a component depends
on other concrete components (rather than on abstractions such
as an interface), the more difficult it will be to extend.
The Interface Segregation Principle (ISP).
“Many client-specific interfaces are better than one general
purpose interface”.
There are many instances in which multiple client components
use the operations provided by a server class.
Should create a specialized interface to serve each major
category of clients. Only those operations that are relevant to a
particular category of clients should be specified in the interface
for that client. If multiple clients require the same operations,it
should be specified in each of specialized interfaces.
57
The Common Closure Principle (CCP).
“Classes that change together belong
together.”
Classes should be packaged cohesively.
That is, when classes are packaged as part of a design, they should
address the same functional or behavioural area.
When some characteristic of that area must change, it is likely
that only those classes within the package will require modification.
This leads to more effective change control and release
management.
For this reason, only classes that are reused together should be
included within a package.
58
We can choose to use stereotypes to help identify the nature of
components at the detailed design level. For example, <<infrastructure>>
might be used to identify an infrastructure component, <<database>>
could be used to identify a database that services one or more design
classes or the entire system; <<table>> can be used to identify a table
within a database.
Interfaces. Interfaces provide important information about
communication and collaboration (as well as helping us to achieve the
OPC).
Dependencies and Inheritance. For improved readability, it is a good
idea to model dependencies from left to right and inheritance from
bottom (derived classes) to top (base classes).
Cohesion
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.
Functional. Exhibited primarily by operations, this level of cohesion
occurs when a module performs one and only one computation and then
returns aresult.
Layer. Exhibited by packages, components, and classes, this type of
cohesion occurs when a higher layer accesses the services of a lower
layer, but lower layers do not access higher layers.
Communicational. All operations that access the same data are
defined within one class. In general, such classes focus solely on the
data in question, accessing and storing it.
59
Coupling
• As the amount of communication and collaboration
increases (i.e., as the degree of “connectedness” between
classes increases), the complexity of the system also
increases. And as complexity increases, the difficulty of
implementing, testing, and maintaining software grows.
• Coupling is a qualitative measure of the degree to which
classes are connected to one another. As classes (and
components) become more interdependent, coupling
increases. An important objective in component-level
design is tokeep coupling as low as is possible.
• Content coupling occurs when one component
“surreptitiously modifies data that is internal to another
component” .This violates information hiding—a basic
designconcept.
• Control coupling occurs when operation A() invokes
operation B() and passes a control flag to B. The control flag
then “directs” logical flow within B. The problem with this
form of coupling is that an unrelated change in B can
result in the necessity to change the meaning of the
control flag that A passes. If this is overlooked, an error
will result.
• External coupling occurs when a component communicates or
collaborates with infrastructure components (e.g., operating system
functions, database capability, tele-communication
functions). Although this type of coupling is necessary, it
should be limited to a small number of components or classes within a
system.
60
CONDUCTING COMPONENT LEVEL DESIGN
61
Step 3(d) : Describe processing flow within each operation in detail.
This may be accomplished using a programming language-based pseudo
code or with a UML activity diagram. Each software component is
elaborated through a number of iterations that apply the stepwise
refinement concept.
The first iteration defines each operation as part of the design class. In
every case, the operation should be characterized in a way that ensures
high cohesion; that is, the operation should perform a single targeted
function or sub function. The next iteration does little more than expand
the operation name.
Step 4 : Describe persistent data sources (databases and files) and
identify the classes required to manage them.
Databases and files normally transcend the design description of an
individual component. In most cases, these persistent data stores are
initially specified as part of architectural design. However, as design
elaboration proceeds, it is often useful to provide additional detail
about the structure and organization of these persistent data sources.
Step 5. Develop and elaborate behavioural representations for a
class or component.
U M L state diagrams were used as part of the requirements model to
represent the externally observable behaviour of the system and the more
localized behaviour of individual analysis classes. During component-
level design, it is sometimes necessary to model the behaviour of a
design class.
The dynamic behavior of an object (an instantiation of a design class
as the program executes) is affected by events that are external to it and
the current state (mode of behavior) of the object. To understand the
dynamic behavior of an object, you should examine all use cases that are
relevant to the design class throughout its life.
Step 6. Elaborate deployment diagrams to provide additional
implementation detail .
Deployment diagrams are used as part of architectural design and
are represented in descriptor form. In this form, major system functions
(often represented as subsystems) are represented within the context
of the computing environment that will house them
(2) a cohesive package of content and functionality that provides the end
user with some required capability. Therefore, component-level design
for WebApps often incorporates elements of content design and
functional design.
Content Design at the Component Level
63
Functional Design at the Component Level
WebApp functionality is delivered as a series of components
developed in parallel with the information architecture to ensure
consistency. We beginby considering both the requirements model
and the initial information architecture and then examining how
functionality affects the user’s interaction with the application, the
information that is presented, and the user tasks that are conducted.
During architectural design, WebApp content and functionality are
combined to create a functional architecture. A functional
architecture is a representation of the functional domain of the
WebApp and describes the key functional components in the
WebApp and how these components interact with each other
Design Document Template
64
MANAGEMENT OF SOFTWARE SYSTEMS CST 309 KTU (S5 CSE)
CASE STUDY
Ariane 5 launch accident
This case study describes the accident that occurred on the initial launch of the
Ariane 5 rocket, a launcher developed by the European Space Agency. The rocket
exploded shortly after take-off and the subsequent enquiry showed that this was
due to a fault in the software in the inertial navigation system.
In June 1996, the then new Arianne 5 rocket was launched on its maiden flight. It
carried a payload of scientific satellites. Ariane 5 was commercially very
significant for the European Space Agency as it could carry a much heavier payload
than the Ariane 4 series of launchers. Thirty seven seconds into the flight, software
in the inertial navigation system, whose software was reused from Ariane 4, shut
down causing incorrect signals to be sent to the engines. These swivelled in such a
way that uncontrollable stresses were placed on the rocket and it started to break up.
Ground controllers initiated self-destruct and the rocket and payload was destroyed.
A subsequent enquiry showed that the cause of the failure was that the software in
the inertial reference system shut itself down because of an unhandled numeric
exception (integer overflow). There was a backup software system but this was not
diverse so it failed in the same way.
65
PREVIOUS YEAR UNIVERSITY QUESTIONS
3. Illustrate Requirement elicitation and analysis process with the help of a diagram.
4. Why is requirements elicitation considered as a critical task in requirements engineering? Explain any two
10. Outline the concept of traceability matrix and Requirements management planning.
11. What are Use cases? Draw the Use case diagram for an ATM.
66
67
68
69
70
71
72
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100