<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Testing | Pierre Donat-Bouillud</title><link>https://www.pdonatbouillud.com/category/testing/</link><atom:link href="https://www.pdonatbouillud.com/category/testing/index.xml" rel="self" type="application/rss+xml"/><description>Testing</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>© Pierre Donat-Bouillud 2026</copyright><lastBuildDate>Mon, 13 Jul 2026 11:27:31 +0200</lastBuildDate><image><url>https://www.pdonatbouillud.com/media/pierre-salzburg-squared.jpg</url><title>Testing</title><link>https://www.pdonatbouillud.com/category/testing/</link></image><item><title>Mutation testing for R with mutator</title><link>https://www.pdonatbouillud.com/project/mutator/</link><pubDate>Mon, 13 Jul 2026 11:27:31 +0200</pubDate><guid>https://www.pdonatbouillud.com/project/mutator/</guid><description>&lt;p>&lt;a href="https://github.com/PRL-PRG/mutator" target="_blank" rel="noopener">mutator&lt;/a> is an automated mutation testing tool for the R language. Mutation testing measures how good a test suite actually is: instead of trusting code coverage, it introduces small, systematic changes (&lt;em>mutants&lt;/em>) into the source code and checks whether the tests notice.&lt;/p>
&lt;p>For instance, given a function that tests &lt;code>if (x &amp;gt; 0)&lt;/code>, mutator generates a mutant where &lt;code>&amp;gt;&lt;/code> is replaced with &lt;code>&amp;lt;&lt;/code>. If the test suite still passes on the mutant, the mutant &lt;em>survived&lt;/em> — a sign that the tests are not exercising that behaviour. If a test fails, the mutant is &lt;em>killed&lt;/em>. The ratio of killed mutants to the total is the &lt;strong>mutation score&lt;/strong>, a direct measure of test suite effectiveness.&lt;/p>
&lt;p>mutator works at the level of the abstract syntax tree and ships a range of mutation operators — arithmetic, comparison, and logical operators, constant and return-value replacements, and statement deletions. It plugs into both &lt;code>testthat&lt;/code> and non-&lt;code>testthat&lt;/code> test layouts, can run mutation testing directly in continuous integration through a reusable GitHub Actions workflow, and can even flag likely &lt;em>equivalent mutants&lt;/em> using LLMs.&lt;/p>
&lt;p>Because running a whole test suite once per mutant is expensive, mutator puts a lot of effort into making it fast: parallel test execution, coverage-guided test selection (running only the tests that cover each mutated line), in-process package loading with &lt;code>pkgload&lt;/code> to avoid an install per mutant, and self-calibrated per-mutant timeouts to prevent hangs.&lt;/p>
&lt;p>mutator is developed at &lt;a href="https://prl-prg.github.io/" target="_blank" rel="noopener">PRL-PRG&lt;/a> with Assanali Amandykov, and was presented at &lt;a href="https://events.digital-research.academy/event/109/contributions/483/" target="_blank" rel="noopener">useR! 2026&lt;/a>.&lt;/p>
&lt;ul>
&lt;li>Source code: &lt;a href="https://github.com/PRL-PRG/mutator" target="_blank" rel="noopener">github.com/PRL-PRG/mutator&lt;/a>&lt;/li>
&lt;li>Reference documentation: &lt;a href="https://prl-prg.github.io/mutator/" target="_blank" rel="noopener">prl-prg.github.io/mutator&lt;/a>&lt;/li>
&lt;/ul></description></item></channel></rss>