Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 38

ADITYA COLLEGE OF ENGINEERING &

TECHNOLOGY

SOFTWARE TESTING METHODOLOGIES


By

Asst.Prof.A.MOHAN
Dept of Information Technology
Aditya College of Engineering & Technology
Surampalem.
Aditya College of Engineering & Technology

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Objective of the class

• Logic Based Testing:


• Overview
• Decision Tables
• Path Expressions
• KV Charts, and Specifications.
SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21
Aditya College of Engineering & Technology

Overview
• Logic-based testing :
Logic-based testing is structural testing when it's applied to structure
(e.g., control flow graph of an implementation); it is functional testing
when it is applied to a specification.
• In logic-based testing we focus on the truth values of control flow
predicates.
• Logic-based testers design tests from logical expressions that appear
in software artifacts such as source code, design models, and
requirements specifications.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Overview
• Programmers and logic: Logic is used in a program by programmers.
Boolean algebra is the way to work with logic – simplification &
calculation.
• Hardware logic testing :Hardware logic test design tools and methods
use logic & Boolean algebra.
• Specification Systems and Languages: The trouble with specifications
is that they're hard to express. Boolean algebra is the most basic of all
logic systems. Higher order logic systems are used for formal
specifications. The tools to simplify, transform and check specs use
Boolean algebra.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Overview
• Knowledge based systems and artificial intelligence systems use high
level logic languages which are based on rule bases consisting of
rules. Rules are predicate expressions containing domain knowledge
related elements combined with logical connectives. The answers to
queries (problems) are derived based on Boolean algebraic operations
performed on the rule bases. Such programs are called inference
engines.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Decision Tables
• A matrix representation of the logic of a decision .
• Specifies the possible conditions and the resulting actions .
• Best used for complicated decision logic.
• It consists of four areas called the condition stub, the condition entry,
the action stub, and the action entry.
• Each column of the table is a rule that specifies the conditions under
which the actions named in the action stub will take place.
• The condition stub is a list of names of conditions.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Decision Tables

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Decision Tables

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Decision Tables
• A rule specifies whether a condition should or should not be met for
the rule to be satisfied. "YES" means that the condition must be met,
"NO" means that the condition must not be met, and "I" means that
the condition plays no part in the rule, or it is immaterial to that rule.
The action stub names the actions the routine will take or initiate if
the rule is satisfied.
• If the action entry is "YES", the action will take place; if "NO", the
action will not take place.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Decision Tables
• Example : How to make Decision Base Table for Login Screen
• Let's create a decision table for a login screen.
• The condition is simple if the user provides correct username and
password the user will be redirected to the homepage. If any of the
input is wrong, an error message will be displayed.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Decision Tables

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Decision Tables
• Advantages of Decision Table Testing
• When the system behavior is different for different input and not same for a
range of inputs, both equivalent partitioning, and boundary value analysis
won't help, but decision table can be used.
• The representation is simple so that it can be easily interpreted and is used
for development and business as well.
• This table will help to make effective combinations and can ensure a better
coverage for testing .
• Any complex business conditions can be easily turned into decision tables.
Disadvantages of Decision Table Testing
• The main disadvantage is that when the number of input increases the table
will become more complex
SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21
Aditya College of Engineering & Technology

Decision Tables
• DECISION-TABLE PROCESSORS:
• Decision tables can be automatically translated into code and, as
such, are a higher-order language .
• If the rule is satisfied, the corresponding action takes place
Otherwise, rule 2 is tried. This process continues until either a
satisfied rule results in an action or no rule is satisfied and the default
action is taken .
• Decision tables have become a useful tool in the programmers kit, in
business data processing.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Decision Tables
• DECISION-TABLES AND STRUCTURE:

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Decision Tables

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Decision Tables
Expansion of I state:

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Path Expressions
• Logic-based testing is structural testing when it's applied to structure
(e.g., control flow graph of an implementation); it's functional testing
when it's applied to a specification.
• In logic-based testing we focus on the truth values of control flow
predicates.
• A predicate is implemented as a process whose outcome is a truth-
functional value. For our purpose, logic-based testing is restricted to
binary predicates.
• We start by generating path expressions by path tracing as , but this
time, our purpose is to convert the path expressions into boolean
algebra, using the predicates' truth values (e.g., A and A’ ) as weights.
SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21
Aditya College of Engineering & Technology

Path Expressions
• A Boolean algebra consists of:
• a set B={0, 1},
• 2 binary operations on B (denoted by + & ×),
• a unary operation on B (denoted by '),
such that : 0 + 0 = 0
• 0×0=0
• 1+0=1
• 0×1=0
• 0+1=1
• 1×0=0
• 1+1=1
• 1×1=1
• 0’=1 and 1’=0.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Path Expressions

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Path Expressions

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Path Expressions

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Path Expressions

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

KV Charts
• INTRODUCTION: If you had to deal with expressions in four, five, or
six variables, you could get bogged down in the algebra and make as
many errors in designing test cases as there are bugs in the routine
you're testing.
• Karnaugh-Veitch chart reduces boolean algebraic manipulations to
graphical trivia.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

KV Charts

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

KV Charts
• SINGLE VARIABLE: Figure shows all the boolean functions of a single
variable and their equivalent representation as a KV chart.
• The charts show all possible truth values that the variable A can have.
• A "1" means the variable’s value is "1" or TRUE. A "0" means that the
variable's value is 0 or FALSE.
• The entry in the box (0 or 1) specifies whether the function that the
chart represents is true or false for that value of the variable.
• We usually do not explicitly put in 0 entries but specify only the
conditions under which the function is true.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

KV Charts

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

KV Charts
• Each box corresponds to the combination of values of the variables
for the row and column of that box.
• A pair may be adjacent either horizontally or vertically but not
diagonally.
• Any variable that changes in either the horizontal or vertical direction
does not appear in the expression.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

KV Charts

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

KV Charts
• KV charts for three variables are shown in fig.
• As before, each box represents an elementary term of three variables
with a bar appearing or not appearing according to whether the row-
column heading for that box is 0 or 1.
• A three-variable chart can have groupings of 1, 2, 4, and 8 boxes.
• The “Don’t Care” conditions allow us to replace the empty cell of a
 K-Map to form a grouping of the variables.
• A Don’t Care cell can be represented by a cross(X) in K-Maps
representing a invalid combination.

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

KV Charts

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

KV Charts
• Minimise the following function in SOP minimal form using K-Maps: 
F(A, B, C, D) = m(1, 2, 6, 7, 8, 13, 14, 15) + d(0, 3, 5, 12) .

f = AC'D' + A'D + A'C + AB

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

KV Charts
• Canonical SOP expression is represented by summation sign ∑ and
minterms in the braces for which the output is true.
• F = ∑( m1, m2, m3, m5 )
• F = A̅B̅C + A̅BC̅ + A̅BC + AB̅C

• The product of Sum form is a form in which products of different sum


terms of inputs are taken
• F              =             ∏ (M0, M4, M6, M7)
• F              =             (B+C) (A̅+B̅+C)(A̅+B̅+C)̅

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

THANK YOU

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21


Aditya College of Engineering & Technology

Any queries ?

SOFTWARE TESTING METHODOLOGIES Asst.Prof. A.MOHAN 7/10/21

You might also like