0% found this document useful (0 votes)
16 views6 pages

Huangs Theorem

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

Huangs Theorem

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

HUANGS THEOREM

 EXAMPLE: Let A, B, C, be nonempty sets of character sequences whose smallest string


is at least one character long. Let T be a two-character string of characters. Then if T is a
substring of (i.e., if T appears within) AB nC, then T will appear in AB2C. (HUANG's
Theorem)
 Asanexample,let
A= pp
B= srr
C= rp
T= ss
The theorem states that ss will appear in pp(srr)nrp if it appears in pp(srr)2rp.
 However,let
A= p + pp + ps
B= psr + ps(r + ps)
C= rp
T= P4
Is it obvious that there is a p4 sequence in ABnC? The theorem states that we have only to
lookat
(p + pp + ps)[psr + ps(r + ps)]2rp
Multiplying out the expression and simplifying shows that there is no p4 sequence.
 Incidentally, the above observation is an informal proof of the wisdom of looping twice
discussed in Unit 2. Because data-flow anomalies are represented by two-character
sequences, it follows the above theorem that looping twice is what you need to do to find
such anomalies.

APPLICATIONS: * The purpose of the node removal algorithm is to present one very generalized
concept- the path expression and way of getting it. * Every application follows this common pattern:
1. Convert the program or graph into a path expression. 2. Identify a property of interest and derive
an appropriate set of "arithmetic" rules that characterizes the property. ||Replace the link names by
the link weights for the property of interest. The path expression has now been converted to an
expression in some algebra, such as 1. Ordinary algebra, regular expressions, or boolean algebra. This
algebraic expression summarizes the property of interest over the set of allpaths. 2. Simplify or
evaluate the resulting "algebraic" expression to answer the question you asked

EAN PROCESSING TIME OF A ROUTINE: Given the execution time of all statements or instructions for
every link in a flowgraph and the probability for each direction for all decisions are to find the mean
processing time for the routine as a whole. The model has two weights associated with every link:
the processing time for tMhat link, denoted by T, and the probability of that link P. The arithmetic
rules for calculating the mean time
EAN PROCESSING TIME OF A ROUTINE: Given the execution time of all statements or instructions for
every link in a flowgraph and the probability for each direction for all decisions are to find the mean
processing time for the routine as a whole. The model has two weights associated with every link:
the processing time for tMhat link, denoted by T, and the probability of that link P. The arithmetic
rules for calculating the mean time
EXAMPLE 1 (PUSH / POP): ß Here is the Pu

sh/Pop Arithmetic:
* 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.

The table in Figure 6.1 can be translated as follows:

Action 1 will take place if conditions 1 and 2 are met and if conditions 3 and 4 are not met (rule 1) or
if conditions 1, 3, and 4 are met (rule 2). **"Condition" is another word for predicate. ** Decision-
table uses "condition" and "satisfied" or "met". Let us use "predicate" and TRUE / FALSE. **Now the
above translations become: 1*. Action 1 will be taken if predicates 1 and 2 are true and if predicates
3 and 4 are false (rule 1), or if predicates 1, 3, and 4 are true (rule 2). 2.* Action 2 will be taken if the
predicates are all false, (rule 3). 3*. Action 3 will take place if predicate 1 is false and predicate 4 is
true (rule 4). ** In addition to the stated rules, we also need a Default Rule that specifies the default
action to be taken when all other rules fail.
DECISION-TABLES AS BASIS FOR TEST CASE DESIGN: 1. The specification is given as a decision table or
can be easily converted into one. 2. The order in which the predicates are evaluated does not affect
interpretation of the rules or the resulting action - i.e., an arbitrary permutation of the predicate
order will not, or should not, affect which action takes place. 3. The order in which the rules are
evaluated does not affect the resulting action - i.e., an arbitrary permutation of rules will not, or
should not, affect which action takes place. 4. Once a rule is satisfied and an action selected, no
other rule need be examined. 5. If several actions can result from satisfying a rule, the order in which
the actions are executed doesn't matter.

OVERVIEW OF LOGIC BASED TESTING: ∑ INTRODUCTION: **The functional requirements of many


programs can be specified by decision tables, which provide a useful basis for program and test
design. * Consistency and completeness can be analyzed by using boolean algebra, which can also be
used as a basis for test design. Boolean algebra is trivialized by using Karnaugh-Veitch charts.
* "Logic" is one of the most often used words in programmers' vocabularies but one of their least
used techniques. * Boolean algebra is to logic as arithmetic is to mathematics. Without it, the tester
or programmer is cut off from many test and design techniques and tools that incorporate those
techniques. * Logic has been, for several decades, the primary tool of hardware logic designers.
*Many test methods developed for hardware logic can be adapted to software logic testing. Because
hardware testing automation is 10 to 15 years ahead of software testing automation, hardware
testing methods and its associated theory is a fertile ground for software testing methods. * As
programming and test techniques have improved, the bugs have shifted closer to the process front
end, to requirements and their specifications. These bugs range from 8% to 30% of the total and
because they're first-in and last-out, they're the costliest of all. * The trouble with specifications is
that they're hard to express. * Boolean algebra (also known as the sentential calculus) is the most
basic of all logic systems. * Higher-order logic systems are needed and used for formal specifications.
*Much of logical analysis can be and is embedded in tools. But these tools incorporate methods to
simplify, transform, and check specifications, and the methods are to a large extent based on
boolean algebra

FLOW GARPH ARE ABSTRACT REPRESENTATION*Flow graphs are being an abstract representation of
programs.*Any question about a program can be cast into an equivalent question about an
appropriate flowgraph.*Most software development, testing and debugging tools use flow graphs
analysis techniques.

 Normally flow graphs used to denote only control flow connectivity.


 The simplest weight we can give to a link is a name.
 Using link names as weights, we then convert the graphical flow graph into an equivalent
algebraic like expressions which denotes the set of all possible paths from entry to exit for
the flow graph.
 Every link of a graph can be given a name.
 The link name will be denoted by lower case italic letters.
 In tracing a path or path segment through a flow graph, you traverse a succession of link
names.
 The name of the path or path segment that corresponds to those links is expressed
naturally by concatenating those link names.
 For example, if you traverse links a,b,c and d along some path, the name for that path
segment is abcd. This path name is also called a path product.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy