<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Testing on srdusr</title><link>https://srdusr.com/tags/testing/</link><description>Recent content in Testing on srdusr</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 03 Sep 2026 05:12:40 +0200</lastBuildDate><atom:link href="https://srdusr.com/tags/testing/index.xml" rel="self" type="application/rss+xml"/><item><title>Tests Cannot See the State the Machine Already Has</title><link>https://srdusr.com/blog/tests-cannot-see-what-the-machine-already-has/</link><pubDate>Wed, 08 Apr 2026 00:00:00 +0000</pubDate><guid>https://srdusr.com/blog/tests-cannot-see-what-the-machine-already-has/</guid><description>&lt;p&gt;Code that creates a precondition stops being exercised on the machine where that
precondition already holds. The development machine ran the setup path once and
never runs it again, so the setup path can break completely and stay green.&lt;/p&gt;
&lt;h2 id="why-it-holds"&gt;Why it holds&lt;/h2&gt;
&lt;p&gt;A test asserts behaviour given a state. The state on a working machine is the
state after setup succeeded. Every branch that runs only when setup has &lt;em&gt;not&lt;/em&gt;
happened is therefore unreachable from that machine, and unreachable code is
untested code no matter what the coverage report says.&lt;/p&gt;</description></item></channel></rss>