<?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: Lionel Draghi</title>
    <description>The latest articles on DEV Community by Lionel Draghi (@lioneldraghi).</description>
    <link>https://dev.to/lioneldraghi</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2373217%2Fe12be37b-ced4-4b2c-a64d-eead2978736a.jpeg</url>
      <title>DEV Community: Lionel Draghi</title>
      <link>https://dev.to/lioneldraghi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lioneldraghi"/>
    <language>en</language>
    <item>
      <title>Docs that never lie</title>
      <dc:creator>Lionel Draghi</dc:creator>
      <pubDate>Fri, 20 Feb 2026 22:11:06 +0000</pubDate>
      <link>https://dev.to/lioneldraghi/docs-that-never-lie-4df</link>
      <guid>https://dev.to/lioneldraghi/docs-that-never-lie-4df</guid>
      <description>&lt;p&gt;&lt;strong&gt;Turn your README into a living spec&lt;/strong&gt;: bbt embeds executable examples directly into your test suite. &lt;/p&gt;

&lt;p&gt;Docs that &lt;strong&gt;never lie&lt;/strong&gt; — because they run with your code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/LionelDraghi/bbt" rel="noopener noreferrer"&gt;bbt&lt;/a&gt;&lt;/p&gt;

</description>
      <category>runthedoc</category>
      <category>bbd</category>
      <category>testing</category>
      <category>cli</category>
    </item>
    <item>
      <title>My dream way of testing</title>
      <dc:creator>Lionel Draghi</dc:creator>
      <pubDate>Mon, 03 Feb 2025 18:41:08 +0000</pubDate>
      <link>https://dev.to/lioneldraghi/my-dream-way-of-testing-8m9</link>
      <guid>https://dev.to/lioneldraghi/my-dream-way-of-testing-8m9</guid>
      <description>&lt;h2&gt;
  
  
  The dream
&lt;/h2&gt;

&lt;p&gt;Let's not kid ourselves, nobody is interested in writing tests.&lt;br&gt;
It's every software engineer's dream to see tests generated automatically.&lt;br&gt;
But generated from what?&lt;/p&gt;

&lt;p&gt;In most project, there is no formal method used for behavior specification, but at least there is some description in plain english.&lt;/p&gt;

&lt;p&gt;For example, to describe a &lt;code&gt;gcc&lt;/code&gt; simple use case, it could be :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Scenario: compiling and executing an hello word&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Given the new file &lt;span class="sb"&gt;`main.c`&lt;/span&gt;
&lt;span class="p"&gt;```&lt;/span&gt;&lt;span class="nl"&gt;c
&lt;/span&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, World!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;```&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; And given there is no &lt;span class="sb"&gt;`main`&lt;/span&gt; file
&lt;span class="p"&gt;
-&lt;/span&gt; When I successfully run &lt;span class="sb"&gt;`gcc main.c -o main`&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; And  I run &lt;span class="sb"&gt;`main`&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Then the output is &lt;span class="sb"&gt;`Hello, World!`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's a markdown file, using a classic Gherkin framework, perfectly suitable for documentation.&lt;br&gt;
And it contains all the necessary information to actually run the test.&lt;/p&gt;

&lt;p&gt;So why should I have to rewrite the same story in some test framework using some specific programming language? Not only is it a useless task, but it also creates a constantly problematic second source of truth.&lt;br&gt;
No, I should be able to run it just as is.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;And that's my dream : be able to just &lt;strong&gt;run the doc&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Let's try something...
&lt;/h2&gt;

&lt;p&gt;In spring 2024, I started playing with this idea. &lt;br&gt;
Most of my end-to-end tests use the same framework :  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;setup some input &lt;/li&gt;
&lt;li&gt;run the app with some options&lt;/li&gt;
&lt;li&gt;check the output
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The needed vocabulary being limited in that context, I considered that it was not unrealistic to use an input file in plain english like the example above instead of some script, and decided to build a prototype. It turned out that implementation was... manageably complex, and it wasn't long before the prototype was usable.&lt;/p&gt;

&lt;p&gt;I use (and love) the test first approach. Not because of the usual bullshit "coverage" argument, but because writing a use case is a great help to design, and an effective way to communicate about the behavior. As a consequence, description like the above being already part of my design process, &lt;strong&gt;the test comes for me at zero cost&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ultimately, the prototype demonstrated not only an immediate boost in productivity, but also a rapid learning curve.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  I want it too!
&lt;/h2&gt;

&lt;p&gt;Good news, this tool, called &lt;code&gt;bbt&lt;/code&gt;, is now available &lt;a href="https://github.com/LionelDraghi/bbt/tree/main" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
It's easy to &lt;a href="https://github.com/LionelDraghi/bbt?tab=readme-ov-file#installation" rel="noopener noreferrer"&gt;install&lt;/a&gt; on Linux and Windows. &lt;br&gt;
(It compiles on MacOS, but isn't tested on my side for now).&lt;/p&gt;

&lt;p&gt;Current version is 0.0.6, meaning that bbt is still in a early development stage, and open to improvement : comments, use cases, good practices, ideas, pain points are all more than welcome &lt;a href="https://github.com/LionelDraghi/bbt/discussions" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Acknowledgments
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Many thanks to &lt;code&gt;bbt&lt;/code&gt;'s early adopters and contributors &lt;a href="https://github.com/pyjarrett" rel="noopener noreferrer"&gt;Paul&lt;/a&gt; and &lt;a href="https://github.com/mgrojo" rel="noopener noreferrer"&gt;Manuel&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Many thanks to &lt;a href="https://blog.adacore.com/" rel="noopener noreferrer"&gt;AdaCore&lt;/a&gt;, who awarded &lt;code&gt;bbt&lt;/code&gt; the &lt;a href="https://blog.adacore.com/ada-spark-crate-of-the-year-2024-winners-announced" rel="noopener noreferrer"&gt;Ada Crate of the Year Prize&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>test</category>
      <category>cli</category>
      <category>runthedoc</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
