extract_test_data function

Extract test data.