Software Engineering
Software Engineering
CML
Module 4 Topics
1. Design activity & its objectives
2. Modularization techniques
2.1 Module Structure and its Representation
2.2 Interface and Information Hiding
2.3 Categories of Modules
2.4 Specific Techniques to Accommodate Change
2.5 Stepwise Refinement
2.6 Top-Down And Bottom-Up Design
3. Handling anomalies.
4. Function Oriented and Object Oriented Design.
5. Case Study with UML and CASE Tool support.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:1 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
pointer may be added to make it more efficient to move along the data structure from the leaves towards the
root of the tree. The pointer we add connects any node to its parent node, if there is any.
(a) (b)
Figure 4:- Two sample data structures representing a tree
c. Change of underlying abstract machine
The programs we write are run by some abstract (or virtual machine).Underlying abstract machine changes, the
changes may affect application.This can be new release of operating system, new optimizing compiler, new
version of DBMS
d.Change of peripheral devices
A change of peripheral devices is strongly related to a change of the underlying abstract machine.
e. Change of social environment
Design also changes due to change in social environment. Eg:- new tax regime.
f. Change due to the development process
Software is developed incrementally .New and old parts must fit together properly.
2. Product families
Changes consists of building new versions of the same software; every version constitutes an individual
product, but set of versions constitute a family.
Different versions of the same system are referred to as a Product family.
A good example of product family is the mobile phone. Manufacturers want to sell their phones in different
countries. The basic software that controls the phone is the same, but its interface to the environment depends
on the geographic location.
Refer Figure1 nodes represented by circles stand for intermediate design descriptions and nodes represented
by squares represent a complete, executable version of the software.
Figure 1(a) shows version 1 of the product by translating the requirements into design stage 1, then stage 2.
Figure1(b) represents version 2 which is developed by modifying version 1, intially the application is put in
the intermediate design stage represented by node 4 by deleting parts of the code of version 1; then it is
transformed into a fully operational version represented by node 5.
Figure 1(c) represents a branch representing a different version(version 3) which starts from node 3.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:2 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:3 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
Part of data design may occur in conjunction with the design of software architecture. More detailed data design
occurs as each software component is designed.
Architectural design.
2. Architectural design
The architectural design defines the relationship between major structural elements of the software, the design
patterns that can be used to achieve the requirements that have been defined for the system, and the constraints
that affect the way in which architectural design patterns can be applied. The architectural design representation
the framework of a computer-based systemcan be derived from the system specification, the analysis
model, and the interaction of subsystems defined within the analysis model.
3. Interface design
The interface design describes how the software communicates within itself, 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, data and control flow diagrams provide much of the information required for
interface design
4. Component-level design
The component-level design transforms structural elements of the software architecture
into a procedural description of software components.
2. Modularization techniques
2.1 Module Structure and its Representation
A module is a well-defined component of a software system.
A module can be a provider of computational resources or services.
When we decompose a system into modules , we must be able to describe the overall structure precisely.
It may be collection of routines, a collection of data , a collection of type definitions, or mixture of all of these.
Modular structure of a system can be described in terms of various types of mathematical relations. Let S be a
software system composed of modules M1, M2, . . ., Mn; that is
S = {M1, M2, . . ., Mn}
A relation r on S is a subset of S x S.
If two modules Mi and Mj are in S, we represent the fact that the pair <M i, Mj> is in r by using the infix notation
Mi r M j.
M
M1of a relation r on S is again a relation on S, written (r+ ). 1
Transitive closure
Mi r+ Mj iff Mi r Mj ( Mi and Mj are in S )
A relation is a hierarchy iff there are no cycles in the graph of the relation;
M1,2 this type of graph is called a directed
M1,1 M1,3
acyclic graph(DAG).
M2(a) M3
Figure 2 illustates generic graph and (b) represents a hierarchy, Directed acylic graph(DAG).
M1,2,1 M1,2,2
M4 M M1,2,1,1 M3 M2
5
M4
__________________________________________________________________________________________
M6
CS010 605 /SOFTWARE ENGINEERING Page No:4 Prepared By:
Merin Mary Philip
a) b)
Dept of Computer Science and Engineering
CML
Figure 2:Graph representation of a relation amongh modules (a) General Graph (b) Directed acylic graph(DAG)
There are different kinds of relation for describing the modular structure of a software system , we have to study
these relations:-
1. USES relation
2. IS_COMPONENT_OF relation
1. USES relation
We say Mi USES Mj if Mj requires the presence of M j, because Mj provides the resources that M i needs to
accomplish its task.
If Mi USES Mj , we say that Mi is client of Mj , since Mi requires the services that M j provides. Conversely, Mj is
called the server.
We define level of a module in a hierarchy r as follows:-
1. Mi has level 0 if no Mj exists s.t. Mi r Mj
2. For each module Mi, let k be the maximum level of all nodes M j s.t. Mi r Mj. Then Mi has level k+1
USES relation provides a way to reason about coupling in a precise manner. With reference to the USES graph,
we can distinguish between the number of otgoing edges of a module(called the modules fan-out) and the number of
incoming edges (called fan-in).
A high fan-in is an indication of good design because a module with high fan-in represents a general abstraction
that is used heavily by other modules.
2. IS_COMPONENT_OF relation
IS_COMPONENT_OF relation is used to describe a higher level module as constituted by a number of lower
level modules
A IS_COMPONENT_OF B, if B consists of several modules, of which one is A,
Inverse of IS_COMPONENT_OF relation is COMPRISES.
If A IS_COMPONENT_OF B , then we can tell that B COMPRISES A.
Another relation is IS_COMPOSED_OF relation A IS_COMPOSED_OF {B,C} if A is made by
combining B and C.
Inverse of IS_COMPOSED_OF is IMPLEMENTS relation.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:5 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:6 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
Modules can often be designed to export any combination of resources. The nature of the exported resources also
depends on what the programming language used to implement the modules actullay supports.
Categorization of modules is a step towards the development of standard software engineering components.
There are three standard categories of modules , they are:-
1. Procedural Abstractions (Functional modules)
2. Libraries
3. Common pools of data
Two more general and abstract categories are:-
4. Abstract objects
5. Abstract data types
1. Functional modules(Procedural Abstractions)
Functional modules are traditional form of modularization. It provides just a procedure or a function that implements
some abstract operation.They are used to encapsulate an algorithm.Eg. sorting module, fast Fourier transform module
2. Libraries
A group of related procedural abstractions. Modules of this type are used to package together a related set of routines. We
use the term library to denote this class of modules.e.g., mathematical libraries.
3. Common pools of data
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:7 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
Another common type of module provides a common pool of data. Once the need for sharing data among several
modules is recongnized, we can group such data together in a common pool that is imported by all client modules, which
are then allowed to manipulate the data direclty, according to the structure used to represent the data, which is visible to
them.Eg:-the COMMON construct in FORTRAN.
4. Abstract objects
Data structure hidden to clients . They have a permanent , hidden , encapsulated data structure in their implementation
part.This implementation is visible to routines that are visible to routines that are internal to module but is hidden from
client modules. These hidden data structure provides these modules with state.
5. Abstract data types
An abstract data-type module is a module that exports a type, along with the operations needed to access and manipulate
objects of that type; it hides the representation of the type and the algorithms used in the operations.
6. Generic modules (templates)
A generic module is not directly usable by clients.Its generally not a module but it can be described as a module
template.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:8 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
#ifdef hardware-2
...source fragment for hardware 2 ...
# endif
If , at compilation time, we specify switch D= hardware-1, only the code associated with hardware-1 will be compiled.
3. Software generation
Software generators are programs that build other programs. Example- A system for generating user interfaces that can be
found in most database management systems on personal computers.Changing the layout of screen according to users
taste can be accomplished quite easily and does not require coding. Compiler is another example of generators.There are
many generators inside a compiler. Input is Source program and output is Targeted Machine Code.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:9 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
P1;
while C loop
if C1 then P2,1 decomposed into selection
P2,1,1;
else
P2,1,2;
end if;
end loop;
P3;
Figure 5 shows the decomposition tree.
P
P P P
1 2 3
C
P
2,1
C not C
1 1
P P
2,1, 1 2,1, 2
Figure 5: Decomposition tree of above program
Top-Down Strategy
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:10 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
In top-down strategy, we recursively apply decomposition through IS_COMPOSED_OF, until we break down the
system into manageable components.
Stepwise refinement is intrinsically top-down.
Bottom-Up Strategy
In bottom-up strategy, we start from what we wish to encapsulate within a module, recursively defining an
abstract interface, and then grouping together several modules to form a single new, higher level module that
comprises them.
We should first recognize what we wish to encapsulate within a module and then provide an abstract interface to
define the modules boundaries as seen from the clients.
A typical design strategy that may proceed partly from the top-down and partly from the bottom-up , depending
on the phase of the design of the nature of the application being designed. This design strategy is called Yo-yo design.
Organizing documentation as a top-down flow may be useful for reading purposes, even if the process followed
was not top-down.
It starts by identifying the major components of the It starts with designing the most basic or primitive
system, decomposing them into their lower-level components and proceeds to higher-level components
components and iterating until the desired level of that use these lower-level components.
detail is achieved.
It starts from the highest level component of the It starts with the lowest level component of the
hierarchy and proceeds to lower levels. hierarchy and proceeds through progressively higher
levels.
Starting from an abstract design, in each step the Starting from the very bottom, operations that provide a
design is refined to a more concrete level, until we layer of abstraction are implemented, until the stage is
reach where no more refinement is needed and the reached where the operations supported by the layer are
design can be implemented directly. those desired by the system.
It is suitable only if the specifications are clearly It is suitable if a system is to be built from an existing
known. system.
It is suitable if a waterfall type of process model is It is suitable if an iterative enhancement type of process
being used. is being followed.
3. Handling anomalies
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:11 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
The designer must anticipate failures and plan to either avoid them or tolerate them. He must employ defensive
design.
Programs should continue to behave reasonably even in unexpected circumstances ie we should build robust
systems.
A module is anomalous if it fails to provide the service as expected and as specified in its interface.
The exceptions associated with a service denote the anomalies that may occur while that service is being
performed.
An exception must be raised when anomalous state is recognized.
Defensive design should distinguish between the correct behavior and the anamalous behavior of the module.
How can failures arise?
Module M should fail and raise an exception if
1. one of its clients does not satisfy the required protocol for invoking one of Ms services
2. M does not satisfy the required protocol when using one of its servers, and the server fails
3. hardware generated exception (e.g., division by zero)
What a module can do before failing?
Before failing, modules may try to recover from the anomaly by executing some exception handler (EH)
1. EH is a local piece of code that may try to recover from anomaly (if successful, module does not fail)
2. or may simply do some cleanup of the modules state and then let the module fail, signaling an exception
to its client.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:12 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
It contains a representation of each of the subsystems that enable the software to achieve
its customer-defined requirements and to implement the technical infrastructure that
supports customer requirements.
2. The class and object layer
It contains the class hierarchies that enable the system to be created using generalizations
and increasingly more targeted specializations. This layer also contains representations of
each object.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:13 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:14 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
system components: the problem domain component, the human interaction component, the task
management component, and the data management component.
v. The Wirfs-Brock method- Wirfs-Brock, Wilkerson, and Weiner define a continuum of technical tasks in
which analysis leads seamlessly into design. Protocols for each class are constructed by refining contracts
between objects.
4.2 Function Oriented Design
1. Design with functional units which transform inputs to outputs.
2. Function-Oriented Design is supported directly by most programming languages.
3. Most design methods are functional in their approach.
4. Main Function-Oriented Design concepts are cohesion and coupling.
5. Cohesion is the single-mindedness of a component.
6. It implies that a component or class encapsulates only attributes and operations that are closely related to one
another and to the class or component itself.
7. Kinds of cohesion
Sequential
Components or operations are grouped in a manner that allows the first to provide input to the next and so on in
order to implement a sequence of operations
Procedural
Components or operations are grouped in a manner that allows one to be invoked immediately after the preceding
one was invoked, even when no data passed between them
Temporal
Operations are grouped to perform a specific behavior
Utility
Components, classes, or operations are grouped within the same category because of similar general functions
but are otherwise unrelated to each other
8. Coupling is a qualitative measure of the degree to which operations and classes are connected to one another.
4.2.1 Components of Function-Oriented Design
1. Data-flow design
Model the data processing in the system using data-flow diagrams. Model the data processing in the
system using data-flow diagrams. They Are an integral part of many design methods
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:15 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
2. Structural decomposition
Model how functions are decomposed to sub-functions using graphical structure charts. Structural
decomposition is concerned with developing a model of the design which shows the dynamic structure
i.e. function calls.
In essence, a data flow diagram is converted to a structure chart.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:16 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
3. Detailed design
The entities in the design and their interfaces are described in detail. These may be recorded in a data
dictionary.
Concerned with producing a short design specification (minispec) of each function. This should describe
the processing, inputs and outputs.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:17 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
In this case, we will be designing a simple online shopping portal .The site will provide a soothing shopping experience
for customers. The system will allow more than one categories and different brands under the segment. The case will
trace the following sequence.
2. Scenario
A customer visits the online shopping portal. A customer may buy item or just visit the page and logout. The customer
can select a segment, then a category, and brand to get the different products in the desired brand. The customer can
select the product for purchasing. The process can be repeated for more items. Once the customer finishes selecting the
product/s the cart can be viewed , If the customer wants to edit the final cart it can be done here. For final payment the
customer has to login the portal, if the customer is visiting for the first time he must register with the site, else the
customer must use the login page to proceed. Final cart is submitted for payment and card details and address(where
shipment has to bemade) are be confirmed by the customer .Customer is confirmed with a shipment Id and delivery of
goods within 15 days.
3. Actors
Customer
Administrator
4. Functionality
a. Portal
Allows the customer to view the different categories and further to different products within the brands.
The portal provides a bill and an shipmentId which can be used to track the delivery status of the goods purchased by
the customer.
b. Customer
Customers when enter the site and view the various products in different category.
Authentication of the customer is done for the payment of the shopping done
Customer can browses through the products available in the shop, can select some of them and put into the shopping cart.
Customer can anytime change the items in the cart either by adding new items or by removing existing items. Customer
proceeds towards the payment counter. Finalize product list of items he finally wish to buy and make the final payment.
c. Administrator
Updates the details of the different category ,segments etc
Verifies the customer card details and records the details for shipment of goods.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:18 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:19 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:20 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:21 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:22 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:23 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
A set of portability services provides a bridge between CASE tools and their integration framework
and the environment architecture. Portability services allow CASE tools and their integration
framework to migrate across different hardware platforms and operating systems without significant
adaptive maintenance.
The integration framework is a collection of specialized programs that enables individual CASE tools
to communicate with one another, to create a project database, and to exhibit the same look and feel to
the end-user (the software engineer).
The relative levels of CASE integration are shown in Figure 10.2.
1 At the low end of the integration spectrum is the individual (point solution) tool. When
individual tools provide facilities for data exchange (most do), the integration level is improved
slightly. Such tools produce output in a standard format that should be compatible with other
tools that can read the format. In some cases, the builders of complementary CASE tools work
together to form a bridge between the tools (e.g., an analysis and design tool that is coupled with
a code generator). Using this approach, the synergy between the tools can produce end products
that would be difficult to create using either tool separately.
2 Single-source integration occurs when a single CASE tools vendor integrates a number of
different tools and sells them as a package. Although this approach is quite effective, the closed
architecture of most single-source environments precludes easy addition of tools from other
vendors.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:24 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
3 At the high end of the integration spectrum is the integrated project support environment (IPSE).
Standards for each of the building blocks described previously have been created. CASE tool vendors
use IPSE standards to build tools that will be compatible with the IPSE and therefore compatible with
one another.
(c) A TAXONOMY OF CASE TOOLS
CASE tools can be classified by function, by their role as instruments for managers or technical people,
by their use in the various steps of the software engineering process, by the environment architecture
(hardware and software) that supports them, or even by their origin or cost . The taxonomy presented here
uses function as a primary criterion.
1 Business process engineering tools
Business process engineering tools provide a "meta-model" from which specific information
systems are derived.
Business information is modeled as it moves between various organizational entities within a
company.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:25 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
The primary objective for tools in this category is to represent business data objects, their
relationships, and how these data objects flow between different business areas within a
company.
2 Process modeling and management tools
Process modeling tools (also called process technology tools) are used to represent the key
elements of a process so that it can be better understood.
These tools can also provide links to process descriptions that help those involved in the process
to understand the work tasks that are required to perform it.
Process management tools provide links to other tools that provide support to defined process
activities.
3 Project planning tools
Tools in this category focus on two primary areas: software project effort and cost estimation
and project scheduling.
Estimation tools compute estimated effort, project duration, and recommended number of people
for a project.
Project scheduling tools enable the manager to define all project tasks, create a task network,
represent task interdependencies, and model the amount of parallelism possible for the project.
4 Risk analysis tools
Risk analysis tools enable a project manager to build a risk table by providing detailed guidance
in the identification and analysis of risks.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:26 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:27 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
PRO/SIM (prototyping and simulation) tools provide the software engineer with the ability to
predict the behavior of a real-time system prior to the time that it is built.
In addition, these tools enable the software engineer to develop mock-ups of the real-time
system, allowing the customer to gain insight into the function, operation and response prior to
actual implementation.
15 Interface design and development tools
Interface design and development tools are actually a tool kit of software components (classes)
such as menus, buttons, window structures, icons, scrolling mechanisms, device drivers, and so
forth.
16 Prototyping tools
A variety of different prototyping tools can be used.
Screen painters enable a software engineer to define screen layout rapidly for interactive
applications.
A variety of fourth generation tools have prototyping features.
17 Programming tools
The programming tools category encompasses the compilers, editors, and debuggers that are
available to support most conventional programming languages.
18 Web development tools
The activities associated with Web engineering are supported by a variety of tools for WebApp
development.
These include tools that assist in the generation of text, graphics, forms, scripts, applets, and
other elements of a Web page.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:28 Prepared By:
Merin Mary Philip
Dept of Computer Science and Engineering
CML
Three different types of static testing tools are used in the industry: code based testing tools, specialized
testing languages, and requirements-based testing tools.
a) Code-based testing tools accept source code (or PDL) as input and perform a number of
analyses that result in the generation of test cases.
b) Specialized testing languages (e.g., ATLAS) enable a software engineer to write detailed
test specifications that describe each test case and the logistics for its execution.
c) Requirements-based testing tools isolate specific user requirements and suggest test
cases (or classes of tests) that will exercise the requirements.
21 Dynamic analysis tools
Dynamic testing tools interact with an executing program, checking path coverage, testing assertions
about the value of specific variables, and otherwise instrumenting the execution flow of the program.
Dynamic tools can be either intrusive or nonintrusive.
22 Test management tools
Test management tools are used to control and coordinate software testing for each of the major
testing steps.
Tools in this category manage and coordinate regression testing, perform comparisons that
ascertain differences between actual and expected output, and conduct batch testing of programs
with interactive human/computer interfaces.
23 Client/server testing tools
The c/s environment demands specialized testing tools that exercise the graphical user interface
and the network communications requirements for client and server.
24 Reengineering tools
The reengineering tools category can be subdivided into the following functions:
o Reverse engineering to specification tools take source code as input and generate
graphical structured analysis and design models, where-used lists, and other design
information.
o Code restructuring and analysis tools analyze program syntax, generate a control flow
graph, and automatically generate a structured program.
o On-line system reengineering tools are used to modify on-line database systems.
__________________________________________________________________________________________
CS010 605 /SOFTWARE ENGINEERING Page No:29 Prepared By:
Merin Mary Philip