While designing test cases for an application's database code (the data layer), I would like to determine a good subset of tests to run in order to guarantee its proper function. In essence, the goal would be to come up with the smallest set of tests that can provide the best guarantee possible of its function.

Probably, the set of tests includes simple operations (INSERT, UPDATE, DELETE, etc.) as well as certain combinations of operations that should work (INSERT then SELECT, or DELETE then SELECT). It is this set of combinations that is non-trivial and of greatest interest here.

Is there a standard or best-practice set of tests that is defined for database operations? Where should I look for something like that?

Thanks very much!

  • Believe it or not, this is a broad question. Perhaps someone (Joe Strazzere?) could recommend some reading material on API testing.
    – user246
    May 27, 2014 at 13:47
  • Some of the things you mention seem like they would be leaning into validating the database software functionality itself rather than giving you much value testing your own database layer.
    – Sam Woods
    Jun 4, 2014 at 16:18
  • @SamWoods Well, our data layer is complex and probably should be validated that way. What is a good way to do that? Jun 4, 2014 at 21:31

1 Answer 1


From application perspective you need to look at below states for DB to be validated with basic cases

  • Clean up Scripts (Clearing Previous Run Data)
  • Initial Data population (From a fresh install whatever initial configuration you need to do)
  • Prerequisites Validations Tests (Checklist to validate before you start run - Services up / DB's accessible, able to connect to DB's with supplied credentials)
  • Run Tests (These are actual test you can run to validate, ex- calling of storedprocs with test data, updating few job tables in DB to process populated data etc..)

This provides a logical flow as well help you re-run every time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.