Oracle PL/SQL 的单元测试框架?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/203376/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 17:22:44  来源:igfitidea点击:

Unit Testing Framework for Oracle PL/SQL?

sqloracleunit-testingplsql

提问by Kyle Burton

I've seen the question (and answer) when posed for MS SQL Server, though I don't yet know of one for Oracle and PL/SQL. Are there xUnit style testing frameworks for Oracle's PL/SQL? What are they?

我已经看到了针对MS SQL Server提出的问题(和答案),尽管我还不知道针对 Oracle 和 PL/SQL的问题(和答案)。是否有适用于 Oracle PL/SQL 的 xUnit 风格测试框架?这些是什么?

采纳答案by Justin Cave

The most commonly used is probably utPLSQL

最常用的大概就是utPLSQL了

The original author of this toolkit now works for Quest, which has a commercial PL/SQL unit testing application.

这个工具包的原作者现在为 Quest 工作,它有一个商业 PL/SQL 单元测试应用程序

回答by FerranB

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

SQL Developer的最后一个版本包括一个非常有趣的单元测试套件。

回答by Raimonds Simanovskis

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

我已经使用 Ruby 库 ruby​​-plsql创建并使用了PL/SQL 单元测试框架

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

与 utPLSQL 相比,它提供了更短、更易读的测试,并且与 GUI 工具(如 Quest Code Tester 或 SQLDeveloper 2.1)相比具有更大的灵活性。

回答by Justin Cave

PLUTO appears to be very new, and there doesn't appear to be a lot of documentation. So I would be concerned that you'd be working through a decent number of bugs to get things working. utPLSQL has been around for a number of years and pretty widely deployed, so there have been a lot more bug fixes and a lot more people who can help out if you run into problems.

PLUTO 似乎很新,而且似乎没有很多文档。所以我担心你会通过大量的错误来让事情正常工作。utPLSQL 已经存在了很多年并且广泛部署,因此有更多的错误修复和更多的人可以在遇到问题时提供帮助。

Additionally, and not to disparage anyone, but Steven Feuerstein, who wrote utPLSQL is one of the most recognized PL/SQL experts in the world. While I'm sure the author of PLUTO is a perfectly competent developer, I don't believe he has anywhere near the reputation Steven has.

此外,并不是要贬低任何人,但编写 utPLSQL 的 Steven Feuerstein 是世界上最受认可的 PL/SQL 专家之一。虽然我确信 PLUTO 的作者是一位非常称职的开发人员,但我认为他的声誉远不及 Steven 的声誉。

回答by neves

I found this question searching for a PL/SQL unit test framework. I've found an article where PLUTO's developer argues for it:

我在搜索 PL/SQL 单元测试框架时发现了这个问题。我找到了一篇PLUTO 的开发人员为此争论的文章:

... there are a few products that help PL/SQL programmers test their code. Quest Software has a product called Code Tester for Oracle; however, the free version is cripple-ware and the for-pay version just adds one more obstacle for you to have to get by in convincing your organization to start testing. There is also a utPLSQL project that was abandoned a few years ago and it is starting to suffer from bit rot.

... 有一些产品可以帮助 PL/SQL 程序员测试他们的代码。Quest Software 有一款名为 Code Tester for Oracle 的产品;然而,免费版本是残障软件,付费版本只是增加了一个障碍,让您说服您的组织开始测试。还有一个 utPLSQL 项目,几年前被放弃了,它开始遭受比特腐烂。

回答by user272735

I've recently used successfully unit testing framework of PL/SQL Commonstoolkit (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).

我最近成功使用了PL/SQL Commons工具包的单元测试框架(另请参阅作者的幻灯片)。该工具包尚未公开(在撰写本文时),但如果您向作​​者发送电子邮件,您将获得一个工作包(或者至少我得到了)。

回答by Kyle Burton

I also found another library: PLUTO- has anyone used these and can compare/contrast them?

我还发现了另一个库:PLUTO- 有没有人使用过这些并且可以比较/对比它们?

回答by Dinesh Bhat

We use DBUnit. It integrates nicely into a continuous integration tools like Cruise Control, though developers need to learn a little Java. Templates, utilities and code samples helped our pl/sql developers get up to speed quickly.

我们使用 DBUnit。它很好地集成到了像 Cruise Control 这样的持续集成工具中,尽管开发人员需要学习一点 Java。模板、实用程序和代码示例帮助我们的 pl/sql 开发人员快速上手。

回答by Thomas Barker

I looked at all of those, but the only one I liked was PLUnit. It does seem to have been abandoned by its maintainers (I had to tweak the scripts to make them install). But the API is extremely simple, and it doesn't try to force an OOP/xUnit approach into PL/SQL.

我看了所有这些,但我唯一喜欢的是PLUnit。它的维护者似乎已经放弃了它(我不得不调整脚本以安装它们)。但是 API 非常简单,它并没有试图将 OOP/xUnit 方法强加到 PL/SQL 中。

回答by Thomas Barker

Haven't used any, but last realese of utPLSQL was on July 2005 and since the author is the same from the commercial code tester for oracle (http://www.quest.com/code-tester-for-oracle/) I don't think we'll be seeing much of utPLSQL in the future if any, so I think I'll take my chances with PLUTO (2008)

没有使用过任何,但 utPLSQL 的最后一次实现是在 2005 年 7 月,因为作者与 oracle 的商业代码测试人员相同(http://www.quest.com/code-tester-for-oracle/)我不要认为我们将来会看到很多 utPLSQL(如果有的话),所以我想我会抓住 PLUTO(2008)的机会