SE - Unit - 3
SE - Unit - 3
SE - Unit - 3
UNIT – III
BUILDING THE ANALYSIS MODEL
In this chapter:
✓ Requirement analysis
✓ Analysis modeling approaches
✓ Data modeling concepts
✓ Object oriented analysis
✓ Flow oriented modeling
✓ Design engineering
✓ Design concepts
✓ The design model
✓ Modeling component level design
✓ Designing class based components
REQUIREMENT ANALYSIS
In way the role of a domain analyst is similar to the role of a master toolsmith
in a heavy manufacturing environment.
The job of the toolsmith is to design and build tools that may be used by many
people doing similar but not necessarily the same job.
The role of domain analyst is to discover and define reusable analysis patterns,
analysis classes, and related information that may be used by many people working on
similar but not necessarily the same applications.
Data Objects
Data object is a representation of almost any composite information that must be
understood by software.
By composite information, something that has number of different properties or
attributes.
A data object can be an
external entity( eg : anything that produces or consumes
information),
a thing (eg : a report or display),
an occurrence (eg: telephone call) or
event (eg : alarm),
a role (eg : salesperson)
an organizational unit (eg : accounting department)
a place
a structure.
A data object encapsulates the data only – there is no reference within a data
object to operations that act on the data.
Data Attributes
Attributes define the properties of a data object. The attribute is a quality or
characteristic that defines a person, group, or data objects.
It is actually the properties that define the type of entity. An attribute can have
a single or multiple or range of values as per our needs.
There are three types of attributes:
1. Naming attributes –
To name an instance of a data object, naming attributes are used. User naming
attributes identify user objects such as Login_names and User_Id for some
security purpose.
For example- Make and model are naming attributes in a vehicle data object.
2. Descriptive attributes –
These attributes are used to describe the characteristics or features or the
relationship of the data object. Sometimes also referred to as relationship
attributes.
For example- In a vehicle, the color of a data object is a descriptive attribute
that describes the features of the object.
3. Referential attribute –
These are the attributes that are used to formalize binary and associative
relationships and in making reference to another instance in another table.
For example- The data object is a referential attribute in a vehicle.
Relationship :
The relationship represents the connection or relation between different data
objects and describes association among entities. Relationships are of three types:
one-to-many, many-to-many, and many-to-one.
For example, toy and shopkeeper are two objects that share the following
relationship:
The Shopkeeper order toys.
The shopkeeper sells toys.
The shopkeeper shows toys.
The Shopkeeper stocks toys.
Cardinality and Modality
Cardinality describes the maximum number of data objects that can participate
in a relationship. In databases, cardinality is defined as the uniqueness of data values
that are contained in a column.
High cardinality means the column contains a large percentage of totally unique
values. On the other hand, low cardinality means the column has a lot of "repeats" in
its data range.
Cardinality between the tables can be classified into different types such as
one−to−one, many−to−one or many−to−many.
Modality is absolutely different from cardinality because −
The value of modality is computed as "0", if the relationship is optional or if
there is no need for the relationship to occur.
If there is a necessity of the occurrence of a relationship, then the value of the
modality is computed as "1".
The data flow diagram enables you to develop models of the information
domain and functional domain.
As the DFD is refined into greater levels of detail, you perform an implicit
functional decomposition of the system.
Simple guidelines the derivation of a data flow diagram:-
The level 0 data flow diagram should depict the software/system as a
single bubble.
Primary input and output should be carefully noted.
Refinement should begin by isolating candidate processes, data objects,
and data stores to be represented at the next level.
All arrows and bubbles should be labeled with meaningful names.
Information flow continuity must be maintained from level to level.
One bubble at a time should be refined. There is a natural tendency to
overcomplicate the data flow diagram.
The refinement of DFDs continues until each bubble performs a
simple function.
That is, until the process represented by the bubble performs a function that
would be easily implemented as a program component. called cohesion.
CONTROL FLOW MODEL
For some types of applications, the data model and the data flow diagram are
all that is necessary to obtain meaningful insight into software requirements.
Such applications require the use of control flow modeling in addition to data
flow modeling.
The following guidelines are for select potential candidate events:
List all sensors that are “read” by the software.
List all interrupt conditions.
List all “switches” that are actuated by an operator.
List all data conditions.
Recalling the noun/verb parse that was applied to the processing
narrative, review all “control items” as possible control specification
inputs/outputs.
Describe the behavior of a system by identifying its states, identify how
each state is reached, and define the transitions between states.
Focus on possible omissions—a very common error in specifying
control; for example, ask: “Is there any other way I can get to this state
or exit from it?”
THE CONTROL SPECIFICATION
A control specification (CSPEC) represents the behavior of the system in
two different ways.
The CSPEC contains a state diagram that is a sequential specification of
behavior. It can also contain a program activation
table a combinatorial specification of behavior.
The CSPEC contains a state diagram that is a sequential specification of
behavior. It can also contain a program activation
table a combinatorial specification of behavior.
A somewhat different mode of behavioral representation is the process
activation table. The PAT represents information contained in the state diagram in the
context of processes, not states.
That is, the table indicates which processes (bubbles) in the flow model will be
invoked when an event occurs.
The PAT can be used as a guide for a designer who must build an executive
that controls the processes represented at this level.
The CSPEC describes the behavior of the system, but it gives us no information
about the inner working of the processes that are activated as a result of this behavior.
THE PROCESS SPECIFICATION
The process specification (PSPEC) is used to describe all flow model
processes that appear at the final level of refinement.
The content of the process specification can include narrative text, a program
design language (PDL) description of the process algorithm, mathematical
equations, tables, or UML activity diagrams.
DESIGN ENGINEERING
Design engineering encompasses the set of principles, concepts and practices
that lead to development of a high-quality system or product.
Design principles establish an overriding philosophy that guides the designer in
the work that is performed.
Design engineering is not a commonly used phrase in the software engineering
context.
The goal of design engineering is to produce a model or representation that
exhibits firmness, commodity and delight.
Design engineering for computer software changes continually as new
methods, better analysis, and broader understanding evolve.
To accomplish thus, a designer must practice diversification and the
convergence.
These qualities are based on experience in building similar entities, a set of
principles and heuristics that guide the way in which the model evolves, a set of
criteria that enables quality to be judged, and the process of iteration that ultimately
leads to a final design.
DESIGN CONCEPTS
A set of fundamental software design concepts has evolved over the history of
software engineering.
Although the degree of interest in each concept has varied over the years. Each
has stood the test of time.
Fundamental software design concepts provide the necessary framework for
“getting it right”.
There are several basic concepts are involved in designing concept in software
engineering
Abstraction
Architecture
Patterns
Modularity
Information hiding
Functional independence
Refinement
Refactoring
Design classes
ABSTRACTION
Abstraction is the act of representing essential features without including the
background details or explanations.
The abstraction is used to reduce complexity and allow efficient design and
implementation of complex software systems.
Many levels of abstraction can be posed.
At the highest level of abstraction, a solution is stated in broad terms using the
language of the problem environment.
At lower levels of abstraction, a more detailed description of the solution is
provided. As different levels of abstraction are developed, you work to create both
procedural and data abstractions.
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.
A data abstraction is a named collection of data that describes a data object.
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.
The goal of software design is to derive an architectural rendering of a system.
This rendering serves as a framework from which more detailed design activities
are conducted.
A set of architectural patterns enable a software engineer to reuse design- level
concepts.
Structural Models : Which represents architecture as an organized collection
of program components.
Framework models : increase the level of design abstraction by attempting to
identify repeatable architectural design framework that are encountered in similar types
of applications.
Dynamic models : address the behavioral aspects of the program architecture
indicating how the structure or system configuration may change as a function of
external events.
Process model : focus on the design of the business or technical process that
the system must accommodate.
Functional model : which can be used to represent the functional hierarchy of
a system.
PATTERNS
Brad Appleton defines a design pattern in the following manner:
“A pattern is a named nugget of insight which conveys the essence of a proven
solution to a recurring problem within a certain context amidst competing concerns” .
A design pattern describes a design structure that solves a particular design
problem within a specific context and amid “forces” that may have an impact on the
manner in which the pattern is applied and used.
The intent of each design pattern is to provide a description that enables a
designer to determine
whether the pattern is applicable to the current work,
whether the pattern can be reused (hence, saving design time), and
whether the pattern can serve as a guide for developing a similar, but
functionally or structurally different pattern.
MODULARITY
Modularity is the most common manifestation of separation of concerns.
Software is divided into separately named and addressable components,
sometimes called module.
Modularity is the single attribute of software that allows a program to be
intellectually manageable.
Modularity is achieved by dividing the software into uniquely named and
addressable components, which are also known as modules.
A complex system (large program) is partitioned into a set of discrete modules
in such a way that each module can be developed independent of other modules.
After developing the modules, they are integrated together to meet the software
requirements. Note that larger the number of modules a system is divided into, greater
will be the effort required to integrate the modules.
Modularizing a design helps to plan the development in a more effective manner,
accommodate changes easily, conduct testing and debugging effectively and efficiently,
and conduct maintenance work without adversely affecting the functioning of the
software.
INFORMATION HIDING
Information hiding is a software design principle, where certain aspects of a
program or module (the “secrets”) are inaccessible to clients.
The primary goal is to prevent extensive modification to clients whenever the
implementation details of a module or program are changed.
This is done by hiding aspects of an implementation that might change behind
a stable interface that protects clients from the implementation details.
Users of that interface (whether it is a module, class, or function) will perform
operations purely through its interface.
This way, if the implementation changes, the clients do not have to change.
Information hiding serves as a criterion that can be used to decompose a system into
modules. The principle is also useful for reducing coupling within a system.
Information hiding helps us improve the ability to change our system while
minimizing the impact on other parts of the system.
Since the implementation details are hidden behind a common interface,
changes to the implementation do not require changes to the rest of the program (as
long as the implementation sufficiently satisfies the specified interface).
Changes are isolated to a single location in the ideal case.
For example, a common sensor API may be provided, and any sensor driver
that satisfies the interface requirements can be used within the system. This enables a
team to swap between components (and even processors or board designs) as
necessary.
FUNCTIONAL INDEPENDENCE
Functional independence is achieved by developing functions that perform only
one kind of task and do not excessively interact with other modules.
Independence is important because it makes implementation more accessible and
faster.
The independent modules are easier to maintain, test, and reduce error
propagation and can be reused in other programs as well.
Thus, functional independence is a good design feature which ensures software
quality.
It is measured using two criteria:
o Cohesion:
Cohesion is a natural extension of the information hiding concept. It
measures the relative function strength of a module.
A cohesion module performs a single task, requiring little interaction with
other components in other parts of a program.
o Coupling:
Coupling is an indication of interconnection among modules in a software
structure.
It measures the relative interdependence among modules, the point at
which entry or reference is made to a module, and what data pass across the
interface.
REFINEMENT
Stepwise refinement is the idea that software is developed by moving through
the levels of abstraction, beginning at higher levels and, incrementally refining the
software through each level of abstraction, providing more detail at each increment.
At higher levels, the software is merely its design models; at lower levels there
will be some code; at the lowest level the software has been completely developed.
At the early steps of the refinement process the software engineer does not
necessarily know how the software will perform what it needs to do.
This is determined at each successive refinement step, as the design and the
software is elaborated upon.
Refinement can be seen as the compliment of abstraction.
Abstraction is concerned with hiding lower levels of detail; it moves from
lower to higher levels.
Refinement is the movement from higher levels of detail to lower levels. Both
concepts are necessary in developing software.
REFACTORING
Refactoring is the process of restructuring code, while not changing its original
functionality.
The goal of refactoring is to improve internal code by making many small
changes without altering the code's external behavior.
Computer programmers and software developers refactor code to improve the
design, structure and implementation of software.
Refactoring improves code readability and reduces complexities. Refactoring
can also help software developers find bugs or vulnerabilities hidden in their software.
The refactoring process features many small changes to a program's source
code.
One approach to refactoring, for example, is to improve the structure of source
code at one point and then extend the same changes systematically to all applicable
references throughout the program.
The thought process is that all the small, behavior-preserving changes to a body
of code have a cumulative effect.
These changes preserve the software's original behavior and do not modify its
behavior.
DESIGN CLASSES
A set of design classes refined the analysis class by providing design details.
1)Refine the analysis classes by providing design detail that will enable
the classes to be implemented.
2)Create a new set of design classes that implement a software
infrastructure to support the business solutions.
There are five different types of design classes and each type represents the
layer of the design architecture these are as follows:
1. User interface classes
These classes are designed for Human Computer Interaction(HCI).
These interface classes define all abstraction which is required for Human
Computer Interaction(HCI).
2. Business domain classes
These classes are commonly refinements of the analysis classes.
These classes are recognized as attributes and methods which are required to
implement the elements of the business domain.
3. Process classes
It implement the lower level business abstraction which is needed to
completely manage the business domain class.
4. Persistence classes
It shows data stores that will persist behind the execution of the software.
5. System Classes
System classes implement software management and control functions that
allow to operate and communicate in computing environment and outside
world.
The characteristic of well formed designed class are as follows:
1. Complete and sufficient
A design class must be the total encapsulation of all attributes and methods
which are required to exist for the class.
2. Primitiveness
The method in the design class should fulfil one service for the class.
If service is implemented with a method then the class should not provide
another way to fulfil same thing.
3. High cohesion
A cohesion design class has a small and focused set of responsibilities.
For implementing the set of responsibilities the design classes are applied
single-mindedly to the methods and attribute.
4. Low-coupling
All the design classes should collaborate with each other in a design model.
The minimum acceptable of collaboration must be kept in this model.
In this view, instead of creating each component from scratch, the system is building
from existing components maintained in a library.
As the software architecture is formulated, components are selected from the library
and used to populate the architecture.
• A user interface (UI) component includes grids, buttons referred as controls, and
utility components expose a specific subset of functions used in other
components.
• Other common types of components are those that are resource intensive, not
frequently accessed, and must be activated using the just-in-time (JIT) approach.
• Many components are invisible which are distributed in enterprise business
applications and internet web applications such as Enterprise JavaBean (EJB),
.NET components, and CORBA components.
• Assume that the component is being designed from scratch or used an existing
components for new development.
• That is, you have to create a new component based on specifications derived
from the requirements model.
• There is, of course, another approach.
• The software engineering community has emphasized the need to build systems
that make use of existing software components or design patterns.
• In essence, a catalog of proven design or code-level components is made
available to you as design work proceeds.
• As the software architecture is developed, you 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.