Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit testing with Oracle [closed]

Does anyone have any frameworks/apps/methodologies for creating Unit tests with Oracle?. I'm using Oracle 11g.

I also have Team Foundation Server installed, where we do all our other development work with Visual Studio on a web app.

Edit: I'm looking to run unit tests on Packages, Procedures and Functions within Oracle (PL/SQL)

like image 549
Hector Minaya Avatar asked Dec 16 '09 21:12

Hector Minaya


People also ask

What is unit testing in Oracle?

The SQL Developer unit testing feature provides a framework for testing PL/SQL objects, such as functions and procedures, and monitoring the results of such objects over time. You create tests, and for each you provide information about what is to be tested and what result is expected.

Is Oracle between inclusive or exclusive?

In an Oracle BETWEEN operator, the lower limit must be specified before the upper limit. -- No error will be generated and no rows will be returned either. The Oracle BETWEEN operator is inclusive.

What does (+) mean in Oracle?

The plus sign is Oracle syntax for an outer join. There isn't a minus operator for joins. An outer join means return all rows from one table. Also return the rows from the outer joined where there's a match on the join key. If there's no matching row, return null.

When unit testing is executed?

Unit Testing of the software product is carried out during the development of an application. An individual component may be either an individual function or a procedure. Unit Testing is typically performed by the developer. In SDLC or V Model, Unit testing is the first level of testing done before integration testing.


1 Answers

There are a couple of options. Oracle SQL Developer has a built-in test suite but that's no use for people using other IDEs such as PL/SQL Developer, and also not helpful for CI purposes.

The best choice is UTPLSQL, which was originally written by the renowned Steven Feuerstein. This is pure PL/SQL. It is pretty good and free open source software.

The really good news is that - after a long period of hibernation - UTPLSQL is back in active support. Version three is a complete re-write, with clever support for readable tests: it's a lot more like the JUnit and NUnit style of unit testing. Excitingly there are hooks for running UTPLSQL tests - including rendered output - in CI tools like TeamCity, Jenkins, etc. There is also a community of developers writing helpful extensions, such as a SQL Developer plugin.

There's a migration tool for v2 tests.


Author's note: I have completely re-written this answer to reflect the fact that UTPLSQL is now an active product again.

like image 66
APC Avatar answered Oct 09 '22 05:10

APC