Editorial contribution · business
Define a data contract, including edge cases and errors
Two systems or teams need to interpret the same data consistently. Get rules for every field and examples that reveal missing or incorrect values.
Published: · Version 1
A prompt to try
Design a data contract for [DATASET/INTERFACE]. Sample data without personal information: [DATA]. Domain terms: [DEFINITIONS]. Producers and consumers: [SYSTEMS]. 1. Describe each field’s meaning, data type, unit, time zone, null policy and allowed range. Ask about ambiguities in the domain meaning. 2. Define keys, uniqueness, relationships and rules for late or corrected records. 3. Create a test table with a valid example, a boundary case, an invalid example and the expected response. Label generated examples as synthetic. 4. Suggest a compatible change strategy and responsibilities for error handling. If you generate code, tailor it to [TECHNOLOGY/VERSION] and distinguish tests actually run from tests merely proposed. At the end, check that every domain rule has at least one test case and no example is unintentionally accepted.
Copy the text into your AI, fill in the placeholders and check the answer.
What you need
- Your own access to a suitable AI. Only add information you are comfortable sharing.
How to start
- Copy the prompt and paste it into your AI.
- Replace the placeholders and add any missing information.
- Check the answer and ask follow-up questions to adapt it to your situation.