Automated Database Applications Testing Specificat... - (2. SpecDB A Database Design For Software Speci Cations)
Automated Database Applications Testing Specificat... - (2. SpecDB A Database Design For Software Speci Cations)
Chapter 2
2.1 Introduction
From the market survey of existing testing tools in Chapter 1, it was con-
cluded that the current automated tools in the market lack an understand-
ing of the functionality of the software under construction and testing. The
literature review also showed how much of the research on automated tools
can benefit from machine-readable specifications, which can reason with
the specifications and automatically generate intelligent test cases and au-
tomatically determine whether the software passed the test based on its
understanding of the specifications and design. In this chapter, one of the
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
21
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Since neither UML diagrams nor written formal specifications can be used
as an input to automated testing tools, another channel is required to relay
the specifications to automated tools. UML is not executable, nor machine
readable. On the other hand, formal specifications are a complete repre-
sentation, but are difficult to write and not used frequently. A database
representation is chosen because it has the benefit of being machine readable
and also not as hard to use as formal languages. Once the specifications of
the software under construction are expressed in a machine-readable way,
the specifications may be used and reasoned about by automated tools to
test or generate the code for software applications automatically.
In order to create a software tool, that automatically tests parts of an-
other software under construction, or automatically generates parts of the
code for another specified software; the former has to have a good under-
standing of what the latter is intended to do. Accordingly, the automated
software code generating / testing tool has to be given, in a machine-
readable way, the specifications of the other software being built. The
best way a software’s specification and design can be given in a machine-
readable format is through an adaptation of the already established formal
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
this reverse engineering approach, SpecDB can also be used with already
existing software. The advantage of this approach is to automatically test
programmed software, giving the actual behavior for each operation. The
analysts, designers and testers can then review all the software execution
results, hence showing faults of commission that might not otherwise be
spotted by normal testing techniques that deem a test successful if the
specified behavior occurs. However, in some cases, the software errors lie
in the fact that the programmed software does more than is specified. For
example, an e-commerce application might perform its task of ordering an
item, and also (as an unwanted side effect) send credit card information or
passwords to another non-secure location! The latter security leak cannot
be spotted by conventional black box functional testing techniques. Us-
ing SpecDB in this reverse engineering approach will spot those faults of
commission as will be shown in Chapter 4.3.
Code translation from one programming language to another can be
done using the reverse engineering tool and SpecDB. Code from one lan-
guage can be fed into SpecDB, the specifications can then be used to auto-
matically generate code in another language.
SpecDB is a database. The entities of the SpecDB database store the (for-
mal) specifications of a software, necessary for unit testing. SpecDB is
designed to efficiently and accurately represent those parts of the specifica-
tions shown in this chapter.
In Section 2.4, the reader will see how SpecDB covers and has a means
to represent different forms of specifications. SpecDB is also designed to
be scalable, generic, upgradeable and modifiable. Since the model is a
database, it is easy to add more entities and/or more entity attributes to
represent a specification that cannot otherwise be represented in the given
SpecDB design in this chapter. As an example of SpecDB’s scalability, in
Chapter 4 two tables are added and an existing table in SpecDB is modified
to accomplish the task of an automated constraint generator using SpecDB.
The specification representation of SpecDB is designed to be the basis
for the process of automated software generation and testing. Automated
software code generation and/or testing tools can use SpecDB to under-
stand what a software is designed to do, and hence can accurately test
such a software by creating intelligent test cases with good coverage, and
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
In this section, each of the entities of the SpecDB design is defined and
explained in detail, including examples of values for each attribute and how
to store the different components of a software specification. First, general
entities are defined, among those are the operators, List of Tables, Table
Description, Types, Types List of valid values (LOV) and restrictions. The
SQL scripts for the creation of the entities of SpecDB are provided within
each section, their corresponding constraints are listed in Appendix A .
The reader can refer to those constraints to see the allowable values of
the attributes, this may aid in the understanding of the meaning of the
attributes in each entity in SpecDB and what each represents.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Fig. 2.2 A Focused Diagram of the General SpecDB Design (Left Section)
The Over Loaded attribute in both the Operator and Valid Operands
tables is a Boolean variable that can be True or False. If more than three
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Fig. 2.3 A Focused Diagram of the General SpecDB Design (Right Section)
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Fig. 2.5 Representing User Tables and Sets and their Description in SpecDB
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
A type can be restricted to a list of valid values, i.e. any variables of the
specified type can only take on one of the values in the LOV. For example,
the type Month Name can be either January, February, etc. In this case the
Has LOV attribute value of the Types entity for the Month Name record is
set to T for true and the valid months names are placed in the Types LOV
entity, each in a separate record.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Fig. 2.6 Representing Types, Type Restrictions and Types Valid Values in SpecDB
,Range_From_Date Date
,Range_To_Date Date
,Date_Value Date
,Range_From_Time Date
,Range_To_Time Varchar2(240)
,Time_Value Date
,Text_Value Varchar2(240))
The Types LOV table contains a record for each value in the list of
valid values for each type with LOV restrictions. The table has been de-
normalized to include values of all basic types, based on the ”type” attribute
value in the Types table, the value of the LOV will be stored in the relevant
attribute. For example if the type of the Month Number Type is Integer,
then there will be twelve records in the Types LOV table, each record will
have a unique value between 1 and 12 stored in the Int Value attribute.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,Range_To_Char Char
,Char_Value Char
,Range_From_Real Real
,Range_To_Real Real
,Real_Value Real
,Range_From_Date Date
,Range_To_Date Date
,Date_Value Date
,Range_From_Time Date
,Range_To_Time Varchar2(240)
,Time_Value Date
,Text_Value Varchar2(240))
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
same software, many different variables can have the same name, but de-
fined in different contexts or subroutines. This entity stores qualities each
variable should possess. This aids automated testing tools in creating test
cases that make sure that in all the software’s execution cycle and in all its
states, each variable maintains its designed properties. If a variable is part
of a class or an object, this can be specified, together with its encapsulation
property; public, private or protected.
,Encapsulation Varchar2(10)
,Gui_Window Varchar2(240)
,Has_Lov_Restrictions Varchar2(1) Default ’T’
,Has_Table_Restrictions Varchar2(1) Default ’T’
,Has_Other_Restrictions Varchar2(1) Default ’T’
,Num_Of_Other_Restrictions Integer
,Physical_Logical Varchar2(1)
,Mandatory Varchar2(1) Default ’T’
,Default_Char_Value Varchar2(1)
,Default_Text_Value Varchar2(100)
,Default_Int_Value Integer
,Default_Real_Value Real
,Default_Bool_Value Varchar2(1) Default ’T’
,Default_Date_Value Date
,Default_Time_Value Date
,Current_Char_Value Varchar2(1)
,Current_Real_Value Real
,Current_Text_Value Varchar2(100)
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,Current_Int_Value Integer
,Current_Bool_Value Varchar2(1) Default ’T’
,Current_Date_Value Date
,Current_Time_Value Date)
Variables can have pre-defined types, but in turn also have their own
restrictions. SpecDB has the flexibility to define restrictions on both types
and variables. A variable can have a LOV restriction or other restrictions
as the ones previously discussed for the types restrictions.
A variable can also have a Table Restriction, i.e. the variable can only
take on values that are stored in a specific field in a user-defined table. The
Var LOV table stores preset values that are preset before a software is exe-
cuted, e.g. names of the months of the year. On the other hand, a variable
can be restricted to take on values that are determined as the software ex-
ecutes, these values are stored in user-defined tables; e.g. names of people
in an address book, where the names are continuously added as the address
book is used. Those restrictions are stored in the Var Table Restrictions
entity. SpecDB gives the flexibility for a variable to be restricted to take
on only values from another table, or, by exclusion, to take any value that
does not currently exist in the specified table. This is done by specifying
the operator in the Var Table Restrictions entity.
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Fig. 2.7 Representing Variables, Variable Restrictions and Variable Valid Values in
SpecDB
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
,Var_Name Varchar2(30)
,Input_Or_Output Char
,Include_Exclude Varchar(1)
,Has_Range Char
,Even_Or_Odd Varchar2(1)
,Equivalence_Class Varchar2(240)
,Range_From_Int Integer
,Range_To_Int Integer
,Int_Value Integer
,Range_From_Char Char
,Range_To_Char Char
,Char_Value Char
,Range_From_Real Real
,Range_To_Real Real
,Real_Value Real
,Range_From_Date Date
,Range_To_Date Date
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,Date_Value Date
,Range_From_Time Date
,Range_To_Time Varchar2(240)
,Time_Value Date
,Text_Value Varchar2(240))
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,Class_Name Varchar2(240)
,Encapsulation Varchar2(10))
For a function
that takes two inputs, such as Calculate Interest Only Monthly Mortgage
(Loan Amount, Rate), the record in the Function Declaration ta-
ble will be: (Calculate Interest Only Monthly Mortgage, 2, Real, 68,
Monthly Mortgage, F, F, F, F, . . . ) where F stands for False. There
should be two records in the Sub Routine IP Description table: (Calcu-
late Interest Only Monthly Mortgage, 1, Real, Loan Amount, F, F, T) and
(Calculate Interest Only Monthly Mortgage, 2, Real, Rate, F, F, T). The
two inputs can have a restriction to be greater than zero. In this case two
records have to be placed in the Var Restrictions table to describe those
restrictions.
,Has_Lov_Restrictions Char
,Has_Table_Restrictions Char
,Has_Other_Restrictions Char)
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
The output value returned by a function (OP) can also have restrictions.
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
in this table and the actual runtime subroutine post conditions, declared
in the Runtime SR Post Conditions table.
The Type of the post condition could be a modification to or execution of
one of the following: GUI, DB, File, Report, Sequence, Message, Database
Privilege or Role, Global Variable, Commit command, Savepoint command,
Rollback, Run another program, Open a window or terminate the program
execution. The source and the destination of the post condition are specified
in this table.
If the subroutine should result in a database operation being executed,
the unique ID for that operation is placed in the DB Operation Num
field, and the actual specifications for that operation is placed in the
DB operations and DB Operation Details tables.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,Source Varchar2(5)
,Post_Cond_Type Varchar2(10)
,From_Var_Id Integer
,From_Gui_Obj_Name Varchar2(30)
,From_Gui_Window Varchar2(30)
,From_Seq_Name Varchar2(20)
,From_Char_Const_Value Varchar2(1)
,From_Text_Const_Value Varchar2(100)
,From_Int_Const_Value Integer
,From_Real_Const_Value Real
,From_Bool_Const_Value Varchar2(1) Default ’T’
,From_Date_Const_Value Date
,From_Time_Const_Value Date
,To_Gui_Obj_Name Varchar2(30)
,To_Gui_Window Varchar2(30)
,To_Var_Id Integer
,To_File_Name Varchar2(100)
,To_File_Type Varchar2(10)
,To_File_Change Varchar2(10)
,To_File_New_Location Varchar2(100)
,To_Message_Text Varchar2(240)
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
,To_Report_Name Varchar2(100)
,To_Report_Destination Varchar2(10)
,To_Report_File_Name Varchar2(100)
,To_Inc_Seq_Name Varchar2(30)
,Run_Exe_Name Varchar2(100)
,Savepoint_Rollback_Name Varchar2(20)
,Open_Window_Name Varchar2(40)
,Db_Operation_Num Integer )
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
signed SR Post Conditions table, with the difference that the field Instance
number is added, and is part of the key to this table. Also the data in the
records indicate the actual runtime post condition behavior after a sub-
routine is run, as opposed to the designed or the expected, detailed in the
Designed SR Post Conditions table. This table will be populated after the
software is implemented and executed. An automated testing tool can make
use of this table.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,From_Seq_Name Varchar2(20)
,From_Char_Const_Value Varchar2(1)
,From_Text_Const_Value Varchar2(100)
,From_Int_Const_Value Integer
,From_Real_Const_Value Real
,From_Bool_Const_Value Varchar2(1) Default ’T’
,From_Date_Const_Value Date
,From_Time_Const_Value Date
,To_Gui_Obj_Name Varchar2(30)
,To_Gui_Window Varchar2(30)
,To_Var_Id Integer
,To_File_Name Varchar2(100)
,To_File_Type Varchar2(10)
,To_File_Change Varchar2(10)
,To_File_New_Location Varchar2(100)
,To_Message_Text Varchar2(240)
,To_Report_Name Varchar2(100)
,To_Report_Destination Varchar2(10)
,To_Report_File_Name Varchar2(100)
,To_Inc_Seq_Name Varchar2(30)
,Run_Exe_Name Varchar2(100)
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
,Open_Window_Name Varchar2(40)
,Savepoint_Rollback_Name Varchar2(30)
,Db_Operation_Num Integer )
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
SpecDB can also be used to represent actual lines of programmed code and
automatically compare the actual behavior to the specified behavior using
this reverse engineering approach where the Dataflow table would contain
the actual programmed lines of code.
call, database, open window, construct object, destruct object, call object
method, end, end loop, end for, or terminal. According to the type of the
position, the successor number can change. A position number can have
many successor numbers and vice versa. For example, a decision point can
have two results (true or false), and hence two successors, depending on the
result.
Database management systems have structures similar to subroutines
called triggers. The difference between triggers and other subroutines is
that procedures or functions are called explicitly, sometimes with argu-
ments, whereas triggers are executed implicitly when a pre-specified event
occurs, also there are no arguments passed to triggers. For our design spec-
ification purpose, the trigger table stores the events that cause triggers to
execute. Those cannot be part of the normal dataflow table, since they do
not follow the same dataflow process as the rest of the software specification
or code. However, this table will refer to the dataflow table once a trigger is
defined, to adopt the same technique used to describe a normal subroutine
body, to describe the trigger body. Also what is named smart trigger is
described in this table. Smart triggers execute once a pre-specified event
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
occurs to a graphical user interface (GUI) object. For example, when the
mouse pointer enters a specific area in a window or when a button right
click occurs, etc. If the LHS var is assigned to a GUI object value, the
var id is the place to identify that GUI object, since all GUI used vars are
listed in the VAR table.
The Input Output Definition table describes how inputs and outputs to
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
and from the software are represented. Inputs and outputs can be repre-
sented in many forms, file, database, through the GUI or to output devices
like a printer (where a report is printed), or from other input devices. If
the input or output is a database operation, then in the dataflow table,
the line of code will be of type database operation, not input or output,
and hence this type of input or output will not be represented in this In-
put Output Definition table.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Fig. 2.10 Representing Dataflow, Triggers and System Inputs and Outputs in SpecDB
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
identifier is provided in the Cal Num field, and then at least one record is
inserted in the Calculations table.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,Left_Func_Instance_Num Integer
,Right_Operand_Type Varchar2(5) Default ’Comp’ Not Null
,Right_Component_Num Integer
,Right_Var_Id Integer
,Right_Text_Const Varchar2(240)
,Right_Num_Const Float(12)
,Right_Func_Name Varchar2(50)
,Right_Func_Instance_Num Integer
,Operator_Id Integer Not Null)
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
2.4.9 Predicate
The Predicate table described in this section stores complex predicate state-
ments or database conditions. Each line of specification or code i.e. posi-
tion, has a type that is stored in the Dataflow table. If the Pos Type is
either a decision, while loop, for loop, or database operation, the statement
details at this line of code are stored in this Predicate table. In case the
Pos Type is a decision, a decision statement can have a simple or a complex
predicate. An example of a simple predicate is:
if a = b then ...
In this case there are several components. The components are them-
selves calculations. Records are inserted in this table starting with the low-
est level components, i.e. the ones that contain only simple predicates, with
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
just variables and constants, i.e. from the inside out. Finally the predicate
that represents the relationship among the already described components
is inserted, using their respective component numbers. The technique is
very similar to that used in the calculation table.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,Left_Func_Inst_Num Integer
,In_Db_Oper_Num Integer
,Right_Operand_Type Varchar2(5) Default ’Comp’
,Right_Component_Num Integer
,Right_Var_Id Integer
,Right_Text_Const Varchar2(240)
,Right_Num_Const Float(12)
,Right_Func_Name Varchar2(240)
,Right_Func_Instance_Num Integer
,Right_Table_Name Varchar2(240)
,Right_Table_Alias Varchar2(240)
,Right_Db_Field Varchar2(240)
,Operator_Id Integer Not Null )
above examples, the operands are database fields compared to one another,
for example: S.ID = Emp.ID. In this example, both the left and the right
operands are database fields in the S and Emp tables (or table alias) This
example will be treated as a simple predicate, as discussed above. However,
if the WHERE clause had many such simple predicates joined with AND
or other operators, they will again be treated each as a component. The
components will be stored in this predicate table as in the above examples
involving only variables, and/or constants.
Finally, if the Pos Type is a set operation, the predicate table is also
used to express operations on sets. For example:
N∈
/ Known
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
the SQL Language functions can be represented in this table. The functions
listed and accounted for by fields are just a few examples to show the
feasibility of the approach. The DB Operation Details table contains the
details of the Database operations described in the DB Operations table.
For SELECT Statements, the variables to select are inserted in the
Field Name attribute. If there are n fields to select, there will be n records
in this table with the same DB Operation Num. If the database operation
was SELECT *, then there will be only one record, and the Field Name
will be *. The INTO portion of the select statement, i.e. the variable
where the selected value should be stored is indicated in the INTO Var ID
attribute. The FROM clause is listed in the DB Operation Tables table,
with the same DB Operation Num. Finally, The WHERE clause is stored
in the Predicate table, with the POS NUM = the DB Conition Num. If
a cursor is defined, the Operation Type is in the DB Operations table is
’Cursor’, it is treated the same as a SELECT statement, with the addition of
identifying the cursor name in the Cursor Name field in the DB Operations
table. Also if a Fetch operation on a cursor is the DB Operation type, again
the Cursor Name field is populated, and all the details of which values to
put from the cursor SELECT statement into variables are all stored in the
DB Operation Details table.
For INSERT INTO statements, the table name will be in
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,Priv_Object_Name Varchar2(240)
,Grant_Admin_Option Varchar2(1) Default ’T’
,View_Name Varchar2(240)
,Table_Name Varchar2(240)
,As_Table_Name Varchar2(240)
,As_Select Varchar2(1) Default ’T’
,Cursor_Name Varchar2(240) )
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
then the Insert Select attribute will be set to true. Also the In-
sert Select DB Oper Num will be filled out and the Select operation will
be defined in the DB Operations table, under its Pos Num.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,Delete_Where_Pos_Num Number )
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
The Classes table holds the names of the classes, the rest of the in-
formation of the class are stores in their respective locations, with an
identifier pointing to their respective classes. For example, class variables,
methods and encapsulations rules are stored in the Var table, in Section
2.4.4 and either the Procedure or the Function Declaration tables respec-
tively, explained in Section 2.4.5. Relationships between classes, like inher-
itance, association, aggregation, etc, are stored in the Class Relationships
table. In the Class Relationships table, two classes from the Classes table
are referenced in Class Name1 and Class Name2. The relationship type
between those two classes is stored in the relationship attribute in the
Class Relationships table. This attribute has a list of valid values represent-
ing the types of relationships among classes, e.g. inheritance, encapsulation,
etc.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
2.5. Conclusion 55
2.5 Conclusion
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
2.5. Conclusion 57
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,Ao_Text Varchar2(240)
,Ao_Destination Varchar2(240)
,Ao_User Varchar2(240)
,Ao_Role_Id Varchar2(240)
,Ao_Privilege_Id Varchar2(240)
,Ao_Database Varchar2(240)
,Ao_Savepoint Varchar2(240))
,Eo_Category Varchar2(240)
,Eo_Db_Table Varchar2(240)
,Eo_Change Varchar2(240)
,Eo_Field Varchar2(240)
,Eo_Row# Varchar2(240)
,Eo_Value Varchar2(240)
,Eo_From_Var Varchar2(240)
,Eo_Window Varchar2(240)
,Eo_Component Varchar2(240)
,Eo_Type Varchar2(240)
,Eo_Name Varchar2(240)
,Eo_Text Varchar2(240)
,Eo_Destination Varchar2(240)
,Eo_User Varchar2(240)
,Eo_Role_Id Varchar2(240)
,Eo_Privilege_Id Varchar2(240)
,Eo_Database Varchar2(240)
,Eo_Savepoint Varchar2(240))
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
2.5. Conclusion 59
,String_Value Varchar2(240)
,Date_Value Date
,Time_Value Date)
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
2.5. Conclusion 61
,Of_Table Varchar2(40)
,Probability Number)
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.
November 4, 2009 15:43 World Scientific Book - 9in x 6in SpecDB
,Which_Table Varchar2(240)
,Which_Field Varchar2(240))
Copyright © 2010. World Scientific Publishing Company. All rights reserved.
Mikhail, Rana Farid, et al. Automated Database Applications Testing: Specification Representation For Automated
Reasoning : Specification Representation for Automated Reasoning, World Scientific Publishing Company, 2010. ProQuest Ebook Central, http://ebookcentral.proquest.com/lib/byui/
Created from byui on 2022-03-21 20:07:37.