Tutorial :Unit testing for PL/SQL [closed]



Question:

Anyone have any experience or tools for unit testing PL/SQL. The best looking tool I've seen for this seems to be Quests Code Tester, but i'm not sure how well that would integration with continuous integration tools or command line testing?


Solution:1

I use utPLSQL as the framework and OUnit as the client. utPLSQL isn't really meant to be used by itself, a good graphical client is required. OUnit is the predecessor to Qute. Qute is also a good tool but more complex than my requirements - it allows you to construct tests using a GUI and does good stuff like test code generation.

Edit: My understanding is that utPLSQL stores all results in database tables, including all historical results which would make a good data source for gathering statistics for continuous integration. You can also define test groups so a single call to utPLSQL can call multiple test packages.


Solution:2

Check utPLSQL out. I found it somewhat difficult to start with, but i think it does the job reasonably well.

As for continuous integration tools, I used to create usual tests (NUnit, C#) that just called the stored procedures created with utPLSQL and checked their result out.


Solution:3

I have created and using PL/SQL unit testing framework using Ruby library ruby-plsql.

It provides much shorter and more readable tests than utPLSQL and gives more flexibility compared to GUI tools (like Quest Code Tester or SQLDeveloper 2.1).


Solution:4

There are a few listed on the wikipedia : http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#PL.2FSQL


Solution:5

The last version of SQL Developer includes an Unit Test suite very interesting.


Solution:6

I found this interesting post about the continuous integration for PL/SQL projects.

It meanly deals with the unit testing of PL/SQL code, using the previously listed utPLSQL framework...


Solution:7

I'm using python py.test with cx_oracle to build test scripts for pl/sql packages. Works nice so far.


Solution:8

I've recently used successfully unit testing framework of PL/SQL Commons toolkit (see also author's slides). The toolkit is not yet publicly available (at the time of the writing) but if you drop an email to the authors you'll get a working package (or at least I got).


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »