Test Driven Design for postgres procedures
7
votes
1
answer
1968
views
I am looking to introduce a [test driven design](https://www.red-gate.com/simple-talk/sql/sql-training/test-driven-database-development-why-bother/) style to writing my stored procedures for a postgresql database implementation.
I have seen that [pgTap](https://github.com/theory/pgtap) is a popular unit testing tool for postgres and correctly allows for the tests to be written in SQL and not built and run externally.
In order to go the full distance I would also like to be able to use test doubles (stub, mock, fake, dummy) and maybe even some IDE support for running and refactoring (something like [tsql](http://tsqlt.org/))
Are there currently tools and resources available specifically for supporting TDD in postgres or do people roll their own by building fake tables and data and wrapping everything in transactions that roll back on completion?
What are currently the best practices for approaching TDD in postgres?
Asked by Russell Ormes
(193 rep)
Apr 30, 2018, 05:08 PM
Last activity: Oct 10, 2020, 02:04 AM
Last activity: Oct 10, 2020, 02:04 AM