Part VI — Data Quality Engineering

115 minutes, plus the practical exercise
Manuscript status: Draft · Source version: 0.1.0

Chapter 4 — Transformation Quality and Business Rules

Metadata

Field Value
Part Part VI — Data Quality Engineering
MQE-BOK domain Domain 6 — Data Quality Engineering
Chapter 4
Audience Experienced QA Engineers, Test Automation Engineers, SDETs, and aspiring Quality Engineers
Prerequisites Chapters 1–3; Parts I–V, or equivalent experience
Estimated study time 115 minutes, plus the practical exercise
Version 0.1.0
Status Draft

Opening Quote

MSQE educational framing: A successful transformation proves that data moved. It does not, by itself, prove that business meaning survived the movement.

Opening Story

The following illustrative scenario concerns Atlas Commerce, a fictional retailer. Finance notices that its weekly gross-margin report has increased sharply for one market. The transformation that produces the report is green, its output schema is valid, and a regression check confirms that every source order generated a target row.

The team discovers that a new supplier feed provides unit cost in cents while the existing feed provides the same concept in currency units. The enrichment step joins both sources successfully. A derivation then subtracts the incoming unit cost from a revenue amount stored in currency units. The calculation is syntactically correct and every result is numeric, but the report combines different representations of the business fact.

Another issue is hidden in the same transformation. Orders without a supplier cost are assigned zero cost so the report remains complete-looking. For an operational stock view, this default may be a temporary signal. For a margin decision, it turns unknown cost into known zero and overstates profitability.

The repair is not simply to add an assertion for one value. The team needs to state the source-to-target meaning, unit and missing-value rules, aggregation boundary, independent comparison, and remaining uncertainty. Transformation quality begins with that evidence plan.

Why This Chapter Matters

Data is rarely used in exactly the representation in which it is created. Systems map fields, derive values, filter records, enrich facts, convert units, normalise text, select latest state, and aggregate many records into one value. Every transformation is therefore a quality-relevant boundary: it can preserve, clarify, lose, or alter business meaning.

Chapter 3 showed how query results provide bounded evidence about populations, keys, and relationships. This chapter focuses on how values and populations change between source and target. It develops the judgement needed to evaluate mappings and business rules without turning transformation assurance into an ETL-tool tutorial or a catalogue of test cases.

The next chapter will widen the view to pipeline stages and consumers. Here, the primary question is: does the target representation mean what the decision consumer believes it means, under the stated rules and limitations?

Learning Objectives

By the end of this chapter, you should be able to:

  • describe a transformation in terms of source meaning, target meaning, population effect, and decision impact;
  • identify quality risks in mappings, derivations, filters, enrichments, aggregations, unit conversions, null handling, rounding, and time-zone conversion;
  • distinguish a structural mapping check from evidence that a business rule was correctly interpreted;
  • select an independent transformation oracle and identify shared-logic risk;
  • define invariants and exception conditions that can challenge transformation behaviour;
  • explain what a transformation result does and does not establish; and
  • produce a Transformation Quality Evidence Plan that explains decision use and remaining uncertainty.

Transformations Change Meaning, Not Only Shape

A transformation changes data from one representation, population, or level of detail into another. It can be as small as normalising a status code or as consequential as calculating recognised revenue. A transformation may be implemented in application code, a database query, a data-processing job, a report formula, or a spreadsheet. The location does not reduce the need for quality reasoning.

Describe source-to-target meaning

Start with a source-to-target statement that another engineer can inspect:

Element Example: Atlas Commerce margin report
Source fact Settled order amount, supplier cost, currency, refund state, and business date
Target fact Market-level gross margin for eligible orders in a reporting period
Population rule Settled, non-reversed orders in the defined close window; explicit treatment of late settlement
Mapping rule Convert incoming cost to the report currency and scale before subtraction
Derivation Revenue less approved supplier cost, using the stated rounding rule
Exception Missing supplier cost is reported as unresolved, not silently treated as zero
Consumer decision Finance reviews margin movement and investigates material change

The table is an original MSQE educational framing. It prevents a target column with a reassuring name from standing in for a complete definition.

Preserve distinctions that the consumer needs

A target need not preserve every source field. It must preserve, derive, or clearly exclude distinctions required by its intended decision. If a report groups several order statuses into eligible, the grouping should state which statuses are included and why. If a target converts all timestamps to UTC, it should retain enough context to support the relevant business-day interpretation.

Loss of detail is not automatically harmful. Aggregating line items to daily sales can be appropriate for a high-level trend. It is harmful if a refund investigation later needs order-level traceability and the target is presented as its substitute. Evidence should name the decision boundary and the detail intentionally discarded.

Mapping, Derivation, Filtering, and Enrichment

Mappings need semantic, not just syntactic, agreement

A mapping associates a source attribute or fact with a target attribute or fact. A field-to-field mapping such as source.customer_id → target.customer_id can be straightforward. Even then, check whether it identifies the same customer scope, tenant, version, and lifecycle. Mappings become more complex when the source and target names differ or when several source fields create one target value.

Document the rule in terms of meaning. “Copy status to status” is weak. “Map payment settlement state to the finance eligibility state according to the approved accounting rule, preserving unresolved states separately” makes the expected behaviour inspectable.

Derivations must expose formula and policy

A derivation calculates a target fact from one or more inputs. The formula may include business policy: eligibility, tax treatment, currency conversion, discount precedence, or rounding. The calculation therefore needs a rule source and an evidence strategy, not just a handful of expected examples.

Consider a simplified margin calculation:

gross margin = recognised revenue − approved supplier cost

Before applying it, define recognised revenue, approved supplier cost, currency, scale, refund treatment, and rounding point. If any input is unavailable, define whether the target should be absent, provisional, excluded, or represented with a separate state. A formula is only as meaningful as those definitions.

Filters change population

A filter is often described as a technical optimisation. It is also a business inclusion rule. Excluding TEST orders may be appropriate, but how are migrated test-like records identified? Excluding cancelled orders may be inappropriate if a cancellation occurred after revenue recognition and the report needs reversal information.

For every material filter, record:

  • the population before filtering;
  • the condition and owner of its meaning;
  • expected included and excluded categories;
  • known exceptions, such as late or corrected records; and
  • the decision consequence of accidental inclusion or exclusion.

This turns “where clause coverage” into a discussion of population integrity.

Enrichment adds dependency and authority risk

An enrichment joins or looks up additional information, such as a product category, exchange rate, customer segment, or supplier cost. It can improve decision usefulness, but it introduces dependency questions: which source is authoritative, what version applies, what happens when no match exists, and how do updates affect historical results?

An order can be valid without a product-category enrichment. A category-based sales report may not be. The transformation should distinguish absent enrichment from a valid category such as Other; otherwise, a missing reference can silently become a misleading classification.

Aggregation, Units, Precision, and Time

Aggregation changes the evidence boundary

An aggregation combines several records into a summary, such as daily revenue, average delivery duration, or units by product family. It can be valuable because decisions often need trends and totals. It also hides individual variation, duplicates, missing records, and offsetting errors.

Define the grain—the level of detail represented by one target record—before assessing an aggregate. A daily margin row may represent one market, one currency, and one business date. Joining it back to orders without accounting for the one-to-many relationship can multiply totals. Comparing aggregate outputs requires matching population, grouping, time, units, and rounding rules.

Units and scale must remain explicit

Unit conversion is a transformation rule, not cosmetic formatting. Currency units versus minor units, kilograms versus pounds, and seconds versus milliseconds can produce plausible but harmful values when scale is lost. A quality plan should identify the unit at every boundary, the conversion rule, the rate or reference used, and the rounding policy.

For finance data, a conversion may also need a rate date, source, and legal-entity rule. For a physical quantity, it may need measurement precision and tolerance. Do not substitute a generic numeric-range assertion for a unit-aware claim.

Rounding and precision are part of the rule

Rounding can be applied per line, per invoice, per day, or only when displayed. These choices can produce different totals even when every arithmetic operation is technically correct. State the expected precision, rounding mode, calculation stage, and permitted reconciliation difference.

An independent example calculation should use a deliberately separate reasoning path, not merely call the production helper through a test. The aim is not to duplicate the full implementation; it is to create meaningful challenge for high-risk logic.

Time-zone conversion selects a business interpretation

Converting a timestamp changes the calendar date and sometimes the reporting population. A conversion from customer-local time to UTC may be correct for storage but insufficient for warehouse cutoffs. A finance close based on legal-entity time may not agree with a product dashboard based on viewer-local time.

State the time concept: event time, source-recorded time, processing time, business date, or display time. Then define the applicable time zone and cutoff. Chapter 7 develops temporal evidence in depth; here, treat time-zone conversion as a source-to-target semantic rule.

Null Handling and Business Rules

Missingness must not become false certainty

The opening story’s zero-cost default is a common quality failure. A transformation can be operationally convenient while changing “unknown” into “known.” Other risky defaults include a current timestamp for an unrecorded event, an UNKNOWN code for a missing category, or a default country based on a customer’s previous address.

Sometimes a default is the intended business rule. The quality plan should then state the precondition, consumer effect, and how the default can be distinguished from an observed source value. Otherwise, report or preserve the unresolved state.

Business rules need accountable sources

A business rule is an agreed constraint, calculation, classification, or decision condition derived from domain policy. Examples include refund eligibility, a definition of active customer, or whether a shipment counts toward same-day fulfilment. A business rule is not validated merely because an engineer can express it in code.

For a material rule, identify:

  1. the decision and owner;
  2. the source of the rule, including its effective period;
  3. source and target representations;
  4. expected, boundary, and exception cases;
  5. a comparison or oracle that can challenge interpretation; and
  6. the consequence if the rule is wrong or stale.

This is proportionate rule assurance, not a request to automate every policy document.

Worked Example: From Order Facts to a Margin Decision

The following illustrative example concerns Atlas Commerce, a fictional retailer. It shows why a source-to-target comparison must examine meaning, population, and rule interpretation—not only whether rows arrived in a target.

Finance is deciding whether its 30 June 2026 gross-margin result for a German legal entity is suitable for a provisional review. The agreed close uses the Europe/Berlin business date. In June, Berlin is UTC+02:00, so the close ends at 2026-06-30T21:59:59Z. The report includes settled, non-test orders with an approved supplier cost. An order with no approved cost remains visible as unresolved; it is not assigned a zero cost.

Source observations

The compact source extract below is fictional. supplier_cost_raw is supplied in the unit named by cost_unit; it is not automatically a currency-unit amount.

Order Settled at (UTC) Order state Revenue (EUR) Supplier cost raw Cost unit Product-map result Observation
AC-4101 2026-06-30T21:40:00Z SETTLED 120.00 4,500 EUR minor units HOME Before the local close; cost is €45.00 after scale conversion.
AC-4102 2026-06-30T22:30:00Z SETTLED 80.00 3,000 EUR minor units HOME 00:30 on 1 July in Berlin; outside the June local-close population.
AC-4103 2026-06-30T20:10:00Z SETTLED 49.99 HOME Before close, but supplier cost is absent.
AC-4104 2026-06-30T18:00:00Z TEST 20.00 1,000 EUR minor units TEST Deliberately excluded by the approved test-order rule.

The source facts alone do not state a margin result. They establish candidate order facts, timing, cost representation, and one unresolved value. Finance's rule source supplies the rest of the interpretation.

Transformation rule and independent expectation

The agreed transformation is intentionally small enough to calculate independently:

eligible order = settled AND non-test AND settled_at maps to 30 June in Europe/Berlin
approved_cost_eur = supplier_cost_raw / 100 when cost_unit = "EUR minor units"
resolved_margin = revenue_eur − approved_cost_eur
missing approved cost = preserve the order with margin_status = UNRESOLVED; do not substitute zero

An independent calculation starts from the source observations and the approved close rule rather than calling the production transformation.

Order Independent population decision Independent cost Independent margin result
AC-4101 Included 45.00 75.00
AC-4102 Excluded: 1 July local business date
AC-4103 Included but unresolved Margin withheld; unresolved-cost count increases by 1.
AC-4104 Excluded: test order

The expected consumer result is therefore €75.00 resolved gross margin, based on one resolved June order, with one unresolved-cost order. It is suitable only for a provisional discussion that makes the unresolved population visible; it is not evidence that all June margin is known.

Actual target observation

The current target preserves an order row for each non-test input, so a simple source-to-target row-coverage check passes. Its output, however, applies two different semantic rules: it uses the UTC calendar date for the close and treats minor units as currency units. It also defaults an absent cost to zero.

Target order Target business date Reported revenue (EUR) Reported cost (EUR) Reported margin (EUR) Reported status
AC-4101 30 June 120.00 4,500.00 -4,380.00 RESOLVED
AC-4102 30 June 80.00 3,000.00 -2,920.00 RESOLVED
AC-4103 30 June 49.99 0.00 49.99 RESOLVED

The target aggregates these rows to -€7,250.01 and reports zero unresolved costs. The arithmetic follows its implemented inputs, yet the consumer result conflicts with the independently derived rule.

Interpret the discrepancy before choosing a fix

Three distinct discrepancies exist:

  1. AC-4101 shows a scale error: 4,500 minor units were treated as €4,500 rather than €45.
  2. AC-4102 shows a population error: a UTC-date filter includes an order that belongs to the next local business date.
  3. AC-4103 shows an uncertainty-representation error: a default changes an unknown supplier cost into a known zero.

Comparing only source and target values would be insufficient here. The raw source cost of 4,500 appears in the target, and every eligible-looking source order has a target row. Neither observation tests whether 4,500 has the same unit, whether the target uses the correct legal-entity day, or whether zero means an observed cost. The independent result challenges the meaning of the transformation, not merely the movement of fields.

Evidence limit and engineering decision

This example is a deliberately small calculation. It does not establish that all supplier costs are authoritative, that every historical rate is correct, or that the entire June source extract is complete. A production decision would also require a source-population comparison, an approved rule review, and an exception analysis for all unresolved costs.

The proportionate engineering decision is to prevent the report from presenting the current aggregate as a June gross-margin result. Correct the cost-scale and business-date rules, preserve unresolved cost as an explicit state, recalculate the affected period, and provide Finance with a provisional statement that identifies the unresolved population. Add scoped evidence for cost-unit representation, local-close classification, and the absence of silent zero-cost defaults. This improves the decision without prescribing an ETL product or duplicating the implementation in a test.

Independent Transformation Evidence

Avoid shared-logic confidence

When a transformation and its check use the same mapping configuration, helper function, or calculation logic, agreement is useful for detecting some regression but weak evidence that the rule itself is correct. This is shared-logic risk: the same defect can appear on both sides of the comparison.

Strengthen evidence by combining different forms of challenge:

Evidence mechanism Useful contribution Important limit
Mapping completeness check Reveals unmapped or unexpected source fields Does not prove target meaning.
Independent hand calculation Challenges a high-risk example or boundary A small sample does not prove the whole population.
Source-to-target reconciliation Reveals population, identifier, or aggregate differences Requires comparable definitions and timing.
Invariant Challenges a relation that should hold across data The invariant may be too weak or have legitimate exceptions.
Rule review with domain owner Clarifies semantic interpretation and exceptions Agreement on a rule does not prove implementation.
Downstream outcome check Reveals consumer-visible harm It may detect the issue late and obscure its cause.

No single mechanism is universally sufficient. Select the smallest complementary set that can reduce the most consequential uncertainty.

Transformation invariants

An invariant is a condition expected to remain true within a stated boundary. For example, a transformation may preserve the number of unique order identifiers after filtering only explicit test records. A currency conversion may preserve value within a stated rounding tolerance. A category enrichment may preserve every eligible order while separately reporting unknown categories.

An invariant must name its scope and exceptions. “Source count equals target count” is weak when aggregation intentionally changes record count. “Every included settled payment maps to one recognised report entry, except documented reversal cases” is more informative.

State what the evidence cannot prove

An independent calculation can still use an incorrect policy. A reconciliation can still compare two incomplete sources. A rule review can still miss a future exception. Record these limits and use them to choose a review point, monitor, or follow-up investigation.

Supporting asset (Pass 2, planned): Transformation Evidence Boundaries will trace an Atlas Commerce cost-and-margin mapping, highlighting source facts, enrichment dependency, rule, oracle, exception, and residual risk.

Engineering Perspective

Transformation quality should be designed before a high-impact mapping is deployed or relied on. Engineers can make it easier to assess by preserving source identifiers, versions, processing context, error reasons, and safe exception outputs. Product and domain owners can make it assessable by defining what a metric, status, or business rule means. Quality Engineers can expose the evidence boundary and choose the most valuable challenge.

This work does not prescribe a particular transformation framework. Whether the implementation uses code, SQL, a managed service, or a reporting expression, the engineering questions remain: what changed, what should be preserved, which rule applies, how can it be challenged, and what uncertainty remains?

Industry Perspective

Data-quality rules are more useful when they are traceable to a stated information need and can be evaluated consistently. ISO/TS 8000-82 addresses the creation of data rules for data-quality assessment.1 ISO/IEC 25012 provides recognised terminology for structured-data quality.2 These sources support disciplined discussion; they do not mandate a tool, a transformation test suite, or a universal acceptance threshold.

In delivery practice, teams often record mappings, rules, and exceptions in reviews, specifications, migration plans, or versioned configuration. The durable capability is not the document format. It is the ability to inspect a transformation’s meaning and evidence before a downstream decision is harmed.

Common Misconceptions

“Every source row produced a target row, so the transformation is correct.”

The mapping may preserve count while changing units, meaning, time, eligibility, or relationship. Population preservation is one useful claim, not the whole conclusion.

“A default value improves completeness.”

It can improve structural population coverage while hiding unknown or unresolved facts. Explain whether the default is a valid business value or a representation of uncertainty.

“The production formula is the best oracle for its own output.”

It is a useful implementation reference but can share the same flawed logic. Use independent calculations, rules, reconciliations, or invariants proportionately.

“Rounding differences are always harmless.”

They can accumulate, affect customer charges, or obscure a policy disagreement. State the rounding point, rule, and tolerance.

“Transformation quality belongs only to the data team.”

Source meaning, business rules, software behaviour, and consumer decisions cross team boundaries. Ownership should be explicit, but evidence quality is a shared engineering concern.

Summary

Transformations alter representations, populations, and often business meaning. Quality evidence must therefore describe source-to-target semantics, mappings, filters, enrichments, derivations, aggregation grain, units, time, missingness, rules, and exceptions. A successful job or schema-valid target provides bounded evidence; it does not prove that a business rule was interpreted correctly.

The next chapter follows data through ingestion, processing, storage, and consumption. It asks how stage boundaries, partial processing, duplication, loss, and consumer assumptions affect the strength of an end-to-end conclusion.

Key Takeaways

  • A transformation should be evaluated as a change in meaning and population, not merely a change in format.
  • Mapping, filtering, enrichment, derivation, aggregation, units, rounding, null handling, and time conversion are decision-relevant rules.
  • Source-to-target statements make assumptions, exceptions, and consumer impact inspectable.
  • A default can hide uncertainty; preserve distinctions the consumer needs.
  • Independent evidence reduces shared-logic risk but cannot remove every limitation.
  • Invariants and reconciliations must state their scope, relationship, and permitted exceptions.
  • The useful output is a proportionate evidence plan and residual-risk statement, not the largest possible set of transformation checks.

Review Questions

  1. Why is a source-to-target mapping incomplete if it lists only field names?
  2. How can an enrichment create a data-quality risk even when its join succeeds?
  3. What is the difference between aggregation grain and record count?
  4. Why should null/default handling be treated as a business rule?
  5. Give an example of shared-logic risk in transformation evidence.
  6. What information makes a rounding tolerance reviewable?
  7. How can a time-zone conversion change a report population?
  8. What does an invariant need in order to be useful evidence?

Interview Questions

  1. How would you assess a transformation that has full source-to-target coverage but produces a surprising finance metric?
  2. Describe how you would choose an independent oracle for a business calculation.
  3. What questions would you ask before accepting a default value for missing source data?
  4. How would you explain a transformation limitation to a decision maker without blocking all use of the target?
  5. How do you distinguish a valid aggregate from an aggregate that hides a material issue?

Practical Exercise

Transformation Quality Evidence Plan: Atlas Commerce Margin Report

Objective: Create evidence for the transformation described in the opening story without assuming that job success or output-schema validity proves business correctness.

Scenario: Atlas Commerce combines these fictional inputs:

Input Relevant representation Known condition
Settled orders order_id, settled_amount, currency_code, settled_at Amount is stored in currency units.
Supplier feed supplier_order_ref, unit_cost, cost_currency, received_at New supplier sends cost in minor units.
Product map order_id, supplier_order_ref, product_family Some enrichment records are absent.
Margin target market, business_date, gross_margin, unresolved_cost_count Current mapping defaults missing cost to zero.

Tasks:

  1. State the finance decision, target fact, source-to-target population, and business-date rule.
  2. Create a mapping and derivation table that includes unit, scale, currency, rounding, null/default, and enrichment assumptions.
  3. Identify the three most consequential transformation risks and their likely decision impact.
  4. Propose an independent evidence set, including one calculation, one population/relationship comparison, and one exception analysis.
  5. Define two scoped invariants and explain their limits.
  6. Recommend how unresolved cost should be represented and write a residual-risk statement.

Expected artifact: A two- to three-page Transformation Quality Evidence Plan containing source-to-target definitions, rules, evidence mechanisms, exceptions, ownership, limitations, and residual risk.

Reflection: Which target value could look most credible while carrying the least trustworthy meaning?

Portfolio relevance: This artefact demonstrates transformation reasoning rather than platform-specific implementation. Use fictional or safely anonymised information only.

Further Reading

References

Chapter Checklist

Before moving on, confirm that you can:

  • Explain a transformation in terms of source and target meaning, population, rule, and consumer decision.
  • Identify representation risks in mappings, enrichment, aggregation, units, rounding, missingness, and time conversion.
  • Select evidence that challenges a transformation without relying solely on shared implementation logic.
  • State scoped invariants, exceptions, limitations, and residual risk.
  • Produce a Transformation Quality Evidence Plan that another engineer can review.

Footnotes

  1. International Organization for Standardization. ISO/TS 8000-82:2022 — Data quality — Part 82: Data quality assessment: Creating data rules. 2022; accessed 2026-08-11.

  2. International Organization for Standardization. ISO/IEC 25012:2008 — Software engineering — Software product Quality Requirements and Evaluation (SQuaRE) — Data quality model. 2008; confirmed current by ISO catalogue, accessed 2026-08-11.