<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Refactoring on Martin C. Richards</title>
    <link>//www.martinrichards.me/tags/refactoring/</link>
    <description>Recent content in Refactoring on Martin C. Richards</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sun, 17 May 2026 08:39:41 +0200</lastBuildDate>
    <atom:link href="//www.martinrichards.me/tags/refactoring/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Test Behaviour, Not Implementation</title>
      <link>//www.martinrichards.me/post/test_behaviour_not_implementation/</link>
      <pubDate>Sun, 17 May 2026 08:39:41 +0200</pubDate>
      <guid>//www.martinrichards.me/post/test_behaviour_not_implementation/</guid>
      <description>&lt;picture&gt;&#xA;  &#xA;  &lt;source&#xA;    type=&#34;image/webp&#34;&#xA;    &#xA;    &#xA;    class=&#34;cover-image&#34;&#xA;    srcset=&#34;&#xA;      /img/frigate-schematics_hu_64cb0b87de23b583.webp 400w, /img/frigate-schematics_hu_8069a4136daf8728.webp 800w, /img/frigate-schematics_hu_389af5879e0c16cc.webp 1200w&#34;&#xA;    sizes=&#34;(max-width: 720px) 100vw, 720px&#34;&#xA;    loading=&#34;lazy&#34;&#xA;    decoding=&#34;async&#34;&#xA;    alt=&#34;Frigate Schematics&#34;&gt;&#xA;  &#xA;  &lt;img&#xA;    &#xA;    &#xA;    class=&#34;cover-image&#34;&#xA;    src=&#34;//www.martinrichards.me/img/frigate-schematics.png&#34;&#xA;    loading=&#34;lazy&#34;&#xA;    decoding=&#34;async&#34;&#xA;    alt=&#34;Frigate Schematics&#34;&gt;&#xA;&lt;/picture&gt;&#xA;&#xA;&#xA;&lt;h1 id=&#34;test-behaviour-not-implementation&#34;&gt;Test behaviour, not implementation&lt;/h1&gt;&#xA;&lt;p&gt;Most testing arguments get lost in theoretical minutiae and miss the point: validating correctness. Testing units at every level makes tests brittle and code resistant to change. Testing full vertical slices is too coarse - it&amp;rsquo;s hard to cover invariants and edge cases.&lt;/p&gt;&#xA;&lt;p&gt;What you want is something in the middle. Validate the edges with real components - make real HTTP calls, send actual messages on the queue, run real queries against a real DB, check the domain gets invoked correctly. Then validate your domain at its interface: mock the edges, mock the unexpected behaviour, make sure the domain behaves as expected.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
