Arunkumar Khannur's Software Testing Knowledge Center
   
 

8.5 Regular Expression and Flow Anomaly Detection

Every program performs logical and arithmetic operations in a logical way in order to get an intended functionality. This can be achieved by constructing a program by sequencing constructs like statements, decision control structures, and loops that have logical and arithmetic operations. In addition, programs are required to fulfil certain characteristics link single-entry-single-exit criteria; no infinite loops; and other best practices like avoiding GO-TOs etc.

During testing, using control flow graphs, paths, path expressions, and reduction procedure, we make an attempt list out all possible paths and also, develop an understanding of possible number of maximum paths and approximate number of minimum paths in the program.

With these things in place, we try to find the possible ways to detect anomalies in all possible paths. This involves executing each paths in a specific sequence and observing whether operations in each path perform as expected. Thus, we need to identify possible operations, the sequence in which these operations are carried out, and consequence of these operations.

Thus, we need to look at the sequence of operations in the program and observe the consequence of these operations in order to check whether operations are happening as intended, if not, are there any anomalies in the flow. Such flow anomaly detection can be done using regular expression of linked graphs. In order to carry out this, we use concept of Regular Expression.

8.5.1 Meaning of Regular Expression

Given a set of symbols A, a regular expression over A is a string constructed from the elements of A and the symbols (,),+,., and Λ (empty sequence or empty string), according to following definitions:

Regular Expression 1: The Symbol Λ is a regular expression
Regular Expression 2: If x ϵ A, he symbol x is a regular expression
Regular Expression 3: If α and β are regular expressions, then the expression αβ is regular
Regular Expression 4: If α and β are regular expressions, then the expression α + β is regular
Regular Expression 4: If α is a regular expression, then the expression (α)* is regular
Regular Expression 1 and Regular Expression 2 provide initial regular expressions. The other three are used recursively to define successive larger sets of regular expressions from already defined regular expression.
 
 
Khannur's Book
Arunkumar Khannur, Software Testing - Techniques and Applications, Published by Pearson Publications, 2011 (ISBN:978-81-317-5836-6; Pages:341 + xxii)
Follow Khannur
         
Khannur's Company
ISQT Process & Consulting Services Pvt. Ltd., Bangalore, INDIA
Khannur's Software Testing Forum
STEP-AUTO Forum
 Contact Khannur
ISQT Process & Consulting Services Pvt. Ltd.
#732, 1st Floor, 12th Main,
3rd Block, Rajajinagar,
Bangalore - 560010, INDIA
Phone: +91 80 23012511
URL: www.isqtinternational.com
Email: khannur@isqtinternational.com
Skype: arun.isqt