Lesson 5 of 5
Testing translations
15 min
Listen to this lesson
A translation table is only as good as its worst row, and the worst row is usually the one nobody tested: a code that isn't in the table. Testing translations means proving every entry in both directions, proving what happens when there is no entry, and proving that the content in production is the content you tested.
Decide the not-found behavior first
The Value Mapping function asks what to do when a value isn't found: pass the key through, use a default, or throw an exception. Each is right somewhere. Pass-through suits codes both sides share in most cases, but it is exactly how Contoso's untranslated PCE reached a supplier. A default suits optional data with a safe fallback. An exception stops the message, which is right when a wrong value costs more than a delayed message: units, plants, tax codes. Write the decision down per table, with the business owner's name.
A test set for one table
| Case | Example (CMC_UNIT_CODES) | Expected |
|---|---|---|
| Every entry, forward | PCE → EA, KGM → KG | Each target value |
| Every entry, reverse | EA → PCE | The default value where targets repeat |
| Unknown value | XYZ | The agreed behavior: key, default or exception |
| Empty value | Unit field missing or empty | Defined behavior, not a silent blank |
| Case and spaces | pce, "PCE " | Decide: values are matched exactly, so normalize first or fail |
| Wrong agency or identifier in the call | Mapping calls CMC_S4 / UOM instead of UNIT | Caught in test: every value comes back unmapped |
Minimum test cases for a value mapping, from each entry to the misconfigured call.
The last row is easy to miss. If a mapping calls the table with a typo in the agency or identifier, every lookup fails, and with pass-through every value goes out untranslated. Only a test that checks a translated value, not just a successful message, catches it.
Prove the deployed content
Design-time content isn't runtime content. A saved but undeployed change has no effect, and a configured value in CMC_PROD can differ from CMC_TEST on purpose. Before go-live of each migrated interface, Contoso reads the deployed value mappings through the OData API in both tenants and compares them. Every difference must be one of the documented, configured exceptions.
Who tests what
Translation testing splits cleanly between roles. The integration team proves the mechanics: the call uses the right agency and identifier, both directions work, and the not-found behavior is what was configured. The business owner proves the content: that DET really is Great Lakes' code for Detroit, and that EA is what Lakeside expects for pieces. Priya's test cases name both, because a perfect lookup of a wrong code is still a wrong order. For partner codes, the final proof is the connected test with the partner, where the partner confirms that the translated values arrived as agreed.
Regression after every content change
Value mappings change more often than flows, and a content change is a release. Keep the table's test set as data, not as manual steps, so it can run after every import, configuration or edit. Contoso's rule: a change to a shared table reruns the translation tests of every interface that reads it, because a code that is right for Lakeside's 850 can be wrong for Great Lakes' 810. The integration flows don't change, but what they send does.
- Decide the not-found behavior per table with the business owner: key, default or exception.
- Test every entry in both directions, an unknown value, an empty value and case or spacing variants.
- Assert translated values, not just successful messages, to catch a wrong agency or identifier.
- Reconcile deployed content between tenants before go-live.
Check your understanding · not graded
Lesson check
1. Which not-found behavior fits a plant code where a wrong value would ship goods from the wrong plant?
2. A mapping calls the table with identifier UOM instead of UNIT and uses pass-through. What does a test that only checks for status 200 show?
3. Why does Contoso compare deployed value mappings between CMC_TEST and CMC_PROD?
4. Which test case belongs in every value mapping test set?