Se 3
Se 3
Software Design is a crucial phase of the software development life cycle that focuses on
the solution domain of a system. It begins once the business needs customer requirements
and technical considerations are available in the SRS document.
Software Design is the process of describing the blue print or sketch of the final software
product in the form of a design model.
Software product is considered a collection of software modules. A module is a part of a
software product, which has data and functions together and an interface with other
modules to produce some output.
Software design usually involves problem solving and planning a software solution. This
includes both low-level component and algorithm and high- level, architecture design.
Software design is the process of implementing software solutions to one or more set of
problems. One of the important parts of software design is the software requirements
analysis (SRA).
Software Design Process:
1
Software Engineering, Subject code: 17CS601, Unit -3
detailed requirements in software terms. The output of this process can directly be used
into implementation in programming languages.
Software design is the first step in SDLC (Software Design Life Cycle), which moves the
concentration from problem domain to solution domain. It tries to specify how to fulfil the
requirements mentioned in SRS.
The software design process is basically consists of three design phases or design level,
viz., architectural design, physical design, and detailed design. The software design process
is shown in below figure
Architecture design
The architectural design is the highest abstract version of the system. It identifies the
software as a system with many components interacting with each other.
At this level, the designers get the idea of proposed solution domain. Architectural style
(e.g. client-server, layered, data centered, etc.) play important role to produce the external
design.
Each architectural style has a different way of architecture mechanism, functional
characteristics, exception handling, performance criteria, data control, data store,
constraints, and external interfaces for the product.
The high-level design or structural design or system design breaks the ‘single entity-
multiple component’ concept of architectural design into less-abstracted view of sub-
systems and modules and depicts their interaction with each other.
2
Software Engineering, Subject code: 17CS601, Unit -3
High-level design focuses on how the system along with all of its components can be
implemented in forms of modules. It recognizes modular structure of each sub-system and
their relation and interaction among each other.
Detailed design
Detailed design is algorithmic design of each software module. It is also called logical
design. The detailed design concentrates on the specification of algorithms and data
structures of each module, the actual interface descriptions of data stores of the modules,
and package specification of the system.
It deals with the implementation part of what is seen as a system and its sub-systems in
the previous two designs. It is more detailed towards modules and their implementations.
It defines logical structure of each module and their interfaces to communicate with other
modules.
It uses the concept of abstraction for writing the stepwise procedures of the modules.
Structured English or pseudo codes are generally used for writing the specifications of
detailed designing.
A designer always tries to produce a good design. The definition of “a good software
design” can vary depending on the application being designed. For example, the memory
size used by a program may be an important issue to characterize a good solution for
embedded software development – since embedded applications are often required to be
implemented using memory of limited size due to cost, space, or power consumption
considerations.
For embedded applications, one may sacrifice design comprehensibility to achieve code
compactness. For embedded applications, factors as design comprehensibility may take a
back seat while judging the goodness of design.
Therefore, the criteria used to judge how good a given design solution is can vary widely
depending upon the application. Not only is the goodness of design dependent on the
targeted application, but also the notion of goodness of a design itself varies widely across
software engineers and academicians.
However, most researchers and software engineers agree on a few desirable
Characteristics that every good software design for general application must possess. The
characteristics are listed below:
o Correctness: The software, which we are making, should meet all the
specifications stated by the customer.
o Usability/Learn ability: The amount of efforts or time required to learn how to
use the software should be less. This makes the software user-friendly even for IT-
illiterate people.
3
Software Engineering, Subject code: 17CS601, Unit -3
o Integrity: Just as medicines have side-effects, in the same way software may have
a side-effect i.e. it may affect the working of another application. But quality
software should not have side effects.
o Reliability: The software product should not have any defects. Not only this, it
shouldn't fail while execution.
o Efficiency: This characteristic relates to the way software uses the available
resources. The software should make effective use of the storage space and execute
command as per desired timing requirements.
o Security: With the increase in security threats nowadays, this factor is gaining
importance. The software shouldn't have ill effects on data / hardware. Proper
measures should be taken to keep data secure from external threats.
o Safety: The software should not be hazardous to the environment/life. Possibly the
most important goodness criterion is design correctness. A design has to be correct
to be acceptable. Given that a design solution is correct, understand ability of a
design is possibly the most important issue to be considered while judging the
goodness of a design.
o Maintainability: Maintenance of the software should be easy for any kind of user.
o Flexibility: Changes in the software should be easy to make.
o Extensibility: It should be easy to increase the functions performed by it.
o Scalability: It should be very easy to upgrade it for more work (or for more number
of users).
o Testability: Testing the software should be easy.
o Modularity: Any software is said to make of units and modules which are
independent of each other. These modules are then integrated to make the final
software. If the software is divided into separate independent parts that can be
modified, tested separately, it has high modularity.
o Interoperability: Interoperability is the ability of software to exchange
information with other applications and make use of information transparently.
o Reusability: If we are able to use the software code with some modifications for
different purpose then we call software to be reusable.
o Portability: The ability of software to perform same functions across all
environments and platforms, demonstrate its portability.
A design that is easy to understand is also easy to develop, maintain and change. Thus,
unless a design is easily understandable, it would require tremendous effort to implement
and maintain it.
3. What are design principle of a good software? Explain
Software design is one of the important phases in SDLC that is performed to shape the
solution to a problem. There are certain design concepts and principles that govern the
building of quality of software design.
4
Software Engineering, Subject code: 17CS601, Unit -3
The design concepts and principles remain the same for all kinds of application system
development, irrespective of the design techniques. Some of the common concepts of
Software design are
1. Abstraction
2. Information Hiding
3. Functional Decomposition
4. Design Strategies
5. Modular Design
1. Abstraction:
5
Software Engineering, Subject code: 17CS601, Unit -3
The common features in the subparts are accumulated in a group that
represents functional abstraction. Examples are Function prototype,
function call, closed subroutines
o Data Abstraction:
Data abstraction specifies the entities or data objects that provide certain
services to the external environment.
In data Abstraction, Essential details are given and the detailed views are
suppressed. That is it hides the representation and implementation details of
data objects.
Abstract Data Types (ADTs), such as structures in c, classes in C++ and
packages in java are the examples of data abstraction.
o Control Abstraction:
Parnas initially proposed the concept of information hiding in 1972 and he suggested that
modules can be characterized by the design decisions in which each module hides the
details from other modules.
That is, making the essential details inaccessible to others to prevent unauthorized access
and damage from the external environment.
The design Modules of the software interact with other modules through interfaces by
passing arguments
The main information that can be hidden includes data structures using ADT, Procedures
or Algorithms processes for the execution, input/output formats, policy and mechanism
etc.
Information hiding is an important design principle which is expressed through
encapsulation and abstraction. Encapsulation is a programming language such as C++,
Java, etc.
Data and functions are encapsulated through access specifies within objects that provide
abstraction by hiding the detailed information.
6
Software Engineering, Subject code: 17CS601, Unit -3
Objects share information to some extent depending upon the programming features. For
example, access specifiers like private, public and protected allow required data and
services from objects.
3. Functional Decomposition:
Functional Decomposition is the process of partioning a large and complex problem into
small, manageable, and understandable pieces.
The goal of functional decomposition is to make the maintenance task easier, to make it
easy to understand and develop software in an efficient manner.
It is performed using abstraction and information hiding. The decomposition process uses
“Divide and conquer” approach to divide the software into independent parts.
When these parts are combined together, they act together to achieve the goal of the
software. The problem is initially considered as a single function with its essential details
and later it is elaborated into discrete and small pieces.
Functional decomposition divides a large problem into successfully smaller until the
functional level achieved.
7
Software Engineering, Subject code: 17CS601, Unit -3
Bottom-up Design
The bottom up design model starts with most specific and basic components. It proceeds
with composing higher level of components by using basic or lower level components. It
keeps creating higher level components until the desired system is not evolved as one single
component. With each higher level, the amount of abstraction is increased.
Bottom-up strategy is also referred to as layers of abstraction are piecing together the
subsystems to form the whole systems. It starts with the lower-level subsystems at the
bottom level which are the individual elements in the system.
Bottom-up strategy is more suitable when a system needs to be created from some existing
system, where the basic primitives can be used in the newer system.
Both, top-down and bottom-up approaches are not practical individually. Instead, a good
combination of both is used.
5. Modular Design
8
Software Engineering, Subject code: 17CS601, Unit -3
Modularity
Modularity has been influential for the programming languages that support abstract data
types, object oriented designs, component based development, and the principles of
software architectures,
Modularity plays an important role in architectural design of software. Nowadays it
becomes a desirable feature in a system. Modularization is the process of breaking a system
into pieces called modules so that these can be managed and implemented. A module is a
part of software system that can be separately implemented and a change in module has an
effect on other modules.
Thus a modular system consists of various modules linked via interfaces. An interface is a
kind of link or relationship that combines two or more modules together. Modularity is the
measurement of modularization of a system into pieces.
Modularization
This is a technique to divide a software system into multiple discrete and independent
modules, which are expected to be capable of carrying out task(s) independently.
These modules may work as basic constructs for the entire software. Designers tend to
design modules such that they can be executed and/or compiled separately and
independently.
Modular design unintentionally follows the rules of ‘divide and conquer’ problem-solving
strategy this is because there are many other benefits attached with the modular design of
software.
Advantages of Modularization
9
Software Engineering, Subject code: 17CS601, Unit -3
10
Software Engineering, Subject code: 17CS601, Unit -3
Control coupling: Control coupling exists when one module controls the flow of another
by passing control information such as a flag set or switch statements. Control coupling
controls the sequence of instruction execution in another module. For example, a flag
variable decides what function or module is to be executed next.
External Coupling: External Coupling occurs when two modules share an externally
imposed data format, communication protocol, or device interface. All the modules share
the same I/O device or the external environment.
Common Coupling: Common coupling is when two modules share common data (e.g.,
a global variable). In C language, all modules in the program access external data items.
If there is any change in the shared resource, it influences all the modules using it.
Content coupling – It is the highest coupling (worst).Content coupling exists between
two modules when one module refers or shares its internal working with another module.
Accessing local data items or instructions of another module is an example of content
coupling. When a module can directly access or modify or refer to the content of another
module, it is called content level coupling
5. What do you mean by Cohesion? Explain in details.
Cohesion in a single module is the degree to which the elements of a single module are
functionally related to achieve an object.
Module cohesion represents how tightly bound the internal elements of the module are to
one another. Higher cohesion is preferred for an effective modular design.
Generally, whenever cohesion is greater, coupling between the modules is lower.
Cohesion between the elements of module is measured in terms of strength of the hiding
of the elements within module itself.
Functional Cohesion is the strongest (best) and Coincidental Cohesion is the weakest
(worst) level of cohesion. The ratings of the common categories of cohesion ranked from
the strongest (best) to the weakest (Worst).
There are many different levels of cohesion used at several levels of a module, such as
11
Software Engineering, Subject code: 17CS601, Unit -3
Structured analysis is used to carry out the top-down decomposition of a set of high-level
functions depicted in the problem description and to represent them graphically.
During structured analysis, functional decomposition of the system is achieved. That is,
each function that the system performs is analyzed and hierarchically decomposed into
more detailed functions.
12
Software Engineering, Subject code: 17CS601, Unit -3
The DFD (also known as a bubble chart) is a hierarchical graphical model of a system that
shows the different processing activities or functions that the system performs and the data
interchange among these functions.
Each function is considered as a processing station (or process) that consumes some input
data and produces some output data. The system is represented in terms of the input data
to the system, various processing carried out on these data, and the output data generated
by the system.
Symbols used in construction of DFD
There are essentially five different types of symbols used for construction of DFDs. The
symbols are as follows:
Function symbol :
A function is represented by a circle. This symbol is called bubble or process.
External entity symbols.
The external entities are those physical entities external to the s/w system which interact
with the system by inputting data to the system or by consuming the data produced by the
system. In addition, these symbols can be used to represent external h/w and s/w that would
interact with the s/w being modeled.
Data flow symbol :
A directed arc (arrow) is used for a data flow symbol. A data flow symbol represents the
data flow occurring between two processes or between an external entity and a process in
the direction of the flow of data.
Data store symbol :
A data store is represented by two parallel lines. It represents a logical file, where data
stored symbol can either be a data structure or a physical file on disk.
Output symbol:
The output symbol is used when a hardcopy is produced.
13
Software Engineering, Subject code: 17CS601, Unit -3
o If two bubbles are connected by a data flow arrow, they are synchronous i.e. they
operated at a same speed. For example : in the following example the data item act
as an input to read number, unless the output of read number generated the valid
number does not work as the output of the read number act as the input of valid
number.
o If two bubbles are connected through a data store, the speed of the operation of the
bubbles are independent i.e. asynchronous. In previous case the output of read
number is input of valid number but here the read number, read the number and
stored it in the database, which is later used by the validate number.
valid-number
number validate
number
Read
number
Data-item
Read valid-number
Data-item validate
number
number
number
o A data dictionary lists all data items appearing in the DFD model of a system. The
data items listed include all data flows and the contents of all data stores appearing
on the DFDs in the DFD model of a system.
14
Software Engineering, Subject code: 17CS601, Unit -3
o A data dictionary lists the purpose of all data items and the definition of all
composite data items in terms of their component data items.
o For the smallest units of data items, the data dictionary lists their name and their
type. Composite data items can be defined in terms of primitive data items using
the following data definition operators:
+: denotes composition of two data items, e.g. a + b represents data a and b.
[,,]: represents selection, i.e. any one of the data items listed in the brackets
can occur. For example, [a ,b] represents either a occurs or b occurs.
(): the contents inside the bracket represent optional data which may or may
not appear. e.g. a+(b) represents either a occurs or a + b occurs.
{}: represents iterative data definition, e.g. {name}5 represents five name
data.
{name}* represents zero or more instances of name data.
=: represents equivalence, e.g. a = b + c means that a represents b and c.
/* */: Anything appearing within /* and */ is considered as a comment.
A DFD model of a system graphically depicts the transformation of the data input to the
system to the final result through a hierarchy of levels.
A DFD starts with the most abstract definition of the system (lowest level) and at each
higher level DFD more details are successively introduced. To develop a higher-level DFD
model, processes are decomposed into their sub-processes and the data flow among these
sub-processes is identified.
To develop the data flow model of a system, first the most abstract representation of the
problem is to be worked out. The most abstract representation of the problem is also called
the context diagram. After, developing the context diagram, the higher-level DFDs have to
be developed.
Context diagram
The context diagram is the most abstract data flow representation of a system. It represents
the entire system as a single bubble. This bubble is labeled according to the main function
of the system.
The various external entities with which the system interacts and the data flow occurring
between the system and the external entities are also represented. The data input to the
system and the data output from the system are represented as incoming and outgoing
arrows.
15
Software Engineering, Subject code: 17CS601, Unit -3
These data flow arrows should be annotated with the corresponding data names. The name
‘context diagram’ is well justified because it represents the context in which the system is
to exist, i.e. the external entities who would interact with the system and the specific data
items they would be supplying the system and the data items they would be receiving from
the system. The context diagram is also called as the level 0 DFD.
To develop the context diagram of the system, it is required to analyze the SRS document
to identify the different types of users who would be using the system and the kinds of data
they would be inputting to the system and the data they would be receiving the system.
Here, the term “users of the system” also includes the external systems, which supply data
to or receive data from the system.
The bubble in the context diagram is annotated with the name of the software system being
developed (usually a noun). This is in contrast with the bubbles in all other levels, which
are annotated with verbs. This is expected since the purpose of the context diagram is to
capture the context of the system rather than its functionality.
Decomposition
Each bubble in the DFD represents a function performed by the system. The bubbles are
decomposed into sub-functions at the successive levels of the DFD.
Decomposition of a bubble is also known as factoring or exploding a bubble. Each bubble
at any level of DFD is usually decomposed to anything between 3 to 7 bubbles.
Example:
RMS calculating Software
A software system called RMS calculating software would read three integral numbers from
the user in the range of -1000 and 1000 and would determine the root mean square of the
three input numbers and display it.
The context diagram of the system accept three integers form the user and return the result to him.
This is shown in the following figure as context diagram.
User
Data-items rms
rms
calculator
0
16
Software Engineering, Subject code: 17CS601, Unit -3
To draw the level 1 DFD, from an analysis of the problem description, there are three basic
functions that the system needs to perform i.e.,
1. Validate the input
2. Calculate the rms i.e., root mean square of the input numbers
3. Display result
Based on the sequence of the functions, the number / labels like 0.1, 0.2, 0.3 assigned to the
functions. After representing the functions the level 1 DFD looks as follows:
rms
To draw level 2 DFD, we have to consider a function in level 1 and then decompose the function
in to lower level. In this case, the function 0.2 is considered for decomposition. The following
figure display the level 2 DFD
Square
0.2.3
S q u a r e
0 . 2 . 1
csq
Square
0.2.2
S q u a r e
bsq
0 . 2 . 1
Square Mean
0.2.1 0.2.4
asq msq
S q u a r e
0 . 2 . 1
Root rms
0.2.5
S q u a r e
0 . 2 . 1
17
Software Engineering, Subject code: 17CS601, Unit -3
Data_items: {integer}3
rms: float
valid-data: data-items
a: integer
b: integer
c: integer
asq: integer
bsq: integer
csq: integer
msq: integer
The aim of structured design is to transform the results of the structured analysis (i.e. a
DFD representation) into a structure chart. Structured design provides two strategies to
guide transformation of a DFD into a structure chart.
Transform analysis
Transaction analysis
Normally, one starts with the level 1 DFD, transforms it into module representation using
either the transform or the transaction analysis and then proceeds towards the lower-level
DFDs.
At each level of transformation, it is important to determine whether the transform or the
transaction analysis is applicable to a particular DFD.
Transform analysis
Transform analysis identifies the primary functional components (modules) and the high
level inputs and outputs for these components. The first step in transform analysis is to
divide the DFD into 3 types of parts:
Input
Logical processing
Output
18
Software Engineering, Subject code: 17CS601, Unit -3
The input portion of the DFD includes processes that transform input data from physical
(e.g. character from terminal) to logical forms (e.g. internal tables, lists, etc.). Each input
portion is called an afferent branch.
The output portion of a DFD transforms output data from logical to physical form. Each
output portion is called an efferent branch. The remaining portion of a DFD is called the
central transform.
In the next step of transform analysis, the structure chart is derived by drawing one
functional component for the central transform, and the afferent and efferent branches.
These are drawn below a root module, which would invoke these modules.
Identifying the highest level input and output transforms requires experience and skill. One
possible approach is to trace the inputs until a bubble is found whose output cannot be
deduced from its inputs alone.
Processes, which validate input or add information to them are not central transforms.
Processes, which sort input or filter data from it are. The first level structure chart is
produced by representing each input and output unit as boxes and each central transform
as a single box.
In the third step of transform analysis, the structure chart is refined by adding sub-functions
required by each of the high-level functional components. Many levels of functional
components may be added. This process of breaking functional components into
subcomponents is called factoring.
Factoring includes adding read and write modules, error-handling modules, initialization
and termination process, identifying customer modules, etc. The factoring process is
continued until all bubbles in the DFD are represented in the structure chart.
Transaction Analysis
A transaction allows the user to perform some meaningful piece of work. Transaction
analysis is useful while designing transaction processing programs. In a transaction-driven
system, one of several possible paths through the DFD is traversed depending upon the
input data item.
This is in contrast to a transform centered system which is characterized by similar
processing steps for each data item. Each different way in which input data is handled is a
transaction. A simple way to identify a transaction is to check the input data.
The number of bubbles on which the input data to the DFD are incident defines the number
of transactions. However, some transaction may not require any input data. These
transactions can be identified from the experience of solving a large number of examples.
For each identified transaction, trace the input data to the output. All the traversed bubbles
belong to the transaction.
These bubbles should be mapped to the same module on the structure chart. In the structure
chart, draw a root module and below this module draw each identified transaction a
19
Software Engineering, Subject code: 17CS601, Unit -3
module. Every transaction carries a tag, which identifies its type. Transaction analysis uses
this tag to divide the system into transaction modules and a transaction-center module.
20
Software Engineering, Subject code: 17CS601, Unit -3
Main
RMS
Validate Input Compute RMS Write Result
In the above diagram, it is observed that the top most node is main. This is also called as
root.
In the next level, the system is divided into three modules or functions such as validate
input, compute RMS and write result.
The next level, the function validate input is decomposed into two more sub-functions such
as read input and validate input.
This expression helps the programmers or the coder to know about the functions they
implement and finally the product will take a shape.
In traditional approach of designing, we use DFD with its different levels and later
structured chart is designed based on DFD. The structured chart help the programmer to
do coding based on this.
In traditional approach, the main program is divided into modules or functions. The
modules are designed separately and finally combine to obtain the whole system.
However, in object oriented system, the designing is quite different. In this approach, the
class diagram is the main unit to develop and it is the base on which the whole system is
designed.
Object oriented design has become a popular design methodology in the recent years. It
works around the entities and their characteristics instead of functions involved in the
software system. This design strategy focuses on entities and its characteristics. The whole
concept of software solution revolves around the engaged entities.
21
Software Engineering, Subject code: 17CS601, Unit -3
22
Software Engineering, Subject code: 17CS601, Unit -3
language, UML has its own syntax (symbols and sentence formation rules) and semantics
(meanings of symbols and sentences).
Also, we should clearly understand that UML is not a system design or development
methodology, but can be used to document object-oriented and analysis results obtained
using some methodology.
In the late 1980s and early 1990s, there was a proliferation of object-oriented design
techniques and notations. Different software development houses were using different
notations to document their object-oriented designs. These diverse notations used to give
rise to a lot of confusion.
UML was developed to standardize the large number of object-oriented modeling notations
that existed and were used extensively in the early 1990s
23
Software Engineering, Subject code: 17CS601, Unit -3
User’s view:
This view defines the functionalities (facilities) made available by the system to its
users. The users’ view captures the external users’ view of the system in terms of the
functionalities offered by the system.
The users’ view is a black-box view of the system where the internal structure, the
dynamic behavior of different system components, the implementation etc. are not
visible.
The users’ view is very different from all other views in the sense that it is a functional
model compared to the object model of all other views. The users’ view can be
considered as the central view and all other views are expected to conform to this view.
This thinking is in fact the crux of any user centric development style.
Structural view:
The structural view defines the kinds of objects (classes) important to the
understanding of the working of a system and to its implementation.
It also captures the relationships among the classes (objects). The structural model is
also called the static model, since the structure of a system does not change with time.
Behavioral view:
The behavioral view captures how objects interact with each other to realize the system
behavior. The system behavior captures the time-dependent (dynamic) behavior of the
system.
Implementation view:
This view captures the important components of the system and their dependencies.
Environmental view:
This view models how the different components are implemented on different pieces of
hardware.
13. What do you mean by Use Case Diagram? Explain with an example
The use case model for any system consists of a set of “use cases”. Intuitively, use
cases represent the different ways in which a system can be used by the users. Use
cases correspond to the high-level functional requirements.
The use cases partition the system behavior into transactions, such that each transaction
performs some useful action from the user’s point of view. To complete each
transaction may involve either a single message or multiple message exchanges
between the user and the system to complete.
The purpose of a use case is to define a piece of coherent behavior without revealing
the internal structure of the system. The use cases do not mention any specific
algorithm to be used or the internal data representation, internal structure of the
software, etc.
A use case typically represents a sequence of interactions between the user and the
system. These interactions consist of one mainline sequence. The mainline sequence
24
Software Engineering, Subject code: 17CS601, Unit -3
represents the normal interaction between a user and the system. The mainline
sequence is the most occurring sequence of interaction. The variations are also called
alternative paths. A use case can be viewed as a set of related scenarios tied together
by a common goal. The mainline sequence and each of the variations are called
scenarios or instances of the use case. Each scenario is a single path of user events and
system activity through the use case.
Use cases can be represented by drawing a use case diagram and writing an
accompanying text elaborating the drawing. In the use case diagram, each use case is
represented by an ellipse with the name of the use case written inside the ellipse.
All the ellipses (i.e. use cases) of a system are enclosed within a rectangle which
represents the system boundary. The name of the system being modeled (such as
Library Information System) appears inside the rectangle.
The different users of the system are represented by using the stick person icon. Each
stick person icon is normally referred to as an actor. An actor is a role played by a user
with respect to the system use. It is possible that the same user may play the role of
multiple actors.
Each actor can participate in one or more use cases. The line connecting the actor and
the use case is called the communication relationship. It indicates that the actor makes
use of the functionality provided by the use case. Both the human users and the external
systems can be represented by stick person icons. When a stick person icon represents
an external system, it is annotated by the stereotype <<external system>>.
Text Description: Each ellipse on the use case diagram should be accompanied by a
text description. The text description should define the details of the interaction
between the user and the computer and other aspects of the use case. It should include
all the behavior associated with the use case. The behavior description is often written
in a conversational style describing the interactions between the actor and the system.
Actors: In addition to identifying the actors, some information about actors using this
use case which may help the implementation of the use case may be recorded.
Pre-condition: The preconditions would describe the state of the system before the
use case execution starts.
Post-condition: This captures the state of the system after the use case has successfully
completed.
Non-functional requirements: This could contain the important constraints for the
design and implementation
Exceptions, error situations: This contains only the domain-related errors such as
lack of user’s access rights, invalid entry in the input fields, etc. Obviously, errors that
are not domain related, such as software errors, need not be discussed here.
Sample dialogs: These serve as examples illustrating the use case.
Specific user interface requirements: These contain specific requirements for the
user interface of the use case. For example, it may contain forms to be used, screen
shots, interaction style, etc.
25
Software Engineering, Subject code: 17CS601, Unit -3
26
Software Engineering, Subject code: 17CS601, Unit -3
The text description of the use case add member is described as follows:
Text description
U1: Add membership: using this use case, the Librarian add the member to the library list by
the information provided by them.
1. User : request the librarian to add them as a member in the library system
2. Librarian: display prompt to enter information like name, address, registration number
3. User: enter necessary information
4. Librarian: display the generated id and add the user as a member for the library system.
4. Librarian: display the message that the user has already registered.
4. Librarian: Display message that some input information have not been entered or entered
as wrong and ask the user to reenter the same information.
27
Software Engineering, Subject code: 17CS601, Unit -3
Like the above use case description, the text description for each use cases need to be
written for the clarity of the use case mentioned.
14. Discuss the different types of diagrams in structural view with example.
The structural view gives us an idea about the structure of the program. In object oriented
system, the class diagram is the basic unit and the object diagram gives an instance of the
class diagram.
Class diagram
A class diagram describes the static structure of a system. It shows how a system is
structured rather than how it behaves. The static structure of a system comprises of a
number of class diagrams and their dependencies.
The main constituents of a class diagram are classes and their relationships: generalization,
aggregation, association, and various kinds of dependencies.
Classes
The classes represent entities with common features, i.e. attributes and operations. Classes
are represented as solid outline rectangles with compartments. Classes have a mandatory
name compartment where the name is written centered in boldface.
The class name is usually written using mixed case convention and begins with an
uppercase. The class names are usually chosen to be singular nouns. Classes have optional
attributes and operations compartments. A class may appear on several diagrams. Its
attributes and operations are suppressed on all but one diagram.
Attributes
An attribute is a named property of a class. It represents the kind of data that an object
might contain. Attributes are listed with their names, and may optionally contain
specification of their type, an initial value, and constraints.
The type of the attribute is written by appending a colon and the type name after the
attribute name. Typically, the first letter of an attribute name is a small letter.
Operation
Operation is the implementation of a service that can be requested from any object of the
class to affect behavior. An object’s data or state can be changed by invoking an operation
of the object. A class may have any number of operations or no operation at all.
Typically, the first letter of an operation name is a small letter. Abstract operations are
written in italics. The parameters of an operation (if any), may have a kind specified, which
may be ‘in’, ‘out’ or ‘in-out’. An operation may have a return type consisting of a single
return type expression.
28
Software Engineering, Subject code: 17CS601, Unit -3
Association
Associations are needed to enable objects to communicate with each other. An association
describes a connection between classes. The association relation between two objects is
called object connection or link. Links are instances of associations.
A link is a physical or conceptual connection between object instances. Usually, an
association is a binary relation (between two classes). However, three or more different
classes can be involved in an association.
A class can have an association relationship with itself (called recursive association). In
this case, it is usually assumed that two different objects of the class are linked by the
association relationship.
Association between two classes is represented by drawing a straight line between the
concerned classes. The name of the association is written along side the association line.
An arrowhead may be placed on the association line to indicate the reading direction of the
association.
The arrowhead should not be misunderstood to be indicating the direction of a pointer
implementing an association. On each side of the association relation, the multiplicity is
noted as an individual number or as a value range. The multiplicity indicates how many
instances of one class are associated with each other. Observe that associations (and links)
appear as verbs in the problem statement.
Aggregation
Aggregation is a special type of association where the involved classes represent a whole-
part relationship. The aggregate takes the responsibility of forwarding messages to the
appropriate parts.
Thus, the aggregate takes the responsibility of delegation and leadership. When an instance
of one object contains instances of some other objects, then aggregation (or composition)
relationship exists between the composite object and the component object. Aggregation is
represented by the diamond symbol at the composite end of a relationship.
Aggregation relationship cannot be reflexive (i.e. recursive). That is, an object cannot
contain objects of the same class as itself. Also, the aggregation relation is not symmetric.
That is, two classes A and B cannot contain instances of each other. However, the
aggregation relationship can be transitive. In this case, aggregation may consist of an
arbitrary number of levels.
Composition
Composition is a stricter form of aggregation, in which the parts are existence-dependent
on the whole. This means that the life of the parts closely ties to the life of the whole. When
the whole is created, the parts are created and when the whole is destroyed, the parts are
destroyed.
A typical example of composition is an invoice object with invoice items. As soon as the
invoice object is created, all the invoice items in it are created and as soon as the invoice
object is destroyed, all invoice items in it are also destroyed. The composition relationship
is represented as a filled diamond drawn at the composite-end.
29
Software Engineering, Subject code: 17CS601, Unit -3
From the diagram, it is found out that there are 11 different classes are there such as Library
catalog, Library employee, Library, Book, Librarian, Library clerk, Member, Reference
book, Course book, Student, Member, and Employee.
Each class diagram consist of three parts. First part gives an information about the name
of the class, the second section inform about the data member of class and the third section
inform about the member functions in the class.
The data member inform about the data member and the return types like Name is of String
type. ‘-’ sign inform about the access specifier, the ‘-’ indicates that the access specifier is
private.
The member functions mentioned has ‘+’ mark at the start, which informs that the function
has an access specifier public.
The classes are associated with different relations like association, aggregation and
composition mentioned by the arrows connecting the classes.
Object diagram
30
Software Engineering, Subject code: 17CS601, Unit -3
Object diagrams can be described as an instance of class diagram. So these diagrams are
more close to real life scenarios where we implement a system. Object diagrams are a set
of objects and their relationships just like class diagrams and also represent the static view
of the system.
The usage of object diagrams is similar to class diagrams but they are used to build
prototype of a system from practical perspective.
The following example explain about the object diagram.
From the diagram is observed that “CSIT : Library ”, it informs that the CSIT is an object
of class Library.
Similarly the object name is mentioned than ‘:’ and finally the class name to inform that
the object belongs the class name.
A sequence diagram shows interaction among objects as a two dimensional chart. The chart
is read from top to bottom. The objects participating in the interaction are shown at the top
of the chart as boxes attached to a vertical dashed line. Inside the box the name of the object
is written with a colon separating it from the name of the class and both the name of the
object and the class are underlined.
The objects appearing at the top signify that the object already existed when the use case
execution was initiated. However, if some object is created during the execution of the use
case and participates in the interaction (e.g. a method call), then the object should be shown
at the appropriate place on the diagram where it is created.
vertical dashed line is called the object’s lifeline. The lifeline indicates the existence of the
object at any particular point of time. The rectangle drawn on the lifetime is called the
activation symbol and indicates that the object is active as long as the rectangle exists.
Each message is indicated as an arrow between the lifeline of two objects. The messages
are shown in chronological order from the top to the bottom. That is, reading the diagram
from the top to the bottom would show the sequence in which the messages occur.
Each message is labeled with the message name. Some control information can also be
included. Two types of control information are particularly valuable.
31
Software Engineering, Subject code: 17CS601, Unit -3
A condition (e.g. [invalid]) indicates that a message is sent, only if the condition
is true.
An iteration marker shows the message is sent many times to multiple receiver
objects as would happen when a collection or the elements of an array are being
iterated. The basis of the iteration can also be indicated
The above diagram inform about the class name at the top of each lifeline inside a rectangle
box.
The dotted line is the life line for the class element. When a class send a message to another
class, it perform that through an arrow with a label mentioned to that.
32
Software Engineering, Subject code: 17CS601, Unit -3
prefixed with sequence numbers because they are only way to describe the relative
sequencing of the messages in this diagram.
The second interaction diagram is collaboration diagram. It shows the object organization
as shown below. Here in collaboration diagram the method call sequence is indicated by
some numbering technique as shown below.
The number indicates how the methods are called one after another. We have taken the same
order management system to describe the collaboration diagram. The method calls are
similar to that of a sequence diagram.
But the difference is that the sequence diagram does not describe the object organization
whereas the collaboration diagram shows the object organization. Now to choose between
these two diagrams the main emphasis is given on the type of requirement.
If the time sequence is important then sequence diagram is used and if organization is
required then collaboration diagram is used. An interaction diagram emphasizes the
structural organization of the objects that send and receive messages.
The following diagram gives an example of collaboration diagram:
It is found out from above diagram that the steps needed is number from one to n. The
step one is first executed then the next step until the last one.
The collaboration diagram is quite same as that of sequence diagram, the only
difference between these two diagram is the way they represent.
In sequence diagram, the object are shown with their life lines and the communication
in carried out between two objects.
33
Software Engineering, Subject code: 17CS601, Unit -3
Order received
Unprocessed order
The activity diagram is one modelling element which was not present in any of the
predecessors of UML. No such diagram is present either in the works of Booch, Jacobson,
or Rambaugh. It is possibly based on the event diagram of Odell.
The diagram focuses on representing various activities or chunks of processing and their
sequence of activation. An activity is a state with an internal action and one or more
outgoing transactions, which automatically follow the termination of the internal process.
Activity diagrams are similar to that of procedural flow charts. The main difference is that
activity diagram support description of parallel activity and synchronization aspects
involved in different activities.
Parallel activities are represented on an activity diagram by using swim lanes. Swim lanes
enables us to group activities based on who is performing them. Thus, swim lane subdivide
activities based on the responsibilities of some components.
The activity diagram are normally employed in business processing modelling. This is
carried out in the initial phase or requirement analysis and specification. It can be very
much useful in understanding complex processing activities involving the role played by
many components.
The following diagram gives an example of activity diagram.
35
Software Engineering, Subject code: 17CS601, Unit -3
36
Software Engineering, Subject code: 17CS601, Unit -3
It shows the configuration of run-time processing nodes and the components that are part
of them. Deployment diagrams are used to visualize the topology of the physical
components of a system where the software components are deployed.
So deployment diagrams are used to describe the static deployment view of a system.
Deployment diagrams consist of nodes and their relationships.
So the usage of deployment diagrams can be described as follows:
To model the hardware topology of a system.
To model embedded system.
To model hardware details for a client/server system.
To model hardware details of a distributed application.
Forward and reverse engineering.
The following diagram gives an example of deployment diagram
37
Software Engineering, Subject code: 17CS601, Unit -3
OOA focuses on the problem domain and OOD concentrates on the solution domain. OOA
and OOD help OOP in implementation of the system. Thus, OOA, OOD, and OOP work
together for the development of software system.
Thus, object-oriented software development employs OOA, OOD, and OOP. Development
of software using object-oriented analysis and object-oriented design methods is pictorially
as shown below:
The main activities of OOSD are as follows
Project Initiation
Requirement Engineering
System Design
Object Design
Implementation
Testing
Deployment
A project is initiated when a need emerges in the society for the automation of the
organizational activities. Needs are converted into the problem statement either by the
development team, especially through the project manager, or by the customer, especially
by the end user.
During requirement engineering, requirements are discovered, analyzed, and specified in
the requirements document.
The solution for a system is planned keeping in view the aspects of user and system
requirements. The main focus of system design is to decide the overall structure ad style
of the system architecture.
38
Software Engineering, Subject code: 17CS601, Unit -3
Object design maps the analysis model to implementation of subsystems. It provides the
basis of implementation but it is the not actual implementation in any programming
language.
Implementation is the phase of translating design into coding. Object-oriented
programming languages such as C++, Java, Smalltalk, etc., are used for coding. The
implementation phase covers the implementation of data structures for attributes and
methods for operations in the object diagrams.
There exist various object-oriented design tools that produce object oriented source codes
in an abstract form. In this case, mapping approaches are used for mapping the designs into
codes. These are model transformations, refactoring, forward engineering and reverse
engineering.
Source codes are tested to uncover errors, faults, and failures in the system. Various
components are tested separately to detect any unusual behavior in the system. Thereafter,
testing is performed in an integrated environment on the system as a whole.
39
Software Engineering, Subject code: 17CS601, Unit -3
Software architecture is the overall design of some common patterns. The understanding
of architectural paradigm can help to p [produce a new system from the existing system.
Software architecture plays the role of a bridge between requirements and implementation.
Deciding the right architecture is crucial to the success of the most software systems. For
example, this is one of the reasons of the success of UNIX operating system as compared
to other operating systems.
40
Software Engineering, Subject code: 17CS601, Unit -3
Management: A bad Architecture will always need much effort in managing and leading
to the success of a project. The right architecture is critical to the success of the product
development and product. The right architecture also helps in understanding requirements,
Implementation strategies, and Maintenance and potential risks.
The following table lists architectural styles that can be organized by their key focus area
Deployment
3-tier or N-tier Separates the functionality into
separate segments with each
segment being a tier located on a
physically separate computer.
41
Software Engineering, Subject code: 17CS601, Unit -3
---
Weblinks:
1.[Link]
2. [Link]
Important questions
42
Software Engineering, Subject code: 17CS601, Unit -3
43