Category Archives: oracle

Oracle exercise on real example

Reading Time: 2 minutes


This post is example how to apply oracle heuristic to identify is there a problem. Disclaimer: this blog post is not about some fancy new software testing framework. Pure software testing craft.

You are still here after disclaimer? Great!

Oracles are simply the principle or mechanism by which we recognise a problem. [Ref.]

Please read the article, it is well written and easy to comprehend. Another quality of excellent software tester.

In order to know how to use oracles in software testing, you need to practice. I hope that this example will help you.

I am “forced” to use Microsoft Word in order to create documentation for one project. I decided to insert images from external documentation using “Insert from URL feature”. In that way, when external documentation changes, link would either break or would automatically point to new image.

I clicked in Word Insert menu, then on image icon. After several minutes, i realized that there is no “Insert from URL option”.

I searched with Google to find quick answer:

Go to Insert – Quick Parts – Field…

Then you will get select box with a lot of options, one of them is insert image from URL (why we should bother to put it as first option in the list).

What!? I will repeat that because it sounds like sentence from Monty Python’s Flying Circus sketch:

Go to Insert – Quick Parts – Field…

Hmm…, do we have a problem here? I am calling oracle consistency heuristics Comparable Product into help.

We expect the system to be consistent with systems that are in some way comparable. That might include other products in the same product line, or from the same company. The consistency-with-past-versions (History) heuristic is arguably a special case of this more general heuristic. Competitive products, services, or systems may be comparable in dimensions that could help to discover a problem. Products that are not in the same category but which process the same data (as a word processor might use the contents of a database for a mail merge) are comparable for the purposes of this heuristic. A paper form is comparable with a computerized input form designed to replace it. Indeed, any product with any feature may provide some kind of basis for comparison, whereby someone might recognize a problem or a suggestion for improvement [Ref.].

Lets check Google Docs.

Click Insert menu option. First suboption is Image icon, click on it, there is option window with option By URL. It took me four seconds to find it.

So this word option is not consistent with comparable product because in comparable product is much easier to insert image. Proof that Google docs has better UX than Microsoft Word.

And you can use this as selling pitch for this issue to your product manager.

I once presented oracle consistency heuristics to software testers. Feedback was: Oh, this is fancy and great, but we DO NOT HAVE TIME TO DO THAT!

Then I asked them contra question: How much time you spent in your bug triage sessions?

A lot.

With oracle heuristics, you are first filter for bug. If you can not find inconsistency in listed heuristics, than you will not report this issue. And your bug triage sessions will be much shorter.


Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Choose your testing tools using your brain

Reading Time: 2 minutes

For a tester, everything starts from its primary testing tool, its brain.
In my previous post I wrote about plsql-spec Ruby gem, my choice of weapon for testing Oracle technology. I started to test simple procedure that converts oracle DATE to character representation. For testing ideas I used this great post from test eye blog.
For a tester, time is very important source of testing ideas. Time was last added component to SFDPOT (mnemonic for San Francisco Depot) test strategy heuristic by James Bach.
I installed plsql-spec ruby gem on JRuby. JRuby uses Java as the underling virtual machine, while Ruby uses its own implementation written in C language. I used JRuby because my intention was to make testing infrastructure portable as much as possible. In order to connect to Oracle database, in JRuby you only need oracle jdbc driver, but pure Ruby requires Oracle Net Manager (which means for tester one more component to maintain) and oci8 gem.
My first testing session was to find the boundary of time supported in Oracle database.
Oracle Time range is [January 1, 4712 BC:December 31, 9999 AD].
Ruby Time class also supports BC years. For lower bound of supported Oracle DATE, just write:

plsql.bsn_eliste_pkg.to_tmstmp_tz( Time.local -4712, 1, 1 ,0, 0, 0 ).should eql “47120101000000 PNE”

where plsql procedure takes oracle DATE as input parameter. Python and Java lovers, parenthesis in Ruby are optional!
That code triggered following Java exception in JRuby:

Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
     # java.sql.Timestamp.valueOf(

I am not able to send BC dates to plsql procedure! When I switched back to pure Ruby, I got following test fail:

   Failure/Error: plsql.bsn_eliste_pkg.to_tmstmp_tz( Time.local -4712, 1, 1 ,0, 0, 0 ).should eql “47120101000000 PNE”

       expected: “47120101000000 PNE”
            got: “47120101000000”

In this case I revealed plsql procedure bug!
Lesson learned
Your primary tool is your brain. Using your brain, you learn about testing by reading smart blogs (like test eye). You want to implement Time test ideas for Oracle procedures. You found out about plsql-spec ruby gem. There is an option, JRuby or Ruby. If one option is blocking you in implementing your testing ideas (like JRuby in this case) try another option. Choose your testing tools using your brain!

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather