Text this: A model for ranking and selecting integrity tests in a distributed database