Minimize
Blogger List

Johannes Ahrends
Toad and Oracle

Ben Boise
Toad SC Discussions

Kevin Dalton
Benchmark Factory

Steven Feuerstein
PL/SQL Obsession

Devin Gallagher
Toad SC discussions

Stuart Hodgins
JProbe Discussions

  Henrik "Mauritz" Johnson
Toad Tips & Tricks on the "other" Toads
  Mark Kurtz
Toad SC discussions
  Michael Lumbard
Toad SC discussions
Daniel Norwood
Toad for Data Analysts,
Toad Extension for Visual Studio
Debbie Peabody
Toad for Data Analysts
Gary Piper
Toad Reports Manager
John Pocknell
Toad for Oracle, JProbe
Kuljit Sangha
Toad SC discussions
Bert Scalzo Indicates Oracle ACE status
Toad for Oracle, Data Modeling, Benchmarking
Jeff Smith
Toad product family
Richard To
SQL Optimization
Jim Wankowski
DB2 - LUW and z/OS
John Weathington
  Toad Data Modeler Opens in a new window
Data Modeling
 
  Real Automated Code Testing for Oracle
Quest Code Tester blog
 
Minimize
Blog Tags
toad for oracle (122)
oracle (62)
plsql (46)
sql optimization (37)
toad for data analysts (28)
code tester (19)
toad for ibm db2 (13)
automation (11)
batch optimizer (10)
virtualization (10)
schema browser (9)
toad for sql server (9)
data grid (8)
sql (8)
sql editor (8)
toad data modeler (8)
benchmark factory (7)
excel (7)
query builder (7)
report manager (7)
toad extension (7)
visual studio (7)
11g (6)
configuration (6)
freeware (6)
health check (6)
vmware (6)
connect (5)
dba module (5)
er diagrammer (5)
F4 (5)
linux (5)
refactoring (5)
spotlight (5)
unicode (5)
compare (4)
debugger (4)
export (4)
formatter (4)
make code (4)
rman (4)
strip code (4)
benchmark (3)
bfscript (3)
bulk collect (3)
code templates (3)
code xpert (3)
database browser (3)
db2 (3)
notebook (3)
oem (3)
RAC (3)
session browser (3)
speed (3)
sql optimizer (3)
toad for mysql (3)
tpc-c (3)
9.7 (2)
alert log (2)
app designer (2)
awr (2)
code insight (2)
code snippets (2)
collection (2)
compare and sync (2)
compliance (2)
data generator (2)
data warehouse (2)
database explorer (2)
database monitor (2)
explain (2)
forall (2)
ftp (2)
group execute (2)
handbook (2)
installation (2)
job scheduler (2)
multi-task (2)
nested table (2)
os command (2)
profiler (2)
recovery (2)
release history (2)
save as (2)
schema compare (2)
sql recall (2)
stats pack (2)
subversion (2)
team coding (2)
trace file browser (2)
while loop (2)
10g (1)
64 bit (1)
7zip (1)
action (1)
addm (1)
alter (1)
ansi join (1)
array (1)
ccleaner (1)
code coverage (1)
code road map (1)
CRON (1)
cursor for loop (1)
data browser (1)
data subset (1)
database probe (1)
dbms_flashback (1)
dbms_profiler (1)
ddl (1)
feuerstein (1)
filezilla (1)
flash drive (1)
flow control (1)
for loop (1)
group policy manager (1)
hints (1)
import (1)
index (1)
inheritance (1)
invoker rights (1)
ipad (1)
java (1)
latency (1)
log switch (1)
logical model (1)
ltrim (1)
master-detail browser (1)
monitor (1)
multi-select (1)
naming standards (1)
network (1)
object explorer (1)
OEBS (1)
package (1)
parser (1)
partitioning (1)
performance (1)
pragma (1)
project manager (1)
RAT (1)
revo (1)
REXEC (1)
schema report (1)
script manager (1)
search (1)
set operator (1)
sga (1)
slow (1)
sonarsource (1)
source control (1)
space projection (1)
sql monitor (1)
sql navigator (1)
sql script (1)
sql tracker (1)
sql*plus (1)
standards (1)
statistics (1)
stored procedure (1)
string parser (1)
sub-model (1)
sub-type (1)
synch (1)
synchback (1)
TELNET (1)
toad (1)
trace (1)
unit test (1)
unix (1)
usb (1)
utility (1)
v10 (1)
v9.5 (1)
version control (1)
waits (1)
workload replay (1)
workspace (1)
xml (1)
 
WELCOME, GUEST
 
 

Blogs
Toad and Database Commentaries

Toad World blogs are a mix of insightful how-tos from Quest experts as well as their commentary on experiences with new database technologies.  Have some views of your own to share?  Post your comments!  Note:  Comments are restricted to registered Toad World users.

Do you have a topic that you'd like discussed?  We'd love to hear from you.  Send us your idea for a blog topic.


Jun 30

Written by: Jeff Smith
6/30/2008  RssIcon

Anyone who develops, supports, or uses PL/SQL at some level also tests the PL/SQL. It may not be a formal testing environment, but there is a time where you will probably ask yourself, “Does this program actually do what it is supposed to?” I think this is something we can all relate to as computer users.
 
This type of testing probably involves clicking a few buttons, then poking around the database or file system after the fact to make sure what you expect to see exists. There of course are other types of testing that generally happens inside the development team responsible for the code in question. You have developers writing the code and doing their testing before sending it to the QA group for verification, and then you have the QA group that has a very defined and rigid set of functionality tests that ensure the application does what it is supposed to do. These defined tests eventually get converted into Regression scripts and then are ran as needed to ensure any work done on the code after it has been released does not break anything that was previously working.
 
Ok, so none of this should be news to you, the Oracle enthusiast who is also working with PL/SQL. What may be news to you is that for the past year now Quest has had a technology that can automate this causal to rigid testing methodology for PL/SQL. What’s even more exciting is that in the past release of Toad, this technology has been directly incorporated into your PL/SQL IDE, i.e. Toad for Oracle.
 
One-button-press testing, courtesy of Quest.
 
Shenanigans You Say?
 
Ok, I need to come clean just a bit I suppose. Toad cannot look at your code and automatically compose tests for you on the fly and then just run them and let you know how they went. This would be an awesome technology if it existed, wouldn’t it? So what exactly can Toad do for you here?
 
What if you just described in plain terms what your program should be doing, say in terms of:
  • My table(s) should be updated/deleted/inserted appropriately and look like this
  • My function should return this cursor and/or collection
  • These OS files should be updated/added/deleted
  • My program should run in less than X seconds
  • My program should always raise this exception under these circumstances.
If you take the few minutes to do this, we can turn these expectations into a testing program that can ensure your code is doing what is supposed to be doing today, and will continue to do so for its entire life expectancy.
 
One other little disclaimer, this technology is actually a stand-alone technology called Quest Code Tester for Oracle. But, if you buy it with Toad, it’s basically half-price, and then you have the instant integration.
 
So if I were to click the ‘magic button’, after I had made a change to my program I would instantly know that all things are not as expected according to my pre-defined tests.
 
 
In about 5 seconds, Toad was able to report back that 1 of our 4 test cases failed. It also was able to show me the actual versus the expected results.
 
How Does it Work?
 
When you click the Code Tester button, Toad will open Quest's "integrated testing environment." This is where you will describe your test cases and maintain the test code.
 

 
In about 2 minutes I was able to define 5 test cases that actually run through about 20 different scenarios using the random test input data management piece included in the product. Now, as long as I don’t add new features or drastically change the behavior of the program, I can rely on this test suite to let me know if something happens to break my program. If someone inherits my program later and needs to enhance it, they simply need to take an extra minute to enhance the test suite as well.
 
How Does it REALLY Work?
 
Have you ever heard the saying ‘Good developers write good programs, but great developers write programs to write good programs for them?’ That’s the essence of what’s happening under the covers hear. Quest has a great developer who had dedicated the last five years or so of his professional career at making this technology available for PL/SQL professionals everywhere.
 
By taking the inputs and scenarios defined in the test IDE, he can transform that into a PL/SQL test package that automates the outcome checks, the running of the tests, and the evaluation of the results so all you have to worry about is ‘Yes this worked’ or ‘No this did not work and here is why’. When you get the ‘No’ answer, don’t despair, just jump into the debugger and run your scenario manually so you can see which line of code is causing the problem according to your expected set of outcomes.
 
Why write test code when Quest will do it for you?
 
Start Using This TODAY
 
Here’s your official Toad World homework assignment:
  1. Go to our PL/SQL testing community and watch some videos. If it looks as easy as I said it was, then proceed to assignment #2
  2. Download a trial, or if you must the freeware J
  3. Install it and try it out.
  4. Questions? Want to call shenanigans for real? Reply to this Blog or even better yet, talk to Steven here.
 

Tags:
Categories:
Search Blog Entries