<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="rss.xsl"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Sonda Blog</title>
        <link>https://danie1net0.github.io/sonda/blog</link>
        <description>Sonda Blog</description>
        <lastBuildDate>Fri, 30 Oct 2026 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[Sonda 1.16: branch coverage for PHP without Xdebug, now in English]]></title>
            <link>https://danie1net0.github.io/sonda/blog/sonda-1-16</link>
            <guid>https://danie1net0.github.io/sonda/blog/sonda-1-16</guid>
            <pubDate>Fri, 30 Oct 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Sonda measures line and branch coverage of a PHP test suite by instrumenting the source instead of]]></description>
            <content:encoded><![CDATA[<p>Sonda measures line and branch coverage of a PHP test suite by instrumenting the source instead of
hooking the engine. Version 1.16 makes it a project for everyone: the CLI, the README and this site
are in English, and the package is on Packagist as <code>ddr/sonda</code>.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-another-coverage-tool">Why another coverage tool<a href="https://danie1net0.github.io/sonda/blog/sonda-1-16#why-another-coverage-tool" class="hash-link" aria-label="Direct link to Why another coverage tool" title="Direct link to Why another coverage tool" translate="no">​</a></h2>
<p>Our CI measured coverage with Xdebug <code>--path-coverage</code>, the only way to get branches in PHP. On a
Laravel suite of 4,500 tests it did not finish in an hour. PCOV is fast, but it only counts lines.
We wanted "100% of the lines and branches of what this merge request changed" as a merge gate, and
nothing could give that in CI time.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-it-does">What it does<a href="https://danie1net0.github.io/sonda/blog/sonda-1-16#what-it-does" class="hash-link" aria-label="Direct link to What it does" title="Direct link to What it does" translate="no">​</a></h2>
<p>Sonda inserts a probe at every branch outcome before the file loads, the way Istanbul does for
JavaScript. A probe is one array assignment; there is no opcode interception and no path
enumeration. On the same suite: 178s without coverage, 174s with Sonda, 671s with Xdebug counting
lines only.</p>
<p>The branch semantics are strict by default: an <code>if</code> without <code>else</code> still needs both outcomes, <code>?-&gt;</code>
counts the null side, and <code>&amp;&amp;</code>/<code>||</code> must short-circuit at least once. The whole suite was compared
with Xdebug path coverage, method by method; the <a class="" href="https://danie1net0.github.io/sonda/docs/comparison-with-xdebug">comparison page</a>
has the numbers and the documented differences.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="in-ci">In CI<a href="https://danie1net0.github.io/sonda/blog/sonda-1-16#in-ci" class="hash-link" aria-label="Direct link to In CI" title="Direct link to In CI" translate="no">​</a></h2>
<p><code>sonda test --changed=origin/master</code> measures only the files the branch changed and fails if any
line or branch of them stays uncovered. <code>--affected</code> runs only the tests that executed those files.
GitLab gets the Cobertura diff annotations and Code Quality entries for free; there are recipes for
<a class="" href="https://danie1net0.github.io/sonda/docs/ci/gitlab">GitLab</a> and <a class="" href="https://danie1net0.github.io/sonda/docs/ci/github-actions">GitHub Actions</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="getting-it">Getting it<a href="https://danie1net0.github.io/sonda/blog/sonda-1-16#getting-it" class="hash-link" aria-label="Direct link to Getting it" title="Direct link to Getting it" translate="no">​</a></h2>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token function" style="color:hsl(207, 82%, 66%)">composer</span><span class="token plain"> require </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">--dev</span><span class="token plain"> ddr/sonda</span><br></div><div class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">vendor/bin/sonda </span><span class="token builtin class-name" style="color:hsl(29, 54%, 61%)">test</span><br></div></code></pre></div></div>
<p>PHP 8.4+, PHPUnit 12 or Pest 4. Issues and pull requests on
<a href="https://github.com/danie1net0/sonda" target="_blank" rel="noopener noreferrer" class="">GitHub</a>.</p>]]></content:encoded>
            <category>Release</category>
            <category>Coverage</category>
        </item>
    </channel>
</rss>