Summary

In this chapter, we covered some aspects of software testing and the way it is applicable to databases.

Unit testing techniques can be used when developing code in a database, for example, functions or triggers. Test-driven development is a very good approach in 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 in implementing unit tests and processing the results of testing.

Another aspect of testing the database software is comparing 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, it requires establishing connections between databases. Connections between databases can be established via dblinks or foreign data wrapper objects.

Database schemas can be compared quite simply using command-line tools provided with PostgreSQL and operating systems. Additionally, there are more advanced software products that do this as well.

pgbench is a utility provided with PostgreSQL that can be used to assess the performance of a database system.

In the next chapter, we will continue talking about integrating PostgreSQL with other software and will discuss how to use the database in Python applications.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset