Developing a universal design pattern for testing APIs using the concept of a ‘pure’ function as a wrapper to manage the ‘impurity’ inherent in database APIs; explaining why a general data model is appropriate, and detailing the model in logical terms and with physical array structures; showing how test inputs and outputs can be displayed using the data model, giving some PL/SQL code examples, and some notes on frameworks; explaining why code coverage is not a useful testing metric and developing, from examples, the concept of domain partitioning as a better approach for test analysis; discussing testing strategies, including the limits of testing, why/when/what to automate, and the homeopathic unit testing antipattern; highlighting the value gained from viewing database APIs and other code from the perspective of the mathematical function for both functional and performance testing