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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

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).

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

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...

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

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top