我没有发现任何对我们上述任何内容有很大帮助的内容,因此它主要是 Ant 任务、自定义 shell 脚本和魔法的集合,它们基本上将所需的 DDL 应用于空数据库并使用 DBMS_UTILITY.COMPILE_SCHEMA() 来,呃,编译模式。您可以稍后添加更多奇特的东西,例如无法编译或无法测试源代码管理中特定提交的回溯对象,并发出“指责邮件”。
我真的很想看看其他人是否有更好的方法,或者是否有现成的产品可以为我做到这一点!
Our approach is to keep each database object (tables, views, functions, packages, sprocs etc) in its own file under source control and have an integration server (TeamCity, Hudson etc) do a nightly build of the database - from source - where it drops and recreates the schema before checking for compilation errors in the user_errors system table. This lets you know when someone has introduced compilation errors into the build.
The next step is to use something like PLUTO to add unit tests to your PL/SQL code and add those into the nightly build task. For us, this has involved having sample test datasets (also under source control) that allow us to get the database to a "known state" for the purposes of testing.
I've not found anything that helps us much with any of the above so it's mainly a collection of Ant tasks, custom shell scripts and wizardry, which basically apply the required DDL to an empty database and use DBMS_UTILITY.COMPILE_SCHEMA() to, uh, compile the schema. You can add more fancy stuff later, like back-tracing objects which fail to compile or fail tests to a specific submit in source control, and issue "blame mail".
I'd be really interested to see if anyone else has a better approach or if there's an off-the-shelf product that does this for me!
Our DMS Software Reengineering Toolkit is the foundation for arbitrary customizable tools. It has a PL/SQL front end that can be used to build arbitrary source code quality checks. Yes, it has a command-line version.
There are a variety of PL/SQL COTS tools based on DMS that could be used to check quality:
Formatter - Cleans up layout. Side effect: static check for legal PL/SQL syntax
Source Code Search Engine - enables fast search of indexed source code base. Computes Halstead and Cyclomatic metrics as a side effect of setting up the index.
CloneDR - finds and reports duplicated PL/SQL code
Test Coverage - determines part of PL/SQL code not executed by tests (ad hoc, unit, or functional tests)
发布评论
评论(3)
我认为这个博客描述了所需的过程:
http://www.theserverlabs.com/blog /?p=435
请查看并告诉我您的想法。
I think that this blog describes the needed process:
http://www.theserverlabs.com/blog/?p=435
Please check and let me know what you think about it.
我们的方法是将每个数据库对象(表、视图、函数、包、存储过程等)保存在源代码控制下的自己的文件中,并拥有一个集成服务器(TeamCity、Hudson 等)每晚都会构建数据库 - 来自源 - 在检查
user_errors
系统表中的编译错误之前,它会删除并重新创建架构。这可以让您知道何时有人在构建中引入了编译错误。下一步是使用 PLUTO 之类的东西将单元测试添加到您的PL/SQL 代码并将其添加到夜间构建任务中。对于我们来说,这涉及拥有样本测试数据集(也在源代码控制下),这些数据集允许我们将数据库置于“已知状态”以进行测试。
我没有发现任何对我们上述任何内容有很大帮助的内容,因此它主要是 Ant 任务、自定义 shell 脚本和魔法的集合,它们基本上将所需的 DDL 应用于空数据库并使用 DBMS_UTILITY.COMPILE_SCHEMA() 来,呃,编译模式。您可以稍后添加更多奇特的东西,例如无法编译或无法测试源代码管理中特定提交的回溯对象,并发出“指责邮件”。
我真的很想看看其他人是否有更好的方法,或者是否有现成的产品可以为我做到这一点!
Our approach is to keep each database object (tables, views, functions, packages, sprocs etc) in its own file under source control and have an integration server (TeamCity, Hudson etc) do a nightly build of the database - from source - where it drops and recreates the schema before checking for compilation errors in the
user_errors
system table. This lets you know when someone has introduced compilation errors into the build.The next step is to use something like PLUTO to add unit tests to your PL/SQL code and add those into the nightly build task. For us, this has involved having sample test datasets (also under source control) that allow us to get the database to a "known state" for the purposes of testing.
I've not found anything that helps us much with any of the above so it's mainly a collection of Ant tasks, custom shell scripts and wizardry, which basically apply the required DDL to an empty database and use
DBMS_UTILITY.COMPILE_SCHEMA()
to, uh, compile the schema. You can add more fancy stuff later, like back-tracing objects which fail to compile or fail tests to a specific submit in source control, and issue "blame mail".I'd be really interested to see if anyone else has a better approach or if there's an off-the-shelf product that does this for me!
我们的 DMS 软件重新工程工具包是任意可定制工具的基础。它有一个 PL/SQL 前端,可用于构建任意源代码质量检查。是的,它有一个命令行版本。
有多种基于 DMS 的 PL/SQL COTS 工具可供使用检查质量:
所有这些都有命令行版本。
Our DMS Software Reengineering Toolkit is the foundation for arbitrary customizable tools. It has a PL/SQL front end that can be used to build arbitrary source code quality checks. Yes, it has a command-line version.
There are a variety of PL/SQL COTS tools based on DMS that could be used to check quality:
All these have command line versions.