Generalize the test data construction