0% found this document useful (0 votes)
26 views

Unit 3 Logic Modelling

The document provides an overview of logic modeling techniques, focusing on decision tables, decision trees, structured English, and data dictionaries. It explains the structure, advantages, disadvantages, and applications of decision tables and trees, along with their terminologies and examples. Additionally, it discusses the role of structured English in programming and the importance of data dictionaries in managing data definitions and metadata.

Uploaded by

DEEP ESHH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Unit 3 Logic Modelling

The document provides an overview of logic modeling techniques, focusing on decision tables, decision trees, structured English, and data dictionaries. It explains the structure, advantages, disadvantages, and applications of decision tables and trees, along with their terminologies and examples. Additionally, it discusses the role of structured English in programming and the importance of data dictionaries in managing data definitions and metadata.

Uploaded by

DEEP ESHH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

BCA III – SAD Compiled By: GIRIJA 1

Unit-3 Logic Modelling [3Hrs]


a. Decision Table
b. Decision Tree
c. Structured English
d. Data Dictionary

A. Decision Table
 A Decision Table is a systematic representation of decision-making processes,
designed to help organize complex logical rules and conditions. It is particularly useful
in decision support systems and logic modeling. Decision Tables present a clear and
structured way to handle combinations of conditions and corresponding actions or
outcomes.
 A decision table is a table that indicates conditions and actions in a simplified and
orderly manner.
 Decision tables are used to model complicated logic. It shows that all possible
combinations of conditions have been considered and when conditions are not met,
it is easy to see.
 A decision table can be described as cause-effect table and is the best way to deal with
combination inputs with their associated outputs.
 It is an excellent tool to use in both testing and requirements management. Using
decision tables it become easier for the requirements specialist to write requirements
which cover all conditions.

Parts of Decision Tables :


The decision table has 4 parts which are divided into portions and are given below :

1. Condition Stubs : The conditions are listed in this first upper left part of the decision table
that is used to determine a particular action or set of actions.
2. Action Stubs : All the possible actions are given in the first lower left portion (i.e, below
condition stub) of the decision table.
BCA III – SAD Compiled By: GIRIJA 2

3. Condition Entries: In the condition entry, the values are inputted in the upper right
portion of the decision table. In the condition entries part of the table, there are multiple
rows and columns which are known as Rule.
4. Action Entries: In the action entry, every entry has some associated action or set of
actions in the lower right portion of the decision table and these values are called outputs.

Types of Decision Tables:


The decision tables are categorized into two types and these are given below:
1. Limited Entry: In the limited entry decision tables, the condition entries are restricted to
binary values.

2. Extended Entry: In the extended entry decision table, the condition entries have more
than two values. The decision tables use multiple conditions where a condition may have
many possibilities instead of only ‘true’ and ‘false’ are known as extended entry decision
tables.

Advantages of Decision Table:


 Decision rules are clearly structured.
 Easy to use.
 Easier to draw or modify in comparison to flowcharts.
 They provide more compact documentation.
 Documentation is easily prepared, changed or updated.
 Decision tables can be changed easily according to the situation.
 Decision tables summarize all the outcomes of a situation and suggest suitable actions.
 Decision tables have a standard format.

Disadvantages Of Decision Tables:


 Decision tables do not show the flow of logic for the solution to a given problem.
 Decision table cannot list all alternatives.
 Not easy to translate it.
 Impose an additional burdens.
 Decision tables only present a partial solution.

Importance of Decision Table


Decision tables are very helpful in test design techniques.
1. Helps testers to search effects of combinations: It helps testers to search the effects of
combinations of different inputs and other software states that must correctly implement
business rules.
2. Helps to start complex business rules: It provides a regular way of starting complex
business rules that is helpful for developers as well as for testers.
3. Helps in the development process: It assists in the development process with the
developer to do a better job. Testing with all combinations might be impractical.
BCA III – SAD Compiled By: GIRIJA 3

4. Used in testing: A decision table is basically an outstanding technique used in both testing
and requirements management.
5. Helps to prepare requirements: It is a structured exercise to prepare requirements when
dealing with complex business rules.
6. Helps to model complicated logic: It is also used to model complicated logic.

Symbols in a Decision Table:

 "X" or "T": Represents a condition being true or an action to be taken.


 "-": Represents a condition being false or no action to be taken.

Example:
Create decision table based on below conditions

 Customers who order more than Rs.1000 will get 5% discount and additional 5%
discount and if they used our charge card.
 Customers who do not order more than Rs. 1000 will get Rs. 25 coupons
 All other customers receive Rs.5 coupon.

Sales Promotion Policy

1 2 3 4 5
Preferred Customer Y Y Y Y N
Order more than Rs. 1000 Y Y N N Y
Used our charge card Y N Y N Y
5% Discount X X - - -
Additional 5% Discount X - - - -
Rs. 25 Bonus coupon - - X - -
Rs. 5 Bonus coupon - - - X X
Steps:
1. Place the name of the process in a heading at the top left.
2. Enter the conditions under the heading, with one condition per line,
3. Enter all potential combinations of Y/N (for yes and no) for the conditions. Each
column represents a numbered possibility called a rule.
4. Place an X in the action entries area for each rule to indicate whether to accept or
reject the order

B. Decision Tree
 A decision tree is a decision tool that uses a branching method to illustrate every
possible outcome of a decision.
 Decision trees can be drawn by hand or created with a graphics program or specialized
software. A decision tree begins with a single node, which have branches into possible
BCA III – SAD Compiled By: GIRIJA 4

outcomes. Each of those outcomes results to additional nodes, which branch off into
other possibilities. This gives it a tree-like shape.
 In decision tree (tree structure), the nodes representing the place where we pick an
attribute and ask a question; edge represents the answers to the question and the
leaves represent the actual output.
 Decision trees demonstrate cause-effect relationships, which provides a simplified
view of complicated process.
Basic assumptions for creating a decision tree:
 At the beginning, all possible set is taken as root.
 Records are distributed recursively on the basis of attribute values.
 Order to placing attributes as root or internal node of the tree is used to define the
problem.

Decision Tree Terminologies


Some of the common Terminologies used in Decision Trees are as follows:
 Root Node: It is the topmost node in the tree, which represents the complete dataset. It
is the starting point of the decision-making process.
 Decision/Internal Node: A node that symbolizes a choice regarding an input feature.
Branching off of internal nodes connects them to leaf nodes or other internal nodes.
 Leaf/Terminal Node: A node without any child nodes that indicates a class label or a
numerical value.
 Splitting: The process of splitting a node into two or more sub-nodes using a split criterion
and a selected feature.
 Branch/Sub-Tree: A subsection of the decision tree starts at an internal node and ends at
the leaf nodes.
 Parent Node: The node that divides into one or more child nodes.
 Child Node: The nodes that emerge when a parent node is split.
 Information Gain: Information gain is a measure of the reduction in impurity achieved by
splitting a dataset on a particular feature in a decision tree. The splitting criterion is
determined by the feature that offers the greatest information gain, It is used to
determine the most informative feature to split on at each node of the tree, with the goal
of creating pure subsets
 Pruning: The process of removing branches from the tree that do not provide any
additional information or lead to overfitting.
BCA III – SAD Compiled By: GIRIJA 5

Decision Tree

Advantages of Decision Trees:


 Versatility: Suitable for both classification and regression tasks, handling continuous
and discrete values effectively.
 Simplicity: Easy to understand and requires minimal effort for algorithm
comprehension.
 Efficiency: Faster and more efficient than some alternatives like KNN in classification.
 No Feature Transformation: Doesn't require feature transformation for non-linear
data.
 Versatile Data Handling: Handles numerical, categorical, and Boolean data without
the need for normalization.
 Attribute Importance: Provides insights into the relative importance of attributes.
 Data Exploration: Efficient for identifying significant variables and relationships in data
exploration.
 Less Data Preparation: Requires minimal data preparation as it is not affected by
missing data.
 Non-Parametric: Non-parametric method with no assumptions about spatial
distribution and classifier structure.

Disadvantages of Decision Trees:


 Time Complexity: Time-consuming for large datasets with millions of records,
especially for numerical variable splits.
 Training Time Complexity: Time-consuming as the number of features increases.
 Overfitting Concerns: Prone to overfitting, but can be addressed with constraints,
pruning, and ensemble methods.
 Reusability Challenges: Small variations in data can result in complex and different
trees, mitigated by techniques like bagging and boosting.
 Big Data Limitation: Inefficient for big data, as a single tree may grow excessively,
leading to complexity and overfitting.
BCA III – SAD Compiled By: GIRIJA 6

Example:
(Decision tree according to above decision table)

Difference between Decision Table and Decision Tree:

S. No. Decision Table Decision Tree

Decision Tables are a tabular Decision Trees are a graphical


1. representation of conditions and representation of every possible
actions. outcome of a decision.

We can derive a decision table from We can not derive a decision tree from
2.
the decision tree. the decision table.

It helps to take into account the


3. It helps to clarify the criteria. possible relevant outcomes of the
decision.
BCA III – SAD Compiled By: GIRIJA 7

In Decision Tables, we can include In Decision Trees, we can not include


4.
more than one ‘or’ condition. more than one ‘or’ condition.

It is used when there are small It is used when there are more number
5.
number of properties. of properties.

6. It is used for simple logic only. It can be used for complex logic as well.

7. It is constructed of rows and tables. It is constructed of branches and nodes.

A decision tree’s objective is to provide


The goal of using a decision table is
an effective means to visualize and
the generation of rules for structuring
8. understand a decision’s available
logic on the basis of data entered in
possibilities and range of possible
the table.
outcomes

C. Structure English
Structured English uses a simple English language to make structured programming easier for non-
professionals. The program is divided into various parts that are known as logical statements. These
statements are written in a simple English language.

Structured English is typically used for expressing logic with minimum complexity. Lower-level systems
usually require higher clarity and precision. This is achieved by decision tables and decision trees.

 Structured English is similar to programming language such as Pascal,


 It Does not have strict syntax rules as programming language,
 Intention is to give precise description of a process,
 The Structured English description should be understandable to the user,

Elements of Structured English


Structured English can be considered a pseudo-code, in a limited form. It is made up of various
elements.
The order in which the statement is executed is from the first line of code to the last line.
Language is mainly made of Conditional blocks and repetition blocks. Keywords such as, IF,
END IF, THEN, and ELSE are used to indicate the conditional statements. Additionally, the
keywords such as DO, WHILE, and UNTIL are used to indicate repetition statements.
BCA III – SAD Compiled By: GIRIJA 8

Example:

Same structured English procedure given as decision table

Advantages:

 Clear & Readable: Easy to understand for anyone, regardless of background.


 Efficient & Accurate: Saves time and reduces misinterpretations.
 Better Analysis & Decisions: Simplifies complex logic for informed choices.
 Easier Documentation: Maintains consistency and clarity.
 Potential for Automation: Can generate code or technical artifacts.
BCA III – SAD Compiled By: GIRIJA 9

D. Data Dictionary
A Data Dictionary is a collection of names, definitions, and attributes about data elements
that are being used or captured in a database, information system, or part of a research
project. It describes the meanings and purposes of data elements within the context of a
project, and provides guidance on interpretation, accepted meanings and representation. A
Data Dictionary also provides metadata about data elements. The metadata included in a
Data Dictionary can assist in defining the scope and characteristics of data elements, as well
the rules for their usage and application.
What it does:

 Stores metadata: It doesn't hold the actual data itself, but rather information about
the data, like its name, data type, size, format, description, and constraints.
 Centralizes understanding: Provides a single source of truth for data definitions,
promoting consistency and shared understanding among developers, analysts, and
other stakeholders.
 Improves data management: Facilitates data governance, quality control, and
maintenance by keeping track of changes and relationships between data elements.

What's in a Data Dictionary?


Data dictionaries store and communicate metadata about data in a database, a system, or
data used by applications. A useful introduction to data dictionaries is provided in this video.
Data dictionary contents can vary but typically include some or all of the following:
 A listing of data objects (names and definitions)
 Detailed properties of data elements (data type, size, nullability, optionality, indexes)
 Entity-relationship (ER) and other system-level diagrams
 Reference data (classification and descriptive domains)
 Missing data and quality-indicator codes
 Business rules, such as for validation of a schema or data quality

Benefits:
 Improved communication: Ensures everyone speaks the same "data language" and
avoids misunderstandings.
 Reduced errors: Consistent data definitions minimize errors caused by
misinterpretations.
 Enhanced maintainability: Makes it easier to understand and modify the system's
data structure when needed.
 Better data quality: Facilitates enforcement of data rules and standards, leading to
cleaner and more reliable data.
These are some of the biggest benefits of using a data dictionary:
BCA III – SAD Compiled By: GIRIJA 10

 provides organized, comprehensive lists of data;


 easily searchable;
 provides reporting and documentation for data across multiple programs;
 simplifies the structure for system data requirements;
 reduces data redundancy;
 maintains data integrity across multiple databases; and
 Provides relationship information between different database tables.

For example, a commercial bank's database containing information about clients can have
attributes for client name, birth date, street address, financial savings, account and credit card
number, loans, etc.

Each attribute occupies a row in a spreadsheet, while various columns provide additional
elements that describe that attribute (whether it’s optional or required for a record, the type
of data, its location, etc.).

A data dictionary might look like the one below:

Types of Data Dictionary


1. Integrated Data Dictionary
2. Stand Alone Data Dictionary

1. Integrated Data Dictionary


Integrated Data Dictionary can be seen as a catalog that can be maintained by the relational
database. In previous databases, there is not any functionality of Integrated Data Dictionary,
so they use Stand Alone Data Dictionary.
There are two types of Integrated Data Dictionary.
BCA III – SAD Compiled By: GIRIJA 11

 Active Data Dictionary: Active Database Dictionary is a type of database that is updated
automatically in case any changes are to be done to the database. These are self-
updating.
 Passive Data Dictionary: Passive Databases are the databases that have to be
maintained or updated manually in case of any changes have been made to the system.

2. Stand Alone Data Dictionary


Stand Alone Data Dictionary is a type of flexible data dictionary as Database Administrator
has ease of managing data. It does not require data that is computer-based. It has no fixed
format. But some elements are common in this kind of database.
 Data Elements: It has the elements like name, datatype, validation rules, etc.
 Tables: These contain all the necessary information that is required for the table, how
many rows in the table, how many columns in the table, etc.
 Index: The index of the databases is to be stored here.
 Programs: These are used for accessing the database, and can include SQL Queries,
Reports, etc.
 Relationship between Data Elements: This stores the relationship among the different
databases, like cardinality, connectivity, etc.
BCA III – SAD Compiled By: GIRIJA 12

Assignment:
1. Define decision tables and explain how they are used to represent decision logic in
information systems.
2. Identify the key components of a decision table (conditions, actions, rules) and
explain their functionalities.
3. Describe the process of creating a decision table from a given scenario or set of rules.
4. Discuss the advantages and limitations of using decision tables compared to other
logic modeling techniques.
5. Define decision trees and explain their purpose in logic modeling.
6. Identify the different components of a decision tree (root node, internal nodes, leaf
nodes, branches) and explain their roles.
7. Describe the process of constructing a decision tree from a set of rules or a decision
table.
8. Compare and contrast decision trees and decision tables, highlighting their
advantages and disadvantages in different contexts.
9. Define structured English and explain its benefits in documenting system logic and
decision-making processes.
10. Describe the key characteristics and syntax rules of structured English, including
control structures (e.g., IF-THEN-ELSE, WHILE loops).
11. Create a structured English description for a simple decision-making process or
scenario.
12. Compare and contrast structured English with other logic modeling techniques like
decision tables and decision trees, considering their suitability for different
situations.
13. Define a data dictionary and explain its importance in information systems
development.
14. Identify the essential components of a data dictionary entry (e.g., data element
name, description, data type, format, source).
15. Describe the benefits of maintaining a well-defined and up-to-date data dictionary
for system development projects.

You might also like