<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mira Lund</title>
    <description>The latest articles on DEV Community by Mira Lund (@mira_lund).</description>
    <link>https://dev.to/mira_lund</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4215001%2F4170c212-17cb-4cac-a72e-63e4e3f78a4c.jpg</url>
      <title>DEV Community: Mira Lund</title>
      <link>https://dev.to/mira_lund</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mira_lund"/>
    <language>en</language>
    <item>
      <title>dbt tests that actually catch something</title>
      <dc:creator>Mira Lund</dc:creator>
      <pubDate>Sun, 01 Nov 2026 15:05:49 +0000</pubDate>
      <link>https://dev.to/mira_lund/dbt-tests-that-actually-catch-something-4pc1</link>
      <guid>https://dev.to/mira_lund/dbt-tests-that-actually-catch-something-4pc1</guid>
      <description>&lt;p&gt;Most dbt test suites I've seen are a wall of &lt;code&gt;not_null&lt;/code&gt; checks that pass forever. The useful ones are a handful of tests that fail when the data changes shape.&lt;/p&gt;

&lt;p&gt;My short list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;uniqueness on the grain.&lt;/strong&gt; If a model is one row per order, test that. When it fails, you have a fan-out join.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;relationships on foreign keys.&lt;/strong&gt; Cheap, and they catch the missing row before the dashboard does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;freshness on sources.&lt;/strong&gt; A stale source that nobody notices is worse than a failed pipeline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;one singular test per business rule.&lt;/strong&gt; "Refund amount must be ≤ original amount" is worth more than 40 &lt;code&gt;not_null&lt;/code&gt; checks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pattern: test the invariants you'd otherwise discover in a meeting.&lt;/p&gt;

&lt;p&gt;I used to think more tests meant more confidence. Now I think fewer, sharper tests mean people actually read the failures.&lt;/p&gt;

&lt;p&gt;What's your one singular test you'd never remove?&lt;/p&gt;

</description>
      <category>data</category>
      <category>dbt</category>
      <category>sql</category>
    </item>
    <item>
      <title>The dbt test that would have caught our duplicate orders</title>
      <dc:creator>Mira Lund</dc:creator>
      <pubDate>Thu, 29 Oct 2026 10:22:25 +0000</pubDate>
      <link>https://dev.to/mira_lund/the-dbt-test-that-would-have-caught-our-duplicate-orders-3oc5</link>
      <guid>https://dev.to/mira_lund/the-dbt-test-that-would-have-caught-our-duplicate-orders-3oc5</guid>
      <description>&lt;p&gt;Six weeks of duplicate orders in a revenue dashboard, and the fix was a test we already knew how to write.&lt;/p&gt;

&lt;p&gt;What happened: our orders source table got a second feed during a migration. Both feeds used the same order id, so joins against order items fanned out and every affected order counted twice. Nobody noticed because the number went up slowly, and up looks like growth.&lt;/p&gt;

&lt;p&gt;The test that would have caught it on day one is boring: a uniqueness test on order_id in the staging model. Not on the mart, on staging, where the two feeds first meet. We had a uniqueness test on the mart's order_id, and it passed the whole time, because the mart aggregated before it duplicated.&lt;/p&gt;

&lt;p&gt;Two other rules I now apply:&lt;/p&gt;

&lt;p&gt;Tests belong at the first place two sources meet, not at the end of the pipeline.&lt;/p&gt;

&lt;p&gt;If a source gains a feed, the staging model needs a review, not just a backfill.&lt;/p&gt;

&lt;p&gt;The dashboard was never wrong about what it measured. It was measuring two versions of the same order.&lt;/p&gt;

</description>
      <category>dbt</category>
      <category>data</category>
      <category>sql</category>
    </item>
  </channel>
</rss>
