In this chapter, we covered some aspects of software testing and how it applies to databases.
Unit-testing techniques can be used when developing code in a database, such as functions or triggers. Test-driven development is a very good approach to software development. Unit testing in databases has its own specificity. Unit tests for databases could be written as SQL scripts or stored functions in the database. There are several frameworks that help to implement unit tests and process the results of testing.
Another aspect of testing the database software is to compare data in the same database or between databases to test the results of refactoring the data model. This can be done via SQL queries, and sometimes requires establishing connections between databases. Connections between databases can be established via foreign data wrapper objects or database links.
Database...