CH 5 Analysis and Design Tools
CH 5 Analysis and Design Tools
Condition
Condition Statements
Entry
OR
Stub
Conditions
(CS)
(SE)
Notes:
(NB)
The entries in decision table are given by Decision Rules which define the
relationships between combinations of conditions and courses of action. In rules
section,
Y shows the existence of a condition.
N represents the condition, which is not satisfied.
A blank - against action states it is to be ignored.
X (or a check mark will do) against action states it is to be carried out
Decision Tree:
Decision trees are a graphical representation of decision tables.
Their purpose is to aid the construction of decision tables.
In fact decision tables and decision trees are means of expressing process logic.
They my therefore be used in conjunction with or in place of flow chart or pseudo
code.
For Example:
A co-operative bank XYZ will grant loans under the following conditions:
1. If a customer has an account with the bank and has no loan outstanding, then
loan will be granted.
2. If a customer has an account with the bank but some amount is outstanding
from previous loans, then loan will be granted if special management approval
is obtained.
3. Reject loan applications in all other cases.
Ans:
Step – 2 Combine conditions which only describe the only two possibilities of a single
condition.
There are four possible combinations in this case:
Rules Condition Action
(CE)
(AE)
Yes (Y) or
For each No (N) or
condition in the Irrelevant (-)
condition stub in the condition
entry
X (Applicable)
For each action or
in the action -(Blank)
stub in the action
entry
then it is ‘ Limited Action entry D. T.’
Note: With a limited entry table the statement of condition or action is completely
contained in the appropriate stubs themselves.
For Example:
The discount policy of a manufacturer producing two products:
1. Mechanical Typewriter and
2. Electronic typewriter and who has three types of customers (R) Retailers, (D)
Dealers, (I) institutions is given below.
Rules:
1. If the order is from retailer for amount up to Rs. 5000/- he allows 6% discount
2. If the order is from dealer for amount up to Rs. 5000/-, 7.5% discount is given.
3. On retail order exceeding Rs. 5000/-, 7.5 % discount is given
4. If the order exceeding for an amount exceeding Rs. 5000/-, 11% discount is allowed.
5. In all the above cases a flat discount of 7.5% is given to institutions.
6. In the case of electronic typewriter a flat discount of 6% is given regardless of amount
or customer.
Ans:
Limited Entry Decision Table for Discount Policy
C1: PRODUCT = 1? Y Y Y Y Y N
C2: CUSTOMER = R? Y - Y - - -
C3: CUSTOMER = D? - Y - Y - -
A1: DISCOUNT 6% X - - - - X
C3: ORDER AMOUNT <= 5000 <= 5000 >5000 > 5000 - -
Note: Limited entry format and extended entry format can both be used in single
table for individual conditions or actions. Where a table contains both type of
format, it is called a “MIXED ENTRY D.T.”
6. It is used for simple logic only. It can be used for complex logic as well.
Note – 1 :
These symbols are not standardized. Different books use different symbols with
minor variations.
Note – 2:
The process represented by a circle is also known as “BUBBLE”. (Hence DFDs are
sometimes referred as “BUBBLE DIAGRAMS”)
Examples:
2. DFD For Library Management System:
Level 0 DFD –
Level 1 DFD –
At this level, the system has to show or exposed with more details of processing.
The processes that are important to be carried out are:
Book delivery
Search by topic
List of authors, List of Titles, List of Topics, the bookshelves from which books can be
located are some information that is required for these processes. Data store is used to
represent this type of information.
Level 2 DFD –
This diagram serves as the main idea that reveals the main process, users, and data that
roam the system. The college system’s external entities are as follows:
College Administrator
Teacher
Students
In an information system, input is the raw data that is processed to produce output.
During the input design, the developers must consider the input devices such as PC,
MICR, OMR, etc.
Therefore, the quality of system input determines the quality of system output. Well-
designed input forms and screens have following properties −
It should serve specific purpose effectively such as storing, recording, and
retrieving the information.
It ensures proper completion with accuracy.
It should be easy to fill and straightforward.
It should focus on user’s attention, consistency, and simplicity.
All these objectives are obtained using the knowledge of basic design principles
regarding −
What are the inputs needed for the system?
How end users respond to different elements of forms and screens.
The design of output is the most important task of any system. During output design,
developers identify the type of outputs needed, and consider the necessary output
controls and prototype report layouts.
Objectives of Output Design
The objectives of output design are −
To develop output design that serves the intended purpose and eliminates the
production of unwanted output.
To develop the output design that meets the end users requirements.
To deliver the appropriate quantity of output.
To form the output in appropriate format and direct it to the right person.
To make the output available on time for making good decisions.
Let us now go through various types of outputs −
External Outputs:
Manufacturers create and design external outputs for printers. External outputs enable
the system to leave the trigger actions on the part of their recipients or confirm actions
to their recipients.
Some of the external outputs are designed as turnaround outputs, which are
implemented as a form and re-enter the system as an input.
Internal outputs:
Internal outputs are present inside the system, and used by end-users and managers.
They support the management in decision making and reporting.
There are three types of reports produced by management information −
Detailed Reports − They contain present information which has almost no
filtering or restriction generated to assist management planning and control.
Summary Reports − They contain trends and potential problems which are
categorized and summarized that are generated for managers who do not want
details.
Exception Reports − They contain exceptions, filtered data to some condition or
standard before presenting it to the manager, as information.
Output Integrity Controls:
Output integrity controls include routing codes to identify the receiving system, and
verification messages to confirm successful receipt of messages that are handled by
network protocol.
Printed or screen-format reports should include a date/time for report printing and the
data. Multipage reports contain report title or description, and pagination. Pre-printed
forms usually include a version number and effective date.
2. Conditional Call:
It represents that control module can select any of the sub module on the basis of
some condition.
3. Loop (Repetitive call of module)
It represents the repetitive execution of module by the sub module.
A curved arrow represents loop in the module.
All the sub modules cover by the loop repeat execution of module.
4. Data Flow:
It represents the flow of data between the modules. It is represented by directed
arrow with empty circle at the end.
5. Control Flow:
It represents the flow of control between the modules. It is represented by directed
arrow with filled circle at the end.
6. Physical Storage
Physical Storage is that where all the information are to be stored.
These type of structure chart are designed for the systems that receives an input which
is transformed by a sequence of operations being carried out by one module.
Both coupling and cohesion are important factors in determining the maintainability,
scalability, and reliability of a software system. High coupling and low cohesion can
make a system difficult to change and test, while low coupling and high cohesion make a
system easier to maintain and improve.
Coupling:
Coupling refers to the degree of interdependence between software modules. High
coupling means that modules are closely connected and changes in one module may
affect other modules. Low coupling means that modules are independent and changes in
one module have little impact on other modules.
Coupling is the measure of the degree of interdependence between the modules. A good
software will have low coupling.
Types of Coupling:
Data Coupling:
If the dependency between the modules is based on the fact that they communicate by
passing only data, then the modules are said to be data coupled. In data coupling, the
components are independent of each other and communicate through data. Module
communications don’t contain tramp data. Example-customer billing system.
Stamp Coupling:
In stamp coupling, the complete data structure is passed from one module to another
module. Therefore, it involves tramp data. It may be necessary due to efficiency factors-
this choice was made by the insightful designer, not a lazy programmer.
Control Coupling:
If the modules communicate by passing control information, then they are said to be
control coupled. It can be bad if parameters indicate completely different behavior and
good if parameters allow factoring and reuse of functionality. Example- sort function
that takes comparison function as an argument.
External Coupling:
In external coupling, the modules depend on other modules, external to the software
being developed or to a particular type of hardware. Ex- protocol, external file, device
format, etc.
Common Coupling:
The modules have shared data such as global data structures. The changes in global data
mean tracing back to all modules which access that data to evaluate the effect of the
change. So it has got disadvantages like difficulty in reusing modules, reduced ability to
control data accesses, and reduced maintainability.
Content Coupling:
In a content coupling, one module can modify the data of another module, or control
flow is passed from one module to the other module. This is the worst form of coupling
and should be avoided.
Temporal Coupling:
Temporal coupling occurs when two modules depend on the timing or order of events,
such as one module needing to execute before another. This type of coupling can result
in design issues and difficulties in testing and maintenance.
Sequential Coupling:
Sequential coupling occurs when the output of one module is used as the input of
another module, creating a chain or sequence of dependencies. This type of coupling can
be difficult to maintain and modify.
Communicational Coupling:
Communicational coupling occurs when two or more modules share a common
communication mechanism, such as a shared message queue or database. This type of
coupling can lead to performance issues and difficulty in debugging.
Functional Coupling:
Functional coupling occurs when two modules depend on each other’s functionality,
such as one module calling a function from another module. This type of coupling can
result in tightly-coupled code that is difficult to modify and maintain.
Data-Structured Coupling:
Data-structured coupling occurs when two or more modules share a common data
structure, such as a database table or data file. This type of coupling can lead to
difficulty in maintaining the integrity of the data structure and can result in
performance issues.
Interaction Coupling:
Interaction coupling occurs due to the methods of a class invoking methods of other
classes. Like with functions, the worst form of coupling here is if methods directly
access internal parts of other methods. Coupling is lowest if methods communicate
directly through parameters.
Component Coupling:
Component coupling refers to the interaction between two classes where a class has
variables of the other class. Three clear situations exist as to how this can happen.
A class C can be component coupled with another class C1, if C has an instance variable
of type C1, or C has a method whose parameter is of type C1,or if C has a method which
has a local variable of type C1. It should be clear that whenever there is component
coupling, there is likely to be interaction coupling.
Cohesion:
Cohesion is a measure of the degree to which the elements of the module are
functionally related.
It is the degree to which all elements directed towards performing a single task are
contained in the component.
Basically, cohesion is the internal glue that keeps the module together. A good software
design will have high cohesion.
Types of Cohesion:
Functional Cohesion:
Every essential element for a single computation is contained in the component. A
functional cohesion performs the task and functions. It is an ideal situation.
Sequential Cohesion:
An element outputs some data that becomes the input for other element, i.e., data flow
between the parts. It occurs naturally in functional programming languages.
Communicational Cohesion:
Two elements operate on the same input data or contribute towards the same output
data. Example- update record in the database and send it to the printer.
Procedural Cohesion:
Elements of procedural cohesion ensure the order of execution. Actions are still weakly
connected and unlikely to be reusable. Ex- calculate student GPA, print student record,
calculate cumulative GPA, print cumulative GPA.
Temporal Cohesion:
The elements are related by their timing involved. A module connected with temporal
cohesion all the tasks must be executed in the same time span. This cohesion contains
the code for initializing all the parts of the system. Lots of different activities occur, all at
unit time.
Logical Cohesion:
The elements are logically related and not functionally. Ex- A component reads inputs
from tape, disk, and network. All the code for these functions is in the same component.
Operations are related, but the functions are significantly different.
Coincidental Cohesion:
The elements are not related(unrelated). The elements have no conceptual relationship
other than location in source code. It is accidental and the worst form of cohesion. Ex-
print next line and reverse the characters of a string in a single component.
Procedural Cohesion:
This type of cohesion occurs when elements or tasks are grouped together in a module
based on their sequence of execution, such as a module that performs a set of related
procedures in a specific order. Procedural cohesion can be found in structured
programming languages.
Communicational Cohesion:
Communicational cohesion occurs when elements or tasks are grouped together in a
module based on their interactions with each other, such as a module that handles all
interactions with a specific external system or module. This type of cohesion can be
found in object-oriented programming languages.
Temporal Cohesion:
Temporal cohesion occurs when elements or tasks are grouped together in a module
based on their timing or frequency of execution, such as a module that handles all
periodic or scheduled tasks in a system. Temporal cohesion is commonly used in real-
time and embedded systems.
Informational Cohesion:
Informational cohesion occurs when elements or tasks are grouped together in a
module based on their relationship to a specific data structure or object, such as a
module that operates on a specific data type or object. Informational cohesion is
commonly used in object-oriented programming.
Functional Cohesion:
This type of cohesion occurs when all elements or tasks in a module contribute to a
single well-defined function or purpose, and there is little or no coupling between the
elements. Functional cohesion is considered the most desirable type of cohesion as it
leads to more maintainable and reusable code.
Layer Cohesion:
Layer cohesion occurs when elements or tasks in a module are grouped together based
on their level of abstraction or responsibility, such as a module that handles only low-
level hardware interactions or a module that handles only high-level business logic.
Layer cohesion is commonly used in large-scale software systems to organize code into
manageable layers.
Advantages of low coupling:
Improved maintainability:
Low coupling reduces the impact of changes in one module on other modules, making it
easier to modify or replace individual components without affecting the entire system.
Enhanced modularity:
Low coupling allows modules to be developed and tested in isolation, improving the
modularity and reusability of code.
Better scalability:
Low coupling facilitates the addition of new modules and the removal of existing ones,
making it easier to scale the system as needed.