<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Blog</title>
<link>https://www.developerdevelopment.com/blog/</link>
<atom:link href="https://www.developerdevelopment.com/blog/index.xml" rel="self" type="application/rss+xml"/>
<description></description>
<generator>quarto-1.10.18</generator>
<lastBuildDate>Wed, 28 Oct 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>Efficient Grammar Fuzzing</title>
  <dc:creator>Benito Aguero</dc:creator>
  <dc:creator>Rivan Deets</dc:creator>
  <link>https://www.developerdevelopment.com/blog/fb7-fall2026/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This post discusses the <a href="https://www.fuzzingbook.org/html/GrammarFuzzer.html">Efficient Grammar Fuzzing</a> chapter from <a href="https://www.fuzzingbook.org/">The Fuzzing Book</a>. In this post, we will cover derivation trees and what they are, tree expansion and how it works, and cost functions and how they control string generation. We will examine both the theoretical concepts as well as code examples explaining how it works in practice.</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>Grammars are essential tools for producing syntactically valid inputs while offering a structured approach to test generation. However, simple string-based replacement algorithms are slow and easily get stuck in infinite loops. This chapter refines the string-based algorithm into a tree-based algorithm, allowing for faster fuzzers that offer far more control over input production.</p>
<section id="what-is-a-derivation-tree" class="level3">
<h3 class="anchored" data-anchor-id="what-is-a-derivation-tree">What is a Derivation Tree?</h3>
<p>In grammar fuzzing, derivation trees are used to manage and control the expansion of grammar rules. A derivation tree represents the entire structure of a generated string, keeping track of which parts have been expanded and which still need work.</p>
<p>Each node in the tree corresponds to either a terminal or a non-terminal symbol. The tree is built step by step, starting from a root node and progressively expanding non-terminals until only terminal symbols remain.</p>
<section id="make-up-of-a-derivation-tree" class="level4">
<h4 class="anchored" data-anchor-id="make-up-of-a-derivation-tree">Make-Up of a Derivation Tree</h4>
<p>Below are the core components of a derivation tree:</p>
<ul>
<li><strong>Terminal Node(s):</strong> The “leaf” nodes representing actual characters or words in the final output. They cannot be expanded further.</li>
<li><strong>Non-terminal Node(s):</strong> Symbols like <code>&lt;expr&gt;</code> or <code>&lt;term&gt;</code> that can be expanded into other symbols using grammar rules.</li>
<li><strong>Root Node:</strong> The starting symbol of the grammar (usually <code>&lt;start&gt;</code>).</li>
<li><strong>Expansion:</strong> The recursive process of replacing non-terminal nodes with their corresponding grammar definitions.</li>
</ul>
<p>While naive string-based fuzzers search through raw text—causing slow <img src="https://latex.codecogs.com/png.latex?O(N%5E2)"> execution times and infinite loops—derivation trees fix these issues by storing structural history and updating nodes directly in place. Instead of repeatedly scanning a growing string via regular expressions to find remaining nonterminals, tree-based algorithms target exact child references in memory, yielding a dramatic boost in efficiency.</p>
<p><strong>What is the purpose of using a derivation tree in grammar-based string generation, and how does it improve the process compared to generating a string directly?</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<p>Derivation trees provide a structured representation of the string generation process. By keeping track of un-expanded nodes in a tree structure rather than scanning a growing string, the fuzzer runs in linear time <img src="https://latex.codecogs.com/png.latex?O(N)">, avoids infinite loops, and allows fine-grained control over input complexity while preserving the complete derivation history for debugging.</p>
</details>
</section>
</section>
<section id="how-expansion-works" class="level3">
<h3 class="anchored" data-anchor-id="how-expansion-works">How Expansion Works</h3>
<p>Expansion starts by finding an un-expanded non-terminal symbol (a leaf node with no children). An expansion rule is selected from the grammar, converted into child nodes, and added to that leaf. The fuzzer then picks another non-terminal to expand until no un-expanded symbols remain.</p>
<p>Crucially, tree expansion relies on in-place mutation. Rather than rebuilding the entire structure at each step, <code>expand_tree_once()</code> locates an expandable child node and swaps out its placeholder directly in memory, keeping execution lightning fast.</p>
<p>In Python, we use simple data conventions to represent node states:</p>
<ul>
<li><code>None</code> indicates an un-expanded non-terminal symbol (ready to be expanded).</li>
<li><code>[]</code> (i.e., an empty list) indicates a terminal symbol (cannot be expanded).</li>
</ul>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Represents &lt;expr&gt; -&gt; &lt;expr&gt; + &lt;term&gt;</span></span>
<span id="cb1-2">derivation_tree <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (</span>
<span id="cb1-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;start&gt;"</span>,</span>
<span id="cb1-4">    [</span>
<span id="cb1-5">        (</span>
<span id="cb1-6">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;expr&gt;"</span>,</span>
<span id="cb1-7">            [</span>
<span id="cb1-8">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;expr&gt;"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>),  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pending expansion</span></span>
<span id="cb1-9">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" + "</span>, []),  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Terminal node</span></span>
<span id="cb1-10">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;term&gt;"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>),  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pending expansion</span></span>
<span id="cb1-11">            ],</span>
<span id="cb1-12">        )</span>
<span id="cb1-13">    ],</span>
<span id="cb1-14">)</span></code></pre></div></div>
</section>
</section>
<section id="what-are-the-three-main-strategies-for-tree-expansion" class="level2">
<h2 class="anchored" data-anchor-id="what-are-the-three-main-strategies-for-tree-expansion">What are the three main strategies for tree expansion</h2>
<details>
<summary>
Click to Expand for the Answer
</summary>
<ol type="1">
<li>Random expansion</li>
<li>Minimum cost expansion</li>
<li>Maximum cost expansion</li>
</ol>
</details>
<section id="cost-functions" class="level3">
<h3 class="anchored" data-anchor-id="cost-functions">Cost Functions</h3>
<p>To stop derivation trees from growing infinitely large or getting trapped in recursive loops, we use cost functions. Cost functions compute the “distance” or complexity needed to close off a non-terminal symbol with terminal values.</p>
<section id="determine-the-cost-of-expanding" class="level4">
<h4 class="anchored" data-anchor-id="determine-the-cost-of-expanding">Determine the Cost of Expanding</h4>
<ol type="1">
<li><p><strong><code>symbol_cost</code></strong>: Calculates the minimum expansion cost among all candidate rules for a non-terminal symbol.</p></li>
<li><p><strong><code>expansion_cost</code></strong>: Calculates the total cost of an expansion rule by summing up the costs of its symbols. Re-entering a recursive non-terminal sets its cost to infinity to prevent loops.</p></li>
</ol>
</section>
<section id="expanding-by-minimum-and-maximum-cost" class="level4">
<h4 class="anchored" data-anchor-id="expanding-by-minimum-and-maximum-cost">Expanding by Minimum and Maximum Cost</h4>
<p>Using cost metrics, <code>GrammarFuzzer</code> can dynamically shift strategies to control the size of generated test cases:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> GrammarFuzzer(GrammarFuzzer):</span>
<span id="cb2-2"></span>
<span id="cb2-3">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> expand_node_min_cost(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, node: DerivationTree) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> DerivationTree:</span>
<span id="cb2-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.log:</span>
<span id="cb2-5">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expanding"</span>, all_terminals(node), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"at minimum cost"</span>)</span>
<span id="cb2-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.expand_node_by_cost(node, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>)</span>
<span id="cb2-7"></span>
<span id="cb2-8">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> expand_node_max_cost(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, node: DerivationTree) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> DerivationTree:</span>
<span id="cb2-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.log:</span>
<span id="cb2-10">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expanding"</span>, all_terminals(node), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"at maximum cost"</span>)</span>
<span id="cb2-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.expand_node_by_cost(node, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>)</span></code></pre></div></div>
<p><strong>In what specific situations would someone prefer to use expanding by maximum versus minimum costs?</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<ul>
<li><p>Minimum Cost: Ideal for quickly wrapping up open trees, avoiding runaway recursion, or producing short, clean edge-case inputs.</p></li>
<li><p>Maximum Cost: Ideal for generating deep, complex inputs to stress-test parsers, compilers, and interpreters against intricate nested structures.</p></li>
</ul>
</details>
</section>
</section>
</section>
<section id="key-takeaways" class="level2">
<h2 class="anchored" data-anchor-id="key-takeaways">Key Takeaways</h2>
<p>Derivation trees and cost functions transform grammar fuzzing from an inefficient string-matching process into a fast, controllable testing engine. By managing expansion steps as tree nodes, fuzzers avoid infinite loops, operate in linear time, and can precisely tune input size using cost-based strategies.</p>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our tool is <code>GrammarForge</code>, a tool that creates test inputs for a program that expects structured input. <a href="https://github.com/Rivan-Deets/GrammarForge">GrammarForge on GitHub</a>.</p>
</div>
</div>
</div>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Reference">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-2-contents" aria-controls="callout-2" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Reference
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-2" class="callout-2-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Unless otherwise noted, the source code segments in this article are excerpted directly from the <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. The authors of this online book licensed the source code and its written content under the <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0 Creative Commons License</a>. More details about the license for the Fuzzing Book are available in the <a href="https://github.com/uds-se/fuzzingbook/blob/master/LICENSE.md">The Fuzzing Book License</a>.</p>
</div>
</div>
</div>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>software engineering</category>
  <category>fuzzing book</category>
  <guid>https://www.developerdevelopment.com/blog/fb7-fall2026/</guid>
  <pubDate>Wed, 28 Oct 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Fuzzing with Grammars</title>
  <dc:creator>V Rieger</dc:creator>
  <dc:creator>Logan Butler</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/fb6-fall2026/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This blog focuses on the <a href="https://www.fuzzingbook.org/html/Grammars.html">“Fuzzing with Grammars”</a> chapter of <a href="https://www.fuzzingbook.org/">The Fuzzing Book</a>. Fuzzing is a way of testing software by generating random inputs to see if they will fail or not. This chapter introduces the concept of fuzzing with grammars. A grammar provides a structure to how the inputs are generated, which can help to provide more valid inputs for testing in a more systematic and efficient way.</p>
<section id="synopsis" class="level3">
<h3 class="anchored" data-anchor-id="synopsis">Synopsis</h3>
<p>The fuzzing book describes a grammar as “a mapping of nonterminal symbols to lists of alternative expansions.” In the book, nonterminal symbols are notated with angle brackets, like <code>&lt;nonterminal&gt;</code>. Each nonterminal will have a list of expansions to be made, eventually all leading to terminal symbols, the actual characters used in the input. For example, <code>&lt;digit&gt;</code>, a nonterminal, leads to the expansions <code>["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]</code>. Any of those numbers can be chosen to replace any space where <code>&lt;digit&gt;</code> appears in the grammar.</p>
</section>
<section id="input-languages" class="level3">
<h3 class="anchored" data-anchor-id="input-languages">Input Languages</h3>
<p>According to the fuzzing book, “all possible behaviors of a program can be triggered by input,” meaning that input is what changes how the code can behave. “Input” can be data from files, network connections, user input, etc. The set of all valid inputs to a program is called a <code>language</code>. For example, the Python language contains the set of all valid Python programs. Another example the book uses is how a regular expression like <code>[a-z]*</code> represents all sequences of lowercase letters.</p>
</section>
<section id="grammars" class="level3">
<h3 class="anchored" data-anchor-id="grammars">Grammars</h3>
<p>Grammars are the systems for specifying how input languages are generated. They are formulas used for expressing the syntax, or rules for how characters and symbols can be arranged. The grammars the book uses are context-free grammars which are one of the types of formal grammars that can be used to describe the syntax of programming languages. Context-free grammars are given their name because nonterminals can always be replaced with their expansions regardless of what surrounds them; they don’t need context to be replaced.</p>
<section id="rules-and-expansions" class="level4">
<h4 class="anchored" data-anchor-id="rules-and-expansions">Rules and Expansions</h4>
<p>Grammars have somewhere to begin with — a start symbol — and a set of rules for expansion. In the book’s example:</p>
<pre class="text"><code>&lt;start&gt;  ::= &lt;integer&gt;
&lt;integer&gt; ::= &lt;digit&gt; | &lt;digit&gt;&lt;integer&gt;
&lt;digit&gt;   ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9</code></pre>
<p>Originally beginning with <code>&lt;start&gt;</code>, the first expansion is to replace <code>&lt;start&gt;</code> with <code>&lt;integer&gt;</code>. Then, <code>&lt;integer&gt;</code> can be replaced with either <code>&lt;digit&gt;</code> or <code>&lt;digit&gt;&lt;integer&gt;</code>. If <code>&lt;digit&gt;</code> is chosen, it can be replaced with any of the digits 0-9. If <code>&lt;digit&gt;&lt;integer&gt;</code> is chosen, <code>&lt;digit&gt;</code> will be replaced as before, but now <code>&lt;integer&gt;</code> will also be replaced with either <code>&lt;digit&gt;</code> or <code>&lt;digit&gt;&lt;integer&gt;</code>. This process continues until all nonterminals have been replaced with terminals, resulting in a valid input for the program. You can also have characters next to nonterminals, like <code>+&lt;integer&gt;</code>, which would result in a <code>+</code> followed by a valid integer.</p>
</section>
<section id="arithmetic-expressions" class="level4">
<h4 class="anchored" data-anchor-id="arithmetic-expressions">Arithmetic Expressions</h4>
<p>Grammar can also be used to generate entire arithmetic expressions. For example:</p>
<pre class="text"><code>&lt;start&gt;   ::= &lt;expr&gt;
&lt;expr&gt;    ::= &lt;term&gt; + &lt;expr&gt; | &lt;term&gt; - &lt;expr&gt; | &lt;term&gt;
&lt;term&gt;    ::= &lt;term&gt; * &lt;factor&gt; | &lt;term&gt; / &lt;factor&gt; | &lt;factor&gt;
&lt;factor&gt;  ::= +&lt;factor&gt; | -&lt;factor&gt; | (&lt;expr&gt;) | &lt;integer&gt; | &lt;integer&gt;.&lt;integer&gt;
&lt;integer&gt; ::= &lt;digit&gt;&lt;integer&gt; | &lt;digit&gt;
&lt;digit&gt;   ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9</code></pre>
<p>This could generate an expression like <code>-3.14 + 2 * (1 - 5)</code>, which is a valid arithmetic expression according to the grammar. This expression can be computed later on, but first the grammar is used to generate it.</p>
</section>
</section>
<section id="representing-grammars-in-python" class="level3">
<h3 class="anchored" data-anchor-id="representing-grammars-in-python">Representing Grammars in Python</h3>
<p>The first step of representing grammars in Python is figuring out the format to display it with. The easiest way is to do this with a dictionary, where the keys are the nonterminals and the values are lists of expansions.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1">    DIGIT_GRAMMAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb3-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;start&gt;"</span>:</span>
<span id="cb3-3">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;integer&gt;"</span>],</span>
<span id="cb3-4"></span>
<span id="cb3-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;integer&gt;"</span>:</span>
<span id="cb3-6">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;digit&gt;&lt;integer&gt;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;digit&gt;"</span>],</span>
<span id="cb3-7"></span>
<span id="cb3-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;digit&gt;"</span>:</span>
<span id="cb3-9">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9"</span>]</span>
<span id="cb3-10">}</span></code></pre></div></div>
<p>Each key is a single nonterminal, which is what makes this a context-free grammar. Each item in a value list is what could possibly replace that nonterminal.</p>
</section>
<section id="some-definitions" class="level3">
<h3 class="anchored" data-anchor-id="some-definitions">Some Definitions</h3>
<p>The book then defines two functions: <code>nonterminals</code> and <code>is_nonterminal</code>. The former uses regular expressions to find all nonterminals to be replaced, and the latter checks if the nonterminals that are found are actually options in the grammar.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> re</span>
<span id="cb4-2"></span>
<span id="cb4-3">RE_NONTERMINAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r'</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[^&lt;&gt; ]</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb4-4"></span>
<span id="cb4-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> nonterminals(expansion):</span>
<span id="cb4-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># In later chapters, we allow expansions to be tuples,</span></span>
<span id="cb4-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># with the expansion being the first element</span></span>
<span id="cb4-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(expansion, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">tuple</span>):</span>
<span id="cb4-9">        expansion <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> expansion[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb4-10"></span>
<span id="cb4-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> RE_NONTERMINAL.findall(expansion)</span></code></pre></div></div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> is_nonterminal(s):</span>
<span id="cb5-2">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> RE_NONTERMINAL.match(s)</span></code></pre></div></div>
</section>
<section id="a-simple-grammar-fuzzer" class="level3">
<h3 class="anchored" data-anchor-id="a-simple-grammar-fuzzer">A Simple Grammar Fuzzer</h3>
<p>The book then builds a simple grammar fuzzer, using a <code>while</code> loop to keep replacing nonterminals with expansions until there are no more nonterminals left. The fuzzer also defines <code>max_nonterminals</code> and <code>max_expansions</code> to avoid infinite loops in case of recursion. Lastly, it has a logging option to show the process of the input being build from the grammar.</p>
</section>
<section id="visualizing-grammars" class="level3">
<h3 class="anchored" data-anchor-id="visualizing-grammars">Visualizing Grammars</h3>
<p>The fuzzing book provides an option to visualize grammars: <a href="https://www.fuzzingbook.org/html/RailroadDiagrams.html">Railroad Diagrams</a> (also called Syntax Diagrams). These diagrams follow possible paths left to right to simulate the generation of an input.</p>
</section>
<section id="some-grammars" class="level3">
<h3 class="anchored" data-anchor-id="some-grammars">Some Grammars</h3>
<p>The book provides three example grammars: one for <code>cgi_decode</code> (a function introduced in the coverage chapter), one for generating URLs, and one that uses English to create actual sentences. These all show the uses that grammars can have.</p>
</section>
<section id="grammars-as-mutation-seeds" class="level3">
<h3 class="anchored" data-anchor-id="grammars-as-mutation-seeds">Grammars as Mutation Seeds</h3>
<p>A grammar is made to produce valid inputs. This can be useful for testing with valid inputs, of course, but it can also be useful in combination with mutation testing. Using grammars to generate valid inputs first gives the mutation testing a wider range of seeds to mutate from. This can help to find more bugs in the program being tested.</p>
</section>
<section id="a-grammar-toolbox" class="level3">
<h3 class="anchored" data-anchor-id="a-grammar-toolbox">A Grammar Toolbox</h3>
<p>The book also mentions a couple smaller pieces of information that can be useful when working with grammars.</p>
<ul>
<li><strong>Escapes</strong>: When using <code>&lt;</code> and <code>&gt;</code> to denote nonterminals, it can be useful to have a way to escape them if they are needed in the input.</li>
<li><strong>Extending Grammars</strong>: How to add new nonterminals and expansions to an existing grammar using copy.</li>
<li><strong>Character Classes</strong>: Sometimes there are quicker ways to create a list with a lot of expansions, like using a function to generate a list from <code>string.ascii_letters</code>, rather than typing out every single letter.</li>
<li><strong>Grammar Shortcuts</strong>: Rather than requiring recursion to give any repetition, symbols like <code>*</code> and <code>+</code> can be used to denote zero or more, and one or more repetitions, respectively. Another shortcut is to use parentheses to symbolize that what is inside is optional.</li>
<li><strong>Grammar Extensions</strong>: Expansions can be included in a tuple, where the first element is the expansion and the second can be additional information if there are any constraints you may want, such as the minimum or maximum depth.</li>
</ul>
</section>
<section id="checking-grammars" class="level3">
<h3 class="anchored" data-anchor-id="checking-grammars">Checking Grammars</h3>
<p>As with all code, testing is important. The book uses <code>assert</code> statements and runs is_valid_grammar to check that all symbols that occur are actually defined and that all symbols are actually reachable from the start symbol. For example, <code>{"&lt;start&gt;": ["&lt;x&gt;"], "&lt;y&gt;": ["1"]}</code> would not pass as <code>&lt;y&gt;</code> can never be reached.</p>
</section>
<section id="lessons-learned" class="level3">
<h3 class="anchored" data-anchor-id="lessons-learned">Lessons Learned</h3>
<ul>
<li>Grammars are the systems for specifying how input languages are generated.</li>
<li>The set of all valid inputs to a program is called a <code>language</code>.</li>
<li>Each nonterminal will have a list of expansions to be made, eventually all leading to terminal symbols.</li>
<li>Fuzzing with grammars can be used in combination with mutation testing as a provider of valid seeds from which to mutate.</li>
</ul>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our tool is <code>FuzzGram</code> a command-line grammar fuzzer that creates random inputs following a grammar’s rules. <a href="https://github.com/loganbutler01/FuzzGram">FuzzGram on GitHub</a>.</p>
</div>
</div>
</div>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Reference">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-2-contents" aria-controls="callout-2" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Reference
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-2" class="callout-2-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Unless otherwise noted, the source code segments in this article are excerpted directly from the <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. The authors of this online book licensed the source code and its written content under the <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0 Creative Commons License</a>. More details about the license for the Fuzzing Book are available in the <a href="https://github.com/uds-se/fuzzingbook/blob/master/LICENSE.md">The Fuzzing Book License</a>.</p>
</div>
</div>
</div>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>
</section>

 ]]></description>
  <category>post</category>
  <category>fuzzing book</category>
  <category>software engineering</category>
  <guid>https://www.developerdevelopment.com/blog/fb6-fall2026/</guid>
  <pubDate>Wed, 21 Oct 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>How to Lead a Team</title>
  <dc:creator>Dylan DeLong-Headley</dc:creator>
  <dc:creator>Abishek Dhakal</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/se6-fall2026/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This blog post explores the <a href="https://abseil.io/resources/swe-book/html/ch05.html">“How to Lead a Team”</a> chapter from <a href="https://abseil.io/resources/swe-book"><em>Software Engineering at Google</em></a>, written by Brian Fitzpatrick. After earlier chapters on team culture, this chapter discusses the people who work to help a team succeed: its leaders. The chapter compares a team without a leader to a boat without a captain. It may keep moving, but it drifts without a clear direction. Even for engineers who never plan to manage anyone, understanding good leadership helps them work better with their own leaders and guide their own projects.</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>Google recognizes two leadership roles: a manager, who leads people, and a tech lead, who leads the technical work. Both roles require planning, but they call for different people skills. The chapter argues that leading a team is a different job from writing software, so strong engineers do not automatically become strong managers. Good leaders move away from traditional command-style management and focus on serving their team. They delegate whenever they can, remove obstacles, and keep the team focused on the right goals while protecting it from outside distractions. The sections below cover how engineers move into leadership, what today’s engineering managers do, which habits help or harm a team, and how leaders can support each person’s motivation and growth.</p>
<section id="managers-tech-leads" class="level3">
<h3 class="anchored" data-anchor-id="managers-tech-leads">Managers &amp; Tech Leads</h3>
<p>Engineering leadership includes two closely connected roles. An engineering manager supports the team’s performance, productivity, and well-being while balancing individual needs with the goals of the business. A tech lead focuses on the technical direction of the product, including architecture, technology choices, priorities, and project coordination. Together, they help engineers find work that matches their abilities and gives them opportunities to grow.</p>
<p>On smaller teams, one person may fill both roles as a Tech Lead Manager (TLM). This requires balancing technical contributions with delegation and people management, which can be difficult for someone moving from an individual contributor role. Larger teams at Google generally divide these responsibilities between two people so each can give their work enough attention. Across these roles, effective leadership depends on helping other people succeed. A tech lead who delegates a task, even when completing it personally would be faster, can build the team’s skills and ability to work independently.</p>
</section>
<section id="moving-from-an-individual-contributor-role-to-a-leadership-role" class="level3">
<h3 class="anchored" data-anchor-id="moving-from-an-individual-contributor-role-to-a-leadership-role">Moving from an Individual Contributor Role to a Leadership Role</h3>
<p>Every project needs someone to guide it, and that person is often an engaged individual contributor who gradually starts settling disagreements, making decisions, and coordinating teammates. The chapter calls this drift “manageritis”. Even engineers who insist they will never manage can end up leading after doing their work well. The chapter does not try to convince readers to become managers. Instead, it explains how good leaders serve their teams through humility, respect, and trust, so that anyone can understand leadership well enough to guide their own work.</p>
<p>Many engineers are hesitant to take on a leadership role, and the chapter identifies several common reasons:</p>
<ul>
<li><strong>Less time coding:</strong> Writing code produces visible results each day, while management work is harder to measure and its benefits take longer to appear. New leaders can feel unproductive even when their team is doing well.</li>
<li><strong>The Peter Principle:</strong> <em>“In a hierarchy every employee tends to rise to</em> <em>his level of incompetence.”</em> People tend to be promoted until they reach a role they cannot perform well. Google tries to avoid this by expecting people to work above their current level for a time before they are promoted.</li>
<li><strong>Bad past managers:</strong> Engineers who have mostly worked for poor managers may have little desire to become one, as they’ve never had a model for what to do that would be successful.</li>
</ul>
<p>The chapter also offers reasons to consider leading. An individual’s output is limited, but guiding a team allows a person to have a much larger impact. People who step in when a team lacks direction often discover that they are good at helping and protecting others. Google asserts that someone has to lead, and a capable engineer is often the right person to do it.</p>
<section id="servant-leadership" class="level4">
<h4 class="anchored" data-anchor-id="servant-leadership">Servant Leadership</h4>
<p>New managers sometimes repeat the habits of the bad managers they once worked for, such as micromanaging, ignoring low performers, or hiring people who will not challenge them. The author recalls a Google mentor that told him, <em>“Above all, resist the urge to manage.”</em> The urge to “manage” is often, according to the chapter, the new leader’s most harmful instinct. It offers the alternative: servant leadership, where the leader’s main job is to support the team. In practice, this means building an environment of humility, respect, and trust; clearing obstacles the team cannot remove alone; helping the group reach consensus; offering small kindnesses; and staying involved in the work when needed. A servant leader looks after both the technical and the social health of the team, and the social side, though harder to manage, is just as important.</p>
</section>
</section>
<section id="the-engineering-manager" class="level3">
<h3 class="anchored" data-anchor-id="the-engineering-manager">The Engineering Manager</h3>
<p>The common image of a rigid, controlling manager goes back to military hierarchies and to factories in the Industrial Revolution. Factory workers could be trained quickly and replaced easily, so supervisors relied on a “carrot-and-stick” approach: reward people who comply and punish those who do not. Google says that software engineering is different. Engineers working on large codebases can need months to become productive, and creative work requires time, support, and room to think. Research suggests that carrot-and-stick management actually hurts this kind of work.</p>
<p>Today’s engineering managers are more effective when they trust their teams. When people can see that their manager trusts them, they feel <em>“a positive pressure to live up to that trust.”</em> The chapter’s key distinction is that traditional managers focus on <em>how</em> work gets done, while great managers focus on <em>what</em> gets done and let the team decide how to do it.</p>
<section id="failure-is-an-option" class="level4">
<h4 class="anchored" data-anchor-id="failure-is-an-option">Failure Is an Option</h4>
<p>Leaders should also create psychological safety, an environment where team members can be themselves and take risks without fearing their manager’s or peers’ reactions. People are poor at judging risk, and organizations often settle for small, safe wins. Aiming for an ambitious goal may fail, but it usually produces far more than a conservative target. Failure is acceptable as long as the team learns from it and avoids repeating the same mistake.</p>
<p>Not all failures cost the same. Failing fast is cheap, failing slowly wastes engineering time, and failures that reach customers are the most expensive. After major failures, Google teams write postmortems that explain what happened and how to prevent it from happening again. The goal is to fix the underlying problem rather than assign blame. The chapter also recommends praising individuals in public, giving individual criticism in private, and treating failures as learning opportunities for the whole team.</p>
</section>
</section>
<section id="antipatterns" class="level3">
<h3 class="anchored" data-anchor-id="antipatterns">Antipatterns</h3>
<p>The chapter describes several leadership antipatterns: habits that undermine trust, weaken collaboration, and make a team less effective. Recognizing these habits helps leaders understand how their own decisions affect the people around them.</p>
<ul>
<li><strong>Hiring pushovers:</strong> Choosing people who will never challenge the leader limits the team’s independence. Strong teammates bring different ideas, question mistakes, and can eventually take on leadership responsibilities.</li>
<li><strong>Ignoring low performers:</strong> Avoiding difficult conversations leaves other team members carrying extra work and allows frustration to grow. Leaders should address problems early through respectful coaching, clear expectations, and small, measurable goals.</li>
<li><strong>Ignoring human issues:</strong> Technical progress depends on people whose needs and circumstances vary. A leader who dismisses personal challenges can lose the team’s trust, even when the work itself is going well.</li>
<li><strong>Trying to be everyone’s friend:</strong> A manager’s influence over people’s careers changes the relationship. Leaders can remain approachable and supportive while maintaining boundaries and making fair decisions.</li>
<li><strong>Compromising the hiring bar:</strong> Filling positions quickly can create lasting problems if candidates do not meet the requirements of the role. Maintaining hiring standards protects the team’s time and ability to succeed.</li>
<li><strong>Treating the team like children:</strong> Constant supervision and unnecessary restrictions discourage ownership. Giving capable engineers responsibility shows trust and allows them to develop their judgment.</li>
</ul>
<p>These antipatterns show why humility, respect, and trust matter in everyday leadership. A leader needs to listen, address problems directly, and give people enough support and independence to do their work well.</p>
</section>
<section id="positive-patterns" class="level3">
<h3 class="anchored" data-anchor-id="positive-patterns">Positive Patterns</h3>
<p>The chapter also describes positive patterns: practices the authors have seen in effective leaders at Google, in other leaders they have observed, and in their own mentors. These habits help leaders earn trust, keep the team moving, and give people room to grow.</p>
<ul>
<li><strong>Lose the ego:</strong> Humility does not mean a lack of confidence. Leaders can hold strong opinions while building a shared team identity, trusting the people closest to the work, welcoming criticism, and apologizing sincerely when they make mistakes.</li>
<li><strong>Be a Zen master:</strong> Teams take emotional cues from their leader, so staying calm and avoiding excessive cynicism matters. Answering questions with questions helps teammates reach their own solutions and keep ownership.</li>
<li><strong>Be a catalyst:</strong> Leaders often move work forward by building consensus rather than relying on authority. A team may choose to let its lead make quick decisions, and leaders do not need complete agreement before acting.</li>
<li><strong>Remove roadblocks:</strong> When the team is stuck on a technical or organizational problem, the leader steps in to get it moving. Knowing the right person to ask is often more valuable than knowing the answer.</li>
<li><strong>Be a teacher and a mentor:</strong> Leaders should let junior engineers learn by doing a task, even when it would be faster to do it themselves. Good mentors explain clearly and judge how much help someone needs without over-explaining.</li>
<li><strong>Set clear goals:</strong> A concise mission statement, clear priorities, and guidance on trade-offs keep everyone moving in the same direction. Once the goals are set, the leader can step back and only check in periodically.</li>
<li><strong>Be honest:</strong> Leaders should admit when they do not know something or cannot share information. Difficult feedback should be specific, private, and respectful rather than hidden inside a “compliment sandwich,” where the criticism is easy to miss.</li>
<li><strong>Track happiness:</strong> Leaders should watch for burnout, recognize good work, and share thankless tasks fairly. Asking what people need and making their career goals explicit helps leaders offer useful support.</li>
</ul>
<p>These patterns share a common thread: a leader’s main job is to support the people doing the work. By staying humble, honest, and focused on clear goals, leaders create a team where people can do their best work and grow over time.</p>
</section>
<section id="the-unexpected-question" class="level3">
<h3 class="anchored" data-anchor-id="the-unexpected-question">The Unexpected Question</h3>
<p>The author, Fitzpatrick, describes preparing for difficult questions before his first meeting with then-CEO Eric Schmidt. Instead, Schmidt ended the meeting by asking whether Fitzpatrick needed anything. The question caught him off guard because he had prepared to defend his work rather than ask for support.</p>
<p>This example shows how a simple question can put servant leadership into practice. Asking team members what they need creates an opportunity to discuss obstacles, missing resources, or concerns that might otherwise stay hidden. Asking regularly during one-on-one meetings gives people time to recognize their needs and become more comfortable sharing them.</p>
<p>These conversations can also help leaders understand job satisfaction and career goals. Someone may want to learn a skill, take on more responsibility, or receive recognition for work that has gone unnoticed. Leaders should also recognize that circumstances outside work can affect a person’s capacity, while respecting their privacy. Listening and following through on these conversations helps turn concern for the team into useful support.</p>
</section>
<section id="other-tips-tricks" class="level3">
<h3 class="anchored" data-anchor-id="other-tips-tricks">Other Tips &amp; Tricks</h3>
<p>The chapter offers several practical habits for supporting a team. Delegation is especially important because it gives others opportunities to learn and prevents the leader from becoming a bottleneck. Leaders should also stay involved enough to understand the work. Taking on an unpleasant task can show commitment and help a leader learn what the team is dealing with.</p>
<p>Developing future leaders is another responsibility. Giving interested team members opportunities to coordinate work or make decisions prepares them to take on more responsibility. This should account for individual interests: engineers who prefer to remain individual contributors also need meaningful opportunities to grow.</p>
<p>Leaders must also address difficult situations before they damage the team. Delaying a conversation about performance or disruptive behavior usually makes the problem harder to resolve. At the same time, leaders should protect the team’s focus by handling unnecessary outside demands and sharing relevant organizational information without passing along every uncertainty.</p>
<p>Finally, effective leaders recognize good work and make room for experiments. Specific praise helps people understand the value of their contributions. When a proposed experiment is easy to reverse and fits the team’s priorities, giving it a chance can encourage learning. Decisions that create lasting commitments deserve more careful consideration.</p>
</section>
<section id="people-are-like-plants" class="level3">
<h3 class="anchored" data-anchor-id="people-are-like-plants">People Are Like Plants</h3>
<p>The author’s mother-in-law, who raised six very children, compared kids to plants when he asked her how she “managed” it. Some need little water and lots of sun, others need shade and damp soil, and some do best with fertilizer. Treating them all the same means none of them gets what they need. Team members work the same way, and a leader’s job is to learn what each person needs. On a team, the two main inputs are motivation and direction. Someone stuck in a rut needs motivation, someone distracted or unsure of what to do needs direction, and someone who feels adrift may need both. Giving either one to a person who does not need it can be frustrating for them.</p>
<p>Direction is fairly simple to provide: understand what needs to be done, organize the work, and break it into manageable tasks. Motivation is more complicated.</p>
<section id="intrinsic-versus-extrinsic-motivation" class="level4">
<h4 class="anchored" data-anchor-id="intrinsic-versus-extrinsic-motivation">Intrinsic Versus Extrinsic Motivation</h4>
<p>Extrinsic motivation comes from outside a person, such as a paycheck, while intrinsic motivation comes from within. Drawing on Dan Pink’s book <em>Drive</em>, Google argues that the best way to motivate people is to strengthen their intrinsic motivation. Pink identifies three sources of it:</p>
<ul>
<li><strong>Autonomy:</strong> People work better when they are not micromanaged. A leader can set the general direction and let the team decide how to get there, which gives people a real stake in the product and a sense of ownership.</li>
<li><strong>Mastery:</strong> People need chances to improve their skills and learn new ones. Like a knife that dulls without sharpening, skills fade without practice, and a team grows stronger when its members keep learning.</li>
<li><strong>Purpose:</strong> Work is more motivating when people understand why it matters. Even a product with modest impact can inspire a team when leaders connect the work to the people it helps. One manager shared customer emails praising the product with the engineers, which raised morale and led to new ideas.</li>
</ul>
<p>Money still matters, but the chapter treats it as a baseline: people should be paid well enough that income is not a source of stress. Beyond that point, autonomy, mastery, and purpose do far more to keep a team engaged.</p>
</section>
</section>
<section id="reflection" class="level3">
<h3 class="anchored" data-anchor-id="reflection">Reflection</h3>
<p>As future software engineers, we can apply these ideas before holding a formal leadership title. In a class project, leadership might mean clarifying the next milestone, helping a teammate work through a blocker, or making space for someone whose ideas have not been heard. These actions help the group move forward while building trust.</p>
<p>One lesson we can take from this chapter is to reconsider how we measure our contributions. Completing a difficult feature matters, but helping another person understand the code or take ownership of a task can strengthen the whole team. Doing everything ourselves may produce a quick result while leaving teammates without opportunities to learn.</p>
<p>In our next group project, we can put these lessons into practice by asking what support each person needs, agreeing on clear responsibilities, and addressing concerns early. We can also recognize each other’s contributions and share opportunities to lead. The chapter encourages us to see leadership as an ongoing responsibility to help people grow and work effectively together.</p>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our team built <code>team-garden</code>, a Discord bot for end-of-day team check-ins. Each teammate tends a flower by sharing their mood, their energy, and the answer to “What do you need?”, and the team’s garden shows its overall health. You can view the project here: <a href="https://github.com/dheadley06/team-garden">team-garden on GitHub</a>. You can also try the bot in our <a href="https://discord.gg/uvMpejKr">test Discord server</a>.</p>
</div>
</div>
</div>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>
</section>

 ]]></description>
  <category>post</category>
  <category>professional development</category>
  <category>software engineering</category>
  <guid>https://www.developerdevelopment.com/blog/se6-fall2026/</guid>
  <pubDate>Sat, 17 Oct 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Mutation Analysis</title>
  <dc:creator>Alexander Goddard</dc:creator>
  <dc:creator>Eyra Co</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/fb5-fall2026/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This blog focuses on the <a href="https://www.fuzzingbook.org/html/MutationAnalysis.html">“Mutation Analysis”</a> chapter of <a href="https://www.fuzzingbook.org/">The Fuzzing Book</a>. Mutation testing is a technique used to evaluate how well a test suite identifies errors in a program. It involves making small, intentional changes to the code to see whether existing tests can detect them. This approach helps developers understand whether their tests are effective and where improvements may be needed.</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>Mutation is a type of testing where it uses bases of the original code and from that it creates potential bugs called “mutants”. Developers then run their program hoping that it detects the changes made. However, if all tests pass it means that their test suite has a weakness.</p>
<section id="limits-to-fuzzing" class="level3">
<h3 class="anchored" data-anchor-id="limits-to-fuzzing">Limits to Fuzzing</h3>
<p>Mutation testing is different from regular code coverage because code coverage only shows which parts of a program are tested. It does not tell us if the program gives the correct results. For example, we could have 100% code coverage and still have bugs that our tests do not catch. This happens because tests may check whether the program runs without errors instead of checking whether the results are correct. Code coverage is still useful, but it does not tell us everything we need to know. Mutation testing helps us find weaknesses in our tests by making small changes to the code and checking if our tests catch them. This helps developers find hidden bugs and feel more confident in their code.</p>
</section>
<section id="injecting-artificial-faults" class="level3">
<h3 class="anchored" data-anchor-id="injecting-artificial-faults">Injecting Artificial Faults</h3>
<p>Mutation analysis is a way to check how well our tests find bugs in a program. It works by making small changes to the code and checking if the tests catch them. For example, we could change a <code>+</code> to a <code>-</code>. If the tests do not catch the change, it means they may need to be improved. The mutation score tells us how many changes the tests were able to catch.</p>
<p>Mutation testing helps us understand if our tests can find real bugs. It can be used with regular tests and other testing tools. It is similar to fuzzing because both help find problems in software, but mutation testing focuses on checking how good our tests are.</p>
<p>Adding errors to code by hand can take a lot of time, and developers might miss some important problems. Mutation analysis makes this easier by creating small changes to the code automatically. Each changed version is called a mutant. If the tests catch the change, the mutant is called killed. If the tests do not catch it, the mutant survives. This helps developers see where their tests need improvement.</p>
<p>Here is <code>MuProgramAnalyzer</code> that runs tests for an entire program used in the FB:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> TestGCD(unittest.TestCase):</span>
<span id="cb1-2"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span>     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> test_simple(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb1-3"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span>         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> cfg.gcd(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb1-4"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span></span>
<span id="cb1-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span>     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> test_mirror(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb1-6"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span>         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> cfg.gcd(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb1-7"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> mutant <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MuProgramAnalyzer(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gcd'</span>, gcd_src):</span>
<span id="cb1-8"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span>     mutant[test_module].runTest(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'TestGCD'</span>)</span>
<span id="cb1-9"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> mutant.pm.score()</span>
<span id="cb1-10"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">======================================================================</span></span>
<span id="cb1-11">FAIL: test_simple (__main__.TestGCD)</span>
<span id="cb1-12"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">----------------------------------------------------------------------</span></span></code></pre></div></div>
</section>
<section id="creating-the-tests" class="level3">
<h3 class="anchored" data-anchor-id="creating-the-tests">1. Creating the Tests</h3>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> TestGCD(unittest.TestCase):</span>
<span id="cb2-2">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> test_simple(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb2-3">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> cfg.gcd(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb2-4"></span>
<span id="cb2-5">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> test_mirror(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb2-6">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> cfg.gcd(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div></div>
<ul>
<li><code>class TestGCD(unittest.TestCase):</code> creates a group of tests for the GCD function.</li>
<li><code>def test_simple(self):</code> creates the first test.</li>
<li><code>assert cfg.gcd(1, 0) == 1</code> runs the GCD function with <code>1</code> and <code>0</code> and checks that the answer is <code>1</code>.</li>
<li><code>def test_mirror(self):</code> creates a second test.</li>
<li><code>assert cfg.gcd(0, 1) == 1</code> checks that the GCD function returns <code>1</code> when the numbers are reversed.</li>
</ul>
<p>These tests check whether the function gives the correct answers.</p>
</section>
<section id="running-mutation-analysis" class="level3">
<h3 class="anchored" data-anchor-id="running-mutation-analysis">2. Running Mutation Analysis</h3>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> mutant <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MuProgramAnalyzer(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gcd'</span>, gcd_src):</span>
<span id="cb3-2">    mutant[test_module].runTest(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'TestGCD'</span>)</span></code></pre></div></div>
<ul>
<li><code>MuProgramAnalyzer('gcd', gcd_src)</code> takes the name of the program (<code>gcd</code>) and its source code (<code>gcd_src</code>) and creates changed versions of the program.</li>
<li><code>for mutant in ...</code> goes through each changed version, called a <em>mutant</em>.</li>
<li><code>mutant[test_module]</code> accesses the test module for that mutant.</li>
<li><code>.runTest('TestGCD')</code> runs the tests in <code>TestGCD</code> against the changed program.</li>
</ul>
<p>This lets us check whether the tests can catch mistakes caused by changes to the code.</p>
</section>
<section id="calculating-the-score" class="level3">
<h3 class="anchored" data-anchor-id="calculating-the-score">3. Calculating the Score</h3>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1">mutant.pm.score()</span></code></pre></div></div>
<p>This calculates the mutation score, which tells us how many mutants were caught by the tests compared with the total number counted in the score.</p>
</section>
<section id="understanding-the-error-message" class="level3">
<h3 class="anchored" data-anchor-id="understanding-the-error-message">4. Understanding the Error Message</h3>
<pre class="text"><code>FAIL: test_simple
AssertionError

Ran 1 test
FAILED (failures=1)</code></pre>
<ul>
<li><code>FAIL: test_simple</code> means the first test failed.</li>
<li><code>AssertionError</code> means the result was not equal to the expected answer, <code>1</code>.</li>
<li><code>Ran 1 test</code> means one test ran during this execution.</li>
<li><code>FAILED (failures=1)</code> means that test did not pass.</li>
</ul>
<p>The test failed because the modified program did not give the expected result. This shows how mutation analysis checks whether tests can detect problems in changed code.</p>
</section>
</section>
<section id="reflection" class="level2">
<h2 class="anchored" data-anchor-id="reflection">Reflection</h2>
<p>To start using mutation testing, developers can add it to their normal testing process. First, they should write tests for their code and make sure the tests pass. Then, they can use a mutation testing tool to make small changes to the code and run the tests again. If the tests fail, it means they caught the change. If the tests still pass, developers can look at their tests and see if they need to improve them. Mutation testing can help find weaknesses in tests, but it should be used alongside other testing methods because it cannot find every possible problem. By using it regularly, developers can build stronger tests and make their software more reliable.</p>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>We built a tool called <code>Mutalysis</code>, which performs mutation analysis on a python program. You can view the project here: <a href="https://github.com/XanderGoddard7/Mutalyasis">Mutalysis on GitHub</a></p>
</div>
</div>
</div>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Reference">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-2-contents" aria-controls="callout-2" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Reference
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-2" class="callout-2-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Unless otherwise noted, the source code segments in this article are excerpted directly from the <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. The authors of this online book licensed the source code and its written content under the <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0 Creative Commons License</a>. More details about the license for the Fuzzing Book are available in the <a href="https://github.com/uds-se/fuzzingbook/blob/master/LICENSE.md">The Fuzzing Book License</a>.</p>
</div>
</div>
</div>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>software engineering</category>
  <category>fuzzing book</category>
  <guid>https://www.developerdevelopment.com/blog/fb5-fall2026/</guid>
  <pubDate>Wed, 14 Oct 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Engineering for Equity</title>
  <dc:creator>Kathryn Boidock</dc:creator>
  <dc:creator>Kaitlyn Walker</dc:creator>
  <dc:creator>Ritesh Ojha</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/se5-fall2026/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>In this chapter, engineering for equity, we will explore the responsibilities of designing products for a broad base of users. Our chapter explores how embracing diversity can design systems that work for everyone and avoid creating a harmful environment for users. Engineering for equity exists because understanding the impact that software engineering has on underrepresented people and diverse societies is something being researched and understood today. Google is currently learning how to engineer products that empower and respect all of their users. To make more equitable products, we have to evaluate our own failures and encourage growth toward a more equitable future.</p>
<section id="bias-is-the-default" class="level3">
<h3 class="anchored" data-anchor-id="bias-is-the-default">Bias Is the Default</h3>
<p>Everyone has biases that are often exhibited as unconscious bias, which enforces existing stereotypes on people unintentionally. Unconscious bias is more difficult of an act to mitigate than intentional acts of exclusion because we might not even recognize our own bias when trying to do the right thing. Google has failed to represent all users equitably in all of its products due to these biases. Due to this failure, in 2015 there was a case study conducted on Google missing the mark on racial inclusion.</p>
<p>Jacky Alciné recognized that Google’s recognition algorithms in Google Photos were recognizing and classifying his black friends as “gorillas.” Google did not respond to these mistakes immediately and did not completely address them either. There were several things that caused this huge failure for Google.</p>
<ol type="1">
<li>Image recognition algorithms depend on being supplied with a “proper” or complete data set.
<ul>
<li>The photo data that was fed to Google’s image recognition algorithm was incomplete, this resulted in the data not representing the entire populace.</li>
</ul></li>
<li>Google did not have much black representation, which affected decisions.
<ul>
<li>The unconscious bias of Google led to a subjective design in their algorithms and collection of datasets. This left a more representative product on the table.</li>
</ul></li>
<li>Google’s target market for image recognition did not include underrepresented groups.
<ul>
<li>Google’s tests did not catch the mistakes that the users did, which in turn embarrassed Google and harmed their users.</li>
</ul></li>
</ol>
<p>As late as 2018, Google had still not completely addressed the underlying problem in its image recognition.</p>
<p>Other technology from Google faced similar failures just as the image recognition did. Autocomplete can return offensive or racist results, Google’s ad system can be manipulated to show racist and offensive ads. YouTube can let hate speech slip through the cracks even though it is outlawed on the platform. In these cases, the technology itself is not to blame they were not designed to target users or discriminate, but the unconscious bias of Google’s programmers resulted in a product that was not resilient enough to exclude these things and returned results that harmed users. This led to decreased user trust and engagement with the company from user bases that were harmed by these exclusions.</p>
</section>
<section id="understanding-the-need-for-diversity" class="level3">
<h3 class="anchored" data-anchor-id="understanding-the-need-for-diversity">Understanding the Need for Diversity</h3>
<p>To understand the need for diversity, we have to first disrupt the computer science degree myth. This myth is that because a person has a computer science degree or work experience, they have all the skills they need to be an exceptional engineer. The degree is a necessary foundation, but the degree alone does not make someone an engineer. We also have to disrupt the idea that only people with degrees can design and build products. Most programmers do have a degree and are successful at building code, establishing theories of change, and applying methods for problem solving. This approach is not inclusive and equitable engineering. Engineers need to understand the population demographics of all users and focus on people who are different from themselves. Engineering teams need to build in representation of their existing and future users. If there is not diverse representation in a team of engineers they need to learn how to build for all users.</p>
</section>
<section id="building-multicultural-capacity" class="level3">
<h3 class="anchored" data-anchor-id="building-multicultural-capacity">Building Multicultural Capacity</h3>
<p>Exceptional engineers need more than technical skill. They also need the perception to understand how a product can advantage one group while disadvantaging another, and when a feature should be delayed or rejected because its possible harms have not been addressed. This requires building multicultural capacity: learning about the different communities affected by a product, seeking perspectives beyond our own experiences, and continuing to develop our understanding of race, gender, ability, age, culture, and socioeconomic status.</p>
<p>This responsibility cannot fall on one person alone. Engineering teams should include perspectives that reflect their current and future users, while organizations should provide ongoing, multidisciplinary professional development. When a team lacks representation, engineers can still improve their work by researching the people most likely to be excluded, involving community members and subject-matter experts, and testing the most difficult use cases first. Designing with the users who face the greatest barriers often creates a better experience for everyone.</p>
</section>
<section id="making-diversity-actionable" class="level3">
<h3 class="anchored" data-anchor-id="making-diversity-actionable">Making Diversity Actionable</h3>
<p>Making diversity actionable means turning good intentions into measurable responsibility. Leaders should examine whether candidate pools, hiring decisions, opportunities for advancement, and retention outcomes are equitable instead of assuming that a policy is effective because it has inclusive goals. Teams should also measure product outcomes across different user groups and investigate disparities when they appear. These steps make equity part of the engineering process rather than an issue considered only after harm occurs.</p>
<p>Progress also depends on accountability. Managers can review whether candidate slates are representative, distribute growth opportunities fairly, and create psychological safety for people from underrepresented groups. Engineers can question processes that rely on incomplete data or narrow definitions of a successful user. Together, these actions help organizations move from building for everyone in theory to building with everyone in practice.</p>
</section>
<section id="rejecting-singular-approaches" class="level3">
<h3 class="anchored" data-anchor-id="rejecting-singular-approaches">Rejecting Singular Approaches</h3>
<p>One of the main statements that you as a software engineer should hold close is: “If we want to drive change and increase representation, we need to evaluate whether we’re creating an ecosystem in which all aspiring engineers and other technology professionals can thrive.” We need to stay aware of the fact that the software engineering field is not a monolith, and that there are many different ways to approach problems.</p>
<p>We need to be open to new ideas and perspectives, and we need to be willing to challenge our own assumptions. One common methodology is to build for the majority use case first, leaving improvements and features that address edge cases for later. This approach gives users who are not part of the majority use case a subpar experience, and it can be frustrating for them to have to wait for improvements that address their needs. We need to be willing to challenge this approach and to build for all users from the start.</p>
</section>
<section id="challenging-established-processes" class="level3">
<h3 class="anchored" data-anchor-id="challenging-established-processes">Challenging Established Processes</h3>
<p>A case at Google was evaluated for equity implications. Multiple engineering teams got together to try to build a new feature, a global hiring requisition system. Their main line of communication was the feedback from what would be the main users of this new feature, recruiters. The recruiters main focus was to minimize wasted time when it comes to hiring. One of the main features they wanted added was the ability to highlight performance ratings as soon as interest was expressed in a job by an internal transfer. This raised some questions by another engineer:</p>
<ul>
<li>Are developmental assessments a predictive measure of performance?</li>
<li>Are the performance assessments being presented to prospective managers free of individual bias?</li>
<li>Are performance assessment scores standardized across organizations?</li>
</ul>
<p>If you answered “no” to any of these questions, then this new feature could drive inequitable, and therefore potentially harmful, results.</p>
<p>After seeing the potential for inequitable results, a study was conducted in which those with a lower performance rating were discovered to have a higher likelihood of overcoming the poor rating if they found a new team. These results showed that while ratings are important, they are only indicative of a person’s performance at that moment in time, and that they are not a predictive measure of future performance.</p>
</section>
<section id="values-versus-outcomes" class="level3">
<h3 class="anchored" data-anchor-id="values-versus-outcomes">Values versus Outcomes</h3>
<p>Despite a strong commitment, heavy investments, and inclusive core values, Google continuously misses its goal of building a hiring workforce that represents its global user base. The issue does not arise within company values or intentions, but rather in how policies are applied and practiced at the implementation level. Feedback is easy to gather when you rely on those familiar, but do not consider those that you may not have reached yet.</p>
<p>How can we ensure that our values are reflected in our outcomes?</p>
<ol type="1">
<li>Take a hard look in the mirror.
<ul>
<li>True inclusivity requires fixing implementation failures and breaking old habits, rather than relying solely on good intentions or company values.</li>
</ul></li>
<li>Don’t build for everyone. Build with everyone.
<ul>
<li>To build universally accessible technology, products must be designed with diverse communities, highlighting the most vulnerable populations, rather than assuming their needs.</li>
</ul></li>
<li>Design for the user who will have the most difficulty using your product.
<ul>
<li>Don’t trade equity for short-term velocity.</li>
<li>Prioritizing and solving for the users who face the greatest barriers automatically improves the overall product experience for everyone.</li>
</ul></li>
<li>Don’t assume equity; measure equity throughout your systems.
<ul>
<li>Keep in mind that even those who make decisions can also be under-educated and subject others to bias. Companies must be sure to continuously measure equity across all systems and collaborate with teams and individuals who are subject matter experts to expose and mitigate implicit biases.</li>
</ul></li>
<li>Change is possible.
<ul>
<li>Overcoming modern, overwhelming digital challenges requires a fundamental willingness to abandon outdated, failing approaches in favor of continuous self-change.</li>
</ul></li>
</ol>
</section>
<section id="pushing-forward" class="level3">
<h3 class="anchored" data-anchor-id="pushing-forward">Pushing Forward</h3>
<p>The path to equity will never be easy. Although we not only can but we should transition from simply creating tools to growing our understanding of how what we are producing will impact others. We should challenge our education, influence our own teams and managers, and do comprehensive user research. As future engineers ourselves we should focus first on the users who are most impacted by bias and discrimination. It is possible together to accelerate progress to a more inclusive engineering environment by owning up to our own failures and make changes that push everyone forward without creating products and environments that ignore underrepresented groups. This is not something that can be done alone we all have to work together to produce these effects and create products for not only ourselves and our peers but for those who constantly face discrimination in the products that they use today.</p>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our team built <code>Equity-Planner</code>, a simple CLI for creating inclusive software testing checklists. You can view the project here: <a href="https://github.com/ojharitesh/Equity-Planner">Equity-Planner on GitHub</a>.</p>
</div>
</div>
</div>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>
</section>

 ]]></description>
  <category>post</category>
  <category>professional development</category>
  <category>software engineering</category>
  <guid>https://www.developerdevelopment.com/blog/se5-fall2026/</guid>
  <pubDate>Mon, 12 Oct 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Mutation-Based Fuzzing</title>
  <dc:creator>Abishek Dhakal</dc:creator>
  <dc:creator>Logan Butler</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/fb4-fall2026/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This article summarizes the <a href="https://www.fuzzingbook.org/html/MutationFuzzer.html">Mutation-Based Fuzzing</a> chapter, focusing on seed mutation, coverage-guided selection, and the Fizzbuzz demonstration.</p>
<section id="the-limitation-of-random-generation" class="level3">
<h3 class="anchored" data-anchor-id="the-limitation-of-random-generation">The Limitation of Random Generation</h3>
<p>Random generation often fails on structured inputs because it produces strings that are syntactically invalid far more often than valid ones. For a URL, even a simple value like <code>http://</code> has a very specific prefix, and the probability of generating it at random is extremely small. The chapter illustrates this with a URL parser example: the chance of producing a valid <code>http://</code> prefix using printable ASCII characters is roughly <img src="https://latex.codecogs.com/png.latex?1%20/%2096%5E7">, and the odds are even lower for <code>https://</code>. In practice, this means a purely random fuzzer may spend enormous amounts of time generating strings that are rejected almost immediately, without ever reaching the interesting logic of the program.</p>
</section>
<section id="what-is-mutational-fuzzing" class="level3">
<h3 class="anchored" data-anchor-id="what-is-mutational-fuzzing">What Is Mutational Fuzzing?</h3>
<p>Mutation-based fuzzing avoids the problem of generating valid inputs from scratch by starting from an existing valid seed and applying small changes to it. A mutation might delete a character, insert a random character, or flip a bit in a character. Because the input remains close to the original, it is far more likely to remain parseable and useful. This approach is especially effective for inputs with fixed structure, such as URLs, file paths, or network protocol messages.</p>
<p>The idea is simple but powerful: if a program accepts a valid input, then a slightly modified version of that input may still be valid while exercising a different path or edge case. This makes mutational fuzzing a practical compromise between pure random generation and a full grammar-based generator.</p>
</section>
<section id="fuzzing-a-url-parser" class="level3">
<h3 class="anchored" data-anchor-id="fuzzing-a-url-parser">Fuzzing a URL Parser</h3>
<p>The chapter uses a URL parser as a motivating example. A URL is typically structured as:</p>
<p><code>scheme://netloc/path?query#fragment</code></p>
<p>where the scheme is something like <code>http</code> or <code>https</code>, the net location is the host such as <code>www.google.com</code>, and the path and query further specify the resource. In Python, <code>urllib.parse.urlparse()</code> decomposes this structure into named parts, making it easy to validate whether a URL is well-formed.</p>
<p>The chapter then defines a tiny <code>http_program()</code> that accepts only <code>http</code> and <code>https</code> URLs with a non-empty host. As expected, random fuzzing almost never produces a valid URL, so the parser is rarely exercised beyond input validation. This illustrates the key limitation of generational fuzzing for structured data and motivates mutation-based strategies that begin from a valid URL instead of a random string.</p>
</section>
<section id="primary-mutation-operators" class="level3">
<h3 class="anchored" data-anchor-id="primary-mutation-operators">Primary Mutation Operators</h3>
<p>The core mutation operators are intentionally small and easy to implement. The chapter introduces three standard ones:</p>
<ul>
<li><strong>Delete</strong>: remove a random character from the input.</li>
<li><strong>Insert</strong>: add a random printable character at a random position.</li>
<li><strong>Bit flip</strong>: randomly choose a byte and flip one of its bits, which can turn one character into another and produce surprisingly realistic variants.</li>
</ul>
<p>These operators are usually combined in a single mutator that chooses one of them at random and applies it to the current string. Even a small mutation can produce new and interesting test cases while preserving much of the original structure.</p>
</section>
<section id="mutating-urls-in-practice" class="level3">
<h3 class="anchored" data-anchor-id="mutating-urls-in-practice">Mutating URLs in Practice</h3>
<p>The chapter then applies these mutations to a valid URL such as:</p>
<p><code>http://www.google.com/search?q=fuzzing</code></p>
<p>When the mutation process is applied to this seed, a surprisingly high percentage of the resulting strings remain valid. Mutating valid inputs preserves syntactic validity much more often than generating random strings from scratch. This allows the fuzzer to stay near the grammar of the original input while still exploring nearby variants, such as slightly different hosts, schemes, paths, or query strings.</p>
<p>The authors also show that a valid seed can help discover new variations such as <code>https://</code>, which would be dramatically harder to reach through pure randomness. In other words, mutation allows the fuzzer to take a known-good input and slowly explore the neighborhood around it.</p>
</section>
<section id="stacking-multiple-mutations" class="level3">
<h3 class="anchored" data-anchor-id="stacking-multiple-mutations">Stacking Multiple Mutations</h3>
<p>A single mutation is often enough to produce a small variation, but real progress usually comes from chaining many mutations together. The chapter applies dozens of mutations to the same seed and shows how the resulting strings quickly diverge from the original while still retaining some useful structure. This increases diversity in the generated inputs and enables the fuzzer to reach different code paths without needing a precise grammar.</p>
<p>To support this, the book introduces <code>MutationFuzzer</code>, which keeps a seed corpus, chooses a population member, applies a random number of mutation steps, and emits a candidate input. This creates a simple but effective generative loop: valid seeds are mutated repeatedly to explore new behavior in a controlled fashion.</p>
</section>
<section id="guiding-mutations-with-coverage" class="level3">
<h3 class="anchored" data-anchor-id="guiding-mutations-with-coverage">Guiding Mutations with Coverage</h3>
<p>When mutating inputs blindly, many mutations quickly make an input syntactically invalid, causing the target program to reject it immediately. As a result, blind mutational fuzzing eventually gets stuck. To solve this, coverage-guided fuzzing (pioneered by tools like American Fuzzy Lop / AFL) uses feedback from code execution to guide the mutation process:</p>
<ul>
<li><p><strong>Population/Seed Corpus</strong>: The fuzzer maintains a pool (population) of interesting inputs, initialized with one or more valid sample inputs (seeds).</p></li>
<li><p><strong>Execution and Instrumentation</strong>: The fuzzer executes the target program with a mutated candidate input and measures which code locations (statements or branches) were executed (using coverage tracking/instrumentation).</p></li>
<li><p><strong>Feedback Loop</strong>: If a mutated candidate covers new code (i.e., reaches new statements or branches not seen before in the cumulative coverage set), the candidate is considered valuable. This candidate is then added to the population of inputs.</p></li>
<li><p><strong>Evolutionary Search</strong>: By continually picking inputs from the updated population and mutating them further, the fuzzer gradually “learns” how to bypass complex parsing checks, reach deeper execution paths, and maximize overall code coverage without needing a formal input grammar.</p></li>
</ul>
</section>
<section id="the-mutationfuzzer-architecture" class="level3">
<h3 class="anchored" data-anchor-id="the-mutationfuzzer-architecture">The MutationFuzzer Architecture</h3>
<p>The chapter structures the mutational fuzzing framework using an object-oriented design in Python that builds upon a base Fuzzer hierarchy:</p>
<ul>
<li><p><strong>Mutation Operators</strong>: Basic helpers (delete, insert, bit-flip) that perform random character or bit modifications on input strings.</p></li>
<li><p><code>MutationFuzzer</code>: Takes initial valid seeds, randomly picks one, applies <img src="https://latex.codecogs.com/png.latex?N"> mutations, and returns a new candidate input.</p></li>
<li><p><code>MutationCoverageFuzzer</code>: Extends the basic fuzzer with an evolutionary loop—it tracks executed code lines and adds any mutated input that reaches new coverage back into the active seed pool.</p></li>
</ul>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.developerdevelopment.com/blog/fb4-fall2026/Fuzzer.png" class="img-fluid figure-img"></p>
<figcaption>Mutation Fuzzer</figcaption>
</figure>
</div>
</section>
<section id="key-lessons" class="level3">
<h3 class="anchored" data-anchor-id="key-lessons">Key Lessons</h3>
<p>A few important takeaways from the mutation-based fuzzing chapter:</p>
<ul>
<li>Mutation-based fuzzing generates new inputs by applying small changes to existing, valid seed inputs.</li>
<li>Valid seeds allow fuzzers to bypass basic parsing logic and reach deep, complex code paths without needing a full input grammar.</li>
<li>Coverage tracking acts as an evolutionary guide, helping the fuzzer identify which mutations explore new territory.</li>
<li>Adding high-coverage inputs back into the seed pool creates a feedback loop that continuously improves test generation.</li>
<li>Hybrid techniques like mutation-based fuzzing offer a practical balance between low-effort setup and high code reach.</li>
</ul>
</section>
<section id="quiz-check" class="level3">
<h3 class="anchored" data-anchor-id="quiz-check">Quiz Check</h3>
</section>
<section id="q1.-what-is-the-primary-advantage-of-mutation-based-fuzzing-over-purely-random-fuzzing" class="level3">
<h3 class="anchored" data-anchor-id="q1.-what-is-the-primary-advantage-of-mutation-based-fuzzing-over-purely-random-fuzzing">Q1. What is the primary advantage of mutation-based fuzzing over purely random fuzzing?</h3>
<ul class="task-list">
<li><p><label><input type="checkbox">It guarantees 100% code coverage on the first execution run.</label></p></li>
<li><p><label><input type="checkbox">It leverages valid seed inputs to stay close to syntactically correct structure and reach deeper code paths.</label></p></li>
<li><p><label><input type="checkbox">It eliminates the need to execute or instrument the target program.</label></p></li>
<li><p><label><input type="checkbox">It automatically fixes any buffer overflow bugs it finds in the source code.</label></p></li>
</ul>
<details>
<summary>
Click to Expand for the Answer
</summary>
<p><strong>Answer!</strong> It leverages valid seed inputs to stay close to syntactically correct structure and reach deeper code paths.</p>
</details>
</section>
<section id="q2.-how-does-coverage-guided-fuzzing-use-the-seed-population" class="level3">
<h3 class="anchored" data-anchor-id="q2.-how-does-coverage-guided-fuzzing-use-the-seed-population">Q2. How does coverage-guided fuzzing use the seed population?</h3>
<ul class="task-list">
<li><p><label><input type="checkbox">It replaces the entire seed population with randomly generated strings every 10 seconds.</label></p></li>
<li><p><label><input type="checkbox">It deletes seed inputs whenever they fail to trigger an immediate crash or error.</label></p></li>
<li><p><label><input type="checkbox">It dynamically adds mutated inputs to the seed population whenever they discover new code execution paths.</label></p></li>
<li><p><label><input type="checkbox">It keeps the initial seed population fixed and never modifies or expands it during execution.</label></p></li>
</ul>
<details>
<summary>
Click to Expand for the Answer
</summary>
<p><strong>Answer!</strong> It dynamically adds mutated inputs to the seed population whenever they discover new code execution paths.</p>
</details>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Mutation-based fuzzing">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Mutation-based fuzzing
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Mutation-based fuzzing is not a magic bullet—it can still get stuck on strict multi-byte checks or complex validations without assistance like dictionaries or symbolic execution. However, when combined with coverage feedback, mutation fuzzing provides an efficient, automated method for surfacing hidden edge cases and vulnerabilities in software.</p>
</div>
</div>
</div>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-2-contents" aria-controls="callout-2" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-2" class="callout-2-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our team built <code>Fizzbuzz</code>, a command-line program that shows code coverage in action. You can view the project here: <a href="https://github.com/Abishek-D-7/Fizzbuzz">Fizzbuzz on GitHub</a>.</p>
</div>
</div>
</div>
<!-- Include the license statement for the online book -->
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Reference">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-3-contents" aria-controls="callout-3" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Reference
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-3" class="callout-3-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Unless otherwise noted, the source code segments in this article are excerpted directly from the <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. The authors of this online book licensed the source code and its written content under the <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0 Creative Commons License</a>. More details about the license for the Fuzzing Book are available in the <a href="https://github.com/uds-se/fuzzingbook/blob/master/LICENSE.md">The Fuzzing Book License</a>.</p>
</div>
</div>
</div>
<!-- Include reference back to the listing of blog posts -->
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>
</section>

 ]]></description>
  <category>post</category>
  <category>software engineering</category>
  <category>fuzzing book</category>
  <guid>https://www.developerdevelopment.com/blog/fb4-fall2026/</guid>
  <pubDate>Wed, 23 Sep 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Knowledge Sharing in Software Engineering</title>
  <dc:creator>Rivan Deets</dc:creator>
  <dc:creator>Benito Aguero</dc:creator>
  <link>https://www.developerdevelopment.com/blog/se4-fall2026/</link>
  <description><![CDATA[ 




<section id="knowledge-sharing-in-software-engineering-lessons-from-google" class="level2">
<h2 class="anchored" data-anchor-id="knowledge-sharing-in-software-engineering-lessons-from-google">Knowledge Sharing in Software Engineering: Lessons from Google</h2>
<p>Knowledge sharing is one of the most persistent challenges in large engineering organizations. The chapter Knowledge Sharing from Software Engineering at Google argues that an organization’s ability to learn collectively is just as important as its ability to write code. As the authors put it, “your organization should be able to answer most of its own questions.” This article examines the chapter’s core ideas, focusing on the cultural, structural, and technical mechanisms Google uses to scale knowledge across tens of thousands of engineers.</p>
</section>
<section id="the-human-foundations-of-knowledge-sharing" class="level1">
<h1>The Human Foundations of Knowledge Sharing</h1>
<section id="psychological-safety-as-a-prerequisite" class="level2">
<h2 class="anchored" data-anchor-id="psychological-safety-as-a-prerequisite">Psychological Safety as a Prerequisite</h2>
<p>The chapter emphasizes that learning begins with vulnerability. Engineers must feel safe admitting what they don’t know. The authors note that “an enormous part of learning is being able to try things and feeling safe to fail.” Without psychological safety, engineers hide confusion, avoid asking questions, and allow mistakes to compound.</p>
<p>Google’s research on effective teams consistently shows psychological safety as the strongest predictor of success. This is not accidental: learning requires risk, and risk requires trust.</p>
</section>
<section id="mentorship-and-onboarding" class="level2">
<h2 class="anchored" data-anchor-id="mentorship-and-onboarding">Mentorship and Onboarding</h2>
<p>Google formalizes psychological safety through its Noogler mentorship program. New engineers are paired with mentors outside their immediate team, giving them a safe, judgment‑free space to ask questions. This structure prevents the “fear of bothering teammates” and reduces the likelihood of new hires becoming isolated or overwhelmed.</p>
<p>Mentorship also combats single points of failure (SPOFs) — situations where only one person knows how something works. SPOFs often arise from good intentions (“It’s faster if I do it”), but they create fragile systems and slow organizational learning.</p>
</section>
<section id="common-failure-modes-in-knowledge-sharing" class="level2">
<h2 class="anchored" data-anchor-id="common-failure-modes-in-knowledge-sharing">Common Failure Modes in Knowledge Sharing</h2>
<p>The chapter identifies several patterns that hinder learning in engineering organizations:</p>
<section id="information-islands" class="level3">
<h3 class="anchored" data-anchor-id="information-islands">Information Islands</h3>
<p>Teams develop isolated workflows, tools, and norms. This leads to:</p>
<ul>
<li><strong>Fragmentation</strong> — incomplete understanding of the whole system</li>
<li><strong>Duplication</strong> — reinventing solutions</li>
<li><strong>Skew</strong> — inconsistent or conflicting approaches</li>
</ul>
</section>
<section id="allornothing-expertise" class="level3">
<h3 class="anchored" data-anchor-id="allornothing-expertise">All‑or‑Nothing Expertise</h3>
<p>Experts accumulate more and more responsibility, while novices struggle to ramp up. Without deliberate mentoring or documentation, knowledge concentrates instead of spreading.</p>
</section>
<section id="parroting-and-haunted-graveyards" class="level3">
<h3 class="anchored" data-anchor-id="parroting-and-haunted-graveyards">Parroting and Haunted Graveyards</h3>
<ul>
<li><strong>Parroting</strong>: copying code or patterns without understanding them</li>
<li><strong>Haunted graveyards</strong>: parts of the codebase people avoid touching out of fear</li>
</ul>
<p>Both behaviors emerge when engineers lack context or confidence.</p>
</section>
<section id="the-philosophy-people-not-just-code" class="level3">
<h3 class="anchored" data-anchor-id="the-philosophy-people-not-just-code">The Philosophy: People, Not Just Code</h3>
<p>The authors remind us that software engineering is the multi-person development of multi-version programs. Code is only one artifact; the real work is coordinating people, knowledge, and decisions.</p>
<p>Two forms of knowledge coexist:</p>
<ul>
<li><p><strong>Tribal Knowledge</strong>: Unwritten, experience‑based, often held by experts.</p></li>
<li><p><strong>Written Knowledge</strong>: Documentation, tutorials, wikis, mailing lists, Q&amp;A platforms.</p></li>
</ul>
<p>Neither is sufficient alone. Tribal knowledge provides nuance and context; documentation provides scale and permanence. Healthy organizations cultivate both.</p>
</section>
<section id="asking-better-questions-the-engine-of-learning" class="level3">
<h3 class="anchored" data-anchor-id="asking-better-questions-the-engine-of-learning">Asking Better Questions: The Engine of Learning</h3>
<p><strong>Always Be Learning</strong>: The chapter’s strongest message is simple: ask questions. Engineers often hesitate, fearing their questions are too basic. But the authors insist that learning is continuous — even senior engineers regularly encounter unfamiliar systems.</p>
<p>Asking questions:</p>
<ul>
<li>accelerates onboarding</li>
<li>prevents repeated mistakes</li>
<li>exposes hidden assumptions</li>
<li>strengthens team culture</li>
</ul>
</section>
<section id="understanding-context" class="level3">
<h3 class="anchored" data-anchor-id="understanding-context">Understanding Context</h3>
<p>The chapter invokes Chesterton’s fence: before changing something, understand why it exists. Legacy systems often encode historical constraints or subtle requirements. Engineers who skip context risk breaking critical functionality or repeating past mistakes.</p>
</section>
<section id="scaling-knowledge-beyond-individuals" class="level3">
<h3 class="anchored" data-anchor-id="scaling-knowledge-beyond-individuals">Scaling Knowledge Beyond Individuals</h3>
<ul>
<li><p><strong>Group Chats</strong>: Fast, informal, high‑bandwidth communication. Great for quick questions, but poor for long‑term discoverability.</p></li>
<li><p><strong>Mailing Lists</strong>: More structured, searchable, and archived. Useful for complex questions requiring detailed context. However, they can become noisy and outdated.</p></li>
<li><p><strong>YAQS</strong> (Google’s Internal Stack Overflow) A structured Q&amp;A platform with:</p>
<ul>
<li>editable answers</li>
<li>upvoting</li>
<li>long‑term discoverability</li>
<li>links to internal code</li>
</ul></li>
</ul>
<p>YAQS reduces duplication and centralizes knowledge, making it easier for future engineers to find authoritative answers.</p>
</section>
<section id="teaching-as-a-core-engineering-skill" class="level3">
<h3 class="anchored" data-anchor-id="teaching-as-a-core-engineering-skill">Teaching as a Core Engineering Skill</h3>
<p>The chapter stresses that everyone has something to teach. Expertise is not binary; it is multidimensional. Google encourages teaching through:</p>
<ul>
<li><p><strong>Office Hours</strong>: Scheduled time for engineers to ask experts questions. Useful for ambiguous or complex problems.</p></li>
<li><p><strong>Tech Talks and Classes</strong>: Google’s <code>engEDU</code> and <code>g2g</code> programs allow engineers to teach topics ranging from CPU vectorization to swing dancing. Classes are resource‑intensive but effective for stable, complex topics that require guided learning.</p></li>
</ul>
</section>
<section id="documentation-the-backbone-of-scalable-knowledge" class="level3">
<h3 class="anchored" data-anchor-id="documentation-the-backbone-of-scalable-knowledge">Documentation: The Backbone of Scalable Knowledge</h3>
<p>Documentation is the most scalable form of knowledge sharing — but only if it is maintained.</p>
<ul>
<li><p><strong>Updating Documentation</strong>: The best time to improve documentation is when you are learning something for the first time. Beginners see gaps experts overlook. Google encourages engineers to fix typos, clarify steps, and update examples immediately.</p></li>
<li><p><strong>Creating Documentation</strong>: Engineers should document new workflows, tools, and tribal knowledge. Documentation must be:</p>
<ul>
<li>discoverable</li>
<li>searchable</li>
<li>easy to update</li>
<li>open to feedback</li>
</ul></li>
<li><p>Google’s <code>g3doc</code> system places documentation next to source code, making it easy to find and maintain.</p></li>
<li><p><strong>Promoting Documentation</strong>: Writing documentation saves time in the long run. Instead of repeatedly answering the same question, engineers can point teammates to a canonical reference. Documentation also reduces SPOFs and helps teams scale.</p></li>
</ul>
</section>
<section id="conclusion-knowledge-sharing-as-organizational-infrastructure" class="level3">
<h3 class="anchored" data-anchor-id="conclusion-knowledge-sharing-as-organizational-infrastructure">Conclusion: Knowledge Sharing as Organizational Infrastructure</h3>
<p>The chapter makes a compelling argument: knowledge sharing is not a luxury — it is infrastructure. Organizations that fail to invest in learning accumulate technical debt, cultural debt, and operational fragility.</p>
<p>Google’s approach blends:</p>
<ul>
<li>psychological safety</li>
<li>mentorship</li>
<li>community‑based learning</li>
<li>structured teaching</li>
<li>robust documentation systems</li>
</ul>
<p>The overarching lesson is clear: expertise must be grown, shared, and maintained deliberately. Software engineering is fundamentally a human discipline, and knowledge sharing is how organizations turn individual expertise into collective capability.</p>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our team built KnowledgeBoard, a simple program for tracking who is working on what, if they need help, and if they are available to help others. You can view the project here: <a href="https://github.com/Rivan-Deets/KnowledgeBoard">KnowledgeBoard on GitHub</a>.</p>
</div>
</div>
</div>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>
</section>
</section>

 ]]></description>
  <category>post</category>
  <category>professional development</category>
  <category>software engineering</category>
  <guid>https://www.developerdevelopment.com/blog/se4-fall2026/</guid>
  <pubDate>Mon, 21 Sep 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Fuzzing — Breaking Things with Random Inputs</title>
  <dc:creator>Lukas Deemer</dc:creator>
  <dc:creator>Johnny Sharsheev</dc:creator>
  <link>https://www.developerdevelopment.com/blog/fb3-fall2026/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<section id="what-is-fuzzing" class="level3">
<h3 class="anchored" data-anchor-id="what-is-fuzzing">What is Fuzzing?</h3>
<section id="fuzzers" class="level4">
<h4 class="anchored" data-anchor-id="fuzzers">Fuzzers</h4>
<p><code>Fuzzer</code> is a base class for fuzzers, with <code>RandomFuzzer</code> as a simple instantiation. The <code>fuzz()</code> method of <code>Fuzzer</code> objects and returns a string with a generated input.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> random_fuzzer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RandomFuzzer()</span>
<span id="cb1-2"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> random_fuzzer.fuzz()</span></code></pre></div></div>
<p>Output: <code>%$&lt;1&amp;&lt;%+=!"83?+)9:++9138 42/ "7;0-,)06 "1(2;6&gt;?99$%7!!*#96=&gt;2&amp;-/(5*)=$;0$$+;&lt;12"?30&amp;</code></p>
<p>The <code>RandomFuzzer</code> constructor allows a number of keyword arguments:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(RandomFuzzer.<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>.__doc__)</span></code></pre></div></div>
<p>Output: Produce strings of <code>min_length</code> to <code>max_length</code> characters in the range [<code>char_start</code>, <code>char_start</code> + <code>char_range</code>)</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> random_fuzzer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RandomFuzzer(min_length<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, max_length<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, char_start<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">65</span>, char_range<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">26</span>)</span>
<span id="cb3-2"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> random_fuzzer.fuzz()</span></code></pre></div></div>
<p>Output: <code>'XGZVDDPZOOW'</code></p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.developerdevelopment.com/blog/fb3-fall2026/Fuzzer&amp;RandomFuzzer.png" class="img-fluid figure-img"></p>
<figcaption>Fuzzer &amp; Random Fuzzer</figcaption>
</figure>
</div>
</section>
<section id="runners" class="level4">
<h4 class="anchored" data-anchor-id="runners">Runners</h4>
<p>A <code>Fuzzer</code> can be paired with a <code>Runner</code> which takes the fuzzed strings as input. Its result is a class-specific <em>status</em> and an <em>outcome</em> (<code>PASS</code>, <code>FAIL</code>, or <code>UNRESOLVED</code>). A <code>PrintRunner</code> will simply print out the given input and return a <code>PASS</code> outcome:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> print_runner <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PrintRunner()</span>
<span id="cb4-2"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> random_fuzzer.run(print_runner)</span></code></pre></div></div>
<p>Outcome: <code>('EQYGAXPTVPJGTYHXFJ', 'UNRESOLVED')</code></p>
<p>A <code>ProgramRunner</code> will feed the generated input into an external program. Its result is a pair of the program status (a <code>CompletedProcess</code> instance) and an <em>outcome</em> (<code>PASS</code>, <code>FAIL</code> or <code>UNRESOLVED</code>):</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> cat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ProgramRunner(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'cat'</span>)</span>
<span id="cb5-2"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> random_fuzzer.run(cat)</span></code></pre></div></div>
<p>Outcome: <code>(CompletedProcess(args='cat', returncode=0, stdout='BZOQTXFBTEOVYX', stderr=''), 'PASS')</code></p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.developerdevelopment.com/blog/fb3-fall2026/Runners.png" class="img-fluid figure-img"></p>
<figcaption>Runners</figcaption>
</figure>
</div>
</section>
</section>
<section id="a-testing-assignment" class="level3">
<h3 class="anchored" data-anchor-id="a-testing-assignment">A Testing Assignment</h3>
<p>Fuzzing was created in the Fall of 1988. While sitting in his apartment in Wisconsin, Madison, professor Barton Miller was connected to his university computer via a 1200 baud telephone line. The thunderstorm caused noise on the line, and this noise in turn caused the UNIX commands on either end to get bad inputs and crash. He wanted to investigate the extent of the problem and its causes. So he made a <em>programming exercise</em> for his students at the University of Wisconsin-Madison. This exercise would have his students create the first fuzzers.</p>
<p>This is how the <a href="https://pages.cs.wisc.edu/~bart/fuzz/CS736-Projects-f1988.pdf">assignment</a> read:</p>
<blockquote class="blockquote">
<p>The goal of this project is to evaluate the robustness of various UNIX utility programs, given an unpredictable input stream. […] First, you will build a fuzz generator. This is a program that will output a random character stream. Second, you will take the fuzz generator and use it to attack as many UNIX utilities as possible, with the goal of trying to break them.</p>
</blockquote>
<p>This assignment captures the essence of fuzzing: <em>Create random inputs, and see if they break things</em>. Just let it run long enough, and you’ll see.</p>
</section>
<section id="a-simple-fuzzer" class="level3">
<h3 class="anchored" data-anchor-id="a-simple-fuzzer">A Simple Fuzzer</h3>
<p>Let’s build a fuzz generator. The idea is to produce random characters, adding them to a buffer string variable (out), and finally returning the string.</p>
<p>This implementation uses the following Python features and functions:</p>
<ul>
<li><code>random.randrange(start, end)</code> - return a random number [<code>start</code>, <code>end</code>)</li>
<li><code>range(start, end)</code> – create an iterator (which can be used as a list) with integers in the range [<code>start, end</code>).</li>
<li><code>for elem in list: body</code> – execute body in a loop with <code>elem</code> taking each value from <code>list</code>.</li>
<li><code>for i in range(start, end): body</code> – execute body in a loop with <code>i</code> from <code>start</code> to <code>end</code> — 1.</li>
<li><code>chr(n)</code> – return a character with ASCII code <code>n</code></li>
</ul>
<p>Here is the actual <code>fuzzer()</code> function:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fuzzer(max_length: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, char<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>start: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, char_range: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>:</span>
<span id="cb6-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A string of up to `max_length` characters in the range [`char_start`, `char_start` + `char_range`]"""</span></span>
<span id="cb6-3">    string_length <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> random.randrange(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, max_length <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb6-4">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb6-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, string_length):</span>
<span id="cb6-6">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">chr</span>(random.randrange(char_start, char_start <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> char_range))</span>
<span id="cb6-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span></code></pre></div></div>
<p>With its default arguments, the <code>fuzzer()</code> function returns a string of random characters:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1">fuzzer()</span></code></pre></div></div>
<p>Output: <code>!7#%"*#0=)$;%6*;&gt;638:*&gt;80"=&lt;/&gt;(/*:-(2&lt;4 !:5*6856&amp;?""11&lt;7+%&lt;%7,4.8,*+&amp;,,$,."</code></p>
<p>Bart Miller had created the term “fuzz” as the name for such random, unstructured data.</p>
<p>It is also possible to produce a series of lowercase letters. We use <code>ord(c)</code> to return the ASCII code of the character c.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1">fuzzer(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">ord</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">26</span>)</span></code></pre></div></div>
<p>Output: <code>zskscocrxllosagkvaszlngpysurezehvcqcghygphnhonehczraznkibltfmocxddoxcmrvatcleysksodzlwmzdndoxrjfqigjhqjxkblyrtoaydlwwisrvxtxsejhfbnforvlfisojqaktcxpmjqsfsycisoexjctydzxzzutukdztxvdpqbjuqmsectwjvylvbixzfmqiabdnihqagsvlyxwxxconminadcaqjdzcnzfjlwccyudmdfceiepwvyggepjxoeqaqbjzvmjdlebxqvehkmlevoofjlilegieeihmetjappbisqgrjhglzgffqrdqcwfmmwqecxlqfpvgtvcddvmwkplmwadgiyckrfjddxnegvmxravaunzwhpfpyzuyyavwwtgykwfszasvlbwojetvcygectelwkputfczgsfsbclnkzzcjfywitooygjwqujseflqyvqgyzpvknddzemkegrjjrshbouqxcmixnqhgsgdwgzwzmgzfajymbcfezqxndbmzwnxjeevgtpjtcwgbzptozflrwvuopohbvpmpaifnyyfvbzzdsdlznusarkmmtazptbjbqdkrsnrpgdffemnpehoapiiudokczwrvpsonybfpaeyorrgjdmgvkvupdtkrequicexqkoikygepawmwsdcrhivoegynnhodfhryeqbebtbqnwhogdfrsrksntqjbocvislhgrgchkhpaiugpbdygwkhrtyniufabdnqhtnwreiascfvmuhettfpbowbjadfxnbtzhobnxsnf</code></p>
</section>
<section id="fuzzing-external-programs" class="level3">
<h3 class="anchored" data-anchor-id="fuzzing-external-programs">Fuzzing External Programs</h3>
<p>Let’s invoke an external program with fuzzed inputs. First, we create an <em>input file</em> with fuzzed test data; then we feed this input file into a program of choice.</p>
<section id="creating-input-files" class="level4">
<h4 class="anchored" data-anchor-id="creating-input-files">Creating Input Files</h4>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1">basename <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"input.txt"</span></span>
<span id="cb9-2">tempdir <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tempfile.mkdtemp()</span>
<span id="cb9-3">FILE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> os.path.oin(tempdir, basename)</span>
<span id="cb9-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(FILE)</span></code></pre></div></div>
<p>Output: <code>/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/tmp33gvbu2n/input.txt</code></p>
<p>Let’s open it. The Python <code>open()</code> function opens a file into which we can then write arbitrary contents. Very commonly, it is used with the <code>with</code> statement, which ensures that the file is closed as soon as it is no longer needed.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1">data <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fuzzer()</span>
<span id="cb10-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">open</span>(FILE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"w"</span>) <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> f:</span>
<span id="cb10-3">    f.write(data)</span></code></pre></div></div>
<p>The file can be verified by reading its contents:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1">contents <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">open</span>(FILE).read()</span>
<span id="cb11-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(contents)</span>
<span id="cb11-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span>(contents <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> data)</span></code></pre></div></div>
<p>Output: <code>&lt;?6&amp;" !3'7-5&gt;18%55*,5</code></p>
</section>
<section id="invoking-external-programs" class="level4">
<h4 class="anchored" data-anchor-id="invoking-external-programs">Invoking External Programs</h4>
<p>With that input file, we can invoke a program on it.</p>
<p>We will use the <code>bc</code> calculator program, which takes an arithmetic expression and evaluates it.</p>
<p>To invoke <code>bc</code> let’s use the Python <code>subprocess</code> module. This is how it works:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1">program <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bc"</span></span>
<span id="cb12-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">open</span>(FILE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"w"</span>) <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> f:</span>
<span id="cb12-3">    f.write(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2 + 2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-4">result <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> subprocess.run([program, FILE],</span>
<span id="cb12-5">stdin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>subprocess.DEVNULL,</span>
<span id="cb12-6">stdout<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>subprocess.PIPE,</span>
<span id="cb12-7">stderr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>subprocess.PIPE,</span>
<span id="cb12-8">universal_newlines<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span></code></pre></div></div>
<p>Using <code>result</code>, we can check the program’s output. In the case of <code>bc</code>, this is the result:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1">result.stdout</span></code></pre></div></div>
<p>Output: <code>4\n</code></p>
<p>The status may also be checked, a value of 0 indicating the program terminated correctly.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1">result.returncode</span></code></pre></div></div>
<p>Output: <code>0</code></p>
<p>Any error messages would be available in <code>results.stderr</code>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1">results.stderr</span></code></pre></div></div>
<p>Output: <code>''</code></p>
<p>Any program is able to go through this process, however, you should be careful as you could change or even damage your system.</p>
</section>
</section>
<section id="bug-fuzzers-find" class="level3">
<h3 class="anchored" data-anchor-id="bug-fuzzers-find">Bug Fuzzers Find</h3>
<p>When Miller and his students ran their first fuzzers in 1989, they found an alarming result: About <strong>A third of the UNIX utilities</strong> they fuzzed had issues — they crashed, hung, or otherwise failed when confronted with fuzzing input. This also included the <code>bc</code> program above.</p>
<p>Because many of these UNIX utilities were used in scripts that would also process network input, this was a potential hazard, one which need fuzzers to fix.</p>
<section id="buffer-overflows" class="level4">
<h4 class="anchored" data-anchor-id="buffer-overflows">Buffer Overflows</h4>
<p><strong>Buffer overflows</strong> are triggered when going over a program’s built-in maximum lengths for inputs and input elements.</p>
<p>Buffer overflow behavior can be easily simulated in a Python function:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb16-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> crash_if_too_long(s):</span>
<span id="cb16-2">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">buffer</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Thursday"</span></span>
<span id="cb16-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(s) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">buffer</span>):</span>
<span id="cb16-4">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span></span></code></pre></div></div>
<p>This leads to a crash very quickly.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1">trials <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb17-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> ExpectError():</span>
<span id="cb17-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(trials):</span>
<span id="cb17-4">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fuzzer()</span>
<span id="cb17-5">        crash_if_too_long(s)</span></code></pre></div></div>
<p>Output: <code>Traceback (most recent call last): File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_1932/292568387.py", line 5, in &lt;module&gt; crash_if_too_long(s) File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_1932/2784561514.py", line 4, in crash_if_too_long raise ValueError ValueError (expected)</code></p>
<p>The <code>with ExpectError()</code> line in the above code ensures that the error message is printed, yet execution continues; this is to differentiate this “expected” error from “unexpected” errors in other code examples.</p>
</section>
<section id="missing-error-checks" class="level4">
<h4 class="anchored" data-anchor-id="missing-error-checks">Missing Error Checks</h4>
<p>Many programming languages do not have exceptions, but instead have functions return special <strong>error codes</strong> in exceptional circumstances. The C function <code>getchar()</code>, for instance, normally returns a character from the standard input; if no input is available anymore, it returns the special value <code>EOF</code>(end of file).</p>
<p>In a situation where, for example, <code>getchar()</code> reaches and scans a space character, <code>getchar()</code> could return <code>EOF</code>, and keep returning <code>EOF</code> when called again. This would lead to an infinite loop. However, if a line with the <code>with ExpectTimeout()</code> was implemented, the code would be interrupted after a set amount of time, printing an error message.</p>
</section>
<section id="rogue-numbers" class="level4">
<h4 class="anchored" data-anchor-id="rogue-numbers">Rogue Numbers</h4>
<p>When fuzzing, it is easy to generate <strong>uncommon values</strong> in the input, which can lead to a load of interesting behavior. The value could exceed program memory, lead to a crash, or an array of other unexpected outcomes.</p>
<p>It is important to use these rogue numbers because it is much better to quickly fail the program than to allow it to destroy something later down the line.</p>
</section>
</section>
<section id="catching-errors" class="level3">
<h3 class="anchored" data-anchor-id="catching-errors">Catching Errors</h3>
<p>Fuzzing also needs checks for failures that do not cause obvious crashes.</p>
<section id="generic-checkers" class="level4">
<h4 class="anchored" data-anchor-id="generic-checkers">Generic Checkers</h4>
<p>Generic checkers detect common problems. For example, <code>AddressSanitizer</code> detects invalid memory accesses in C and C++ programs. Outputs can also be checked for leaked secret information.</p>
</section>
<section id="program-specific-checkers" class="level4">
<h4 class="anchored" data-anchor-id="program-specific-checkers">Program-Specific Checkers</h4>
<p>Program-specific checkers use assertions to verify rules about a program’s data or results. The chapter’s <a href="https://www.fuzzingbook.org/html/Fuzzer.html#Program-Specific-Checkers">airport-code example</a> checks for three uppercase letters. Here is a simplified version:</p>
<div id="70afe24a" class="cell" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> check_airport_code(code):</span>
<span id="cb18-2">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(code) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expected three characters"</span></span>
<span id="cb18-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(c.isalpha() <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> c.isupper() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> code), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expected uppercase letters"</span></span>
<span id="cb18-4"></span>
<span id="cb18-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> code <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"JFK"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"jfK"</span>]:</span>
<span id="cb18-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb18-7">        check_airport_code(code)</span>
<span id="cb18-8">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(code, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PASS"</span>)</span>
<span id="cb18-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">AssertionError</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> error:</span>
<span id="cb18-10">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(code, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FAIL:"</span>, error)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>JFK PASS
jfK FAIL: Expected uppercase letters</code></pre>
</div>
</div>
<p><code>JFK</code> passes both checks. <code>jfK</code> fails because it contains lowercase letters.</p>
</section>
<section id="static-code-checkers" class="level4">
<h4 class="anchored" data-anchor-id="static-code-checkers">Static Code Checkers</h4>
<p>Static checkers inspect code without running it. For example, mypy can detect type mismatches, but it cannot check every program-specific rule.</p>
</section>
</section>
<section id="a-fuzzing-architecture" class="level3">
<h3 class="anchored" data-anchor-id="a-fuzzing-architecture">A Fuzzing Architecture</h3>
<p>The classes introduced above separate two responsibilities: <code>Fuzzer</code> creates inputs, and <code>Runner</code> handles them and classifies the results.</p>
<p><code>run()</code> sends one generated input to a runner, while <code>runs()</code> repeats the process. This separation lets us reuse a generator with different targets.</p>
<p>A runner reports <code>PASS</code>, <code>FAIL</code>, or <code>UNRESOLVED</code>. Passing means its checks found no failure; it does not prove correctness. <code>UNRESOLVED</code> means the runner could not judge the result.</p>
</section>
<section id="lessons-learned" class="level3">
<h3 class="anchored" data-anchor-id="lessons-learned">Lessons Learned</h3>
<ul>
<li>Randomly generating inputs (i.e., “fuzzing”) is a simple, cost-effective way to quickly test arbitrary programs for their robustness.</li>
<li>Bugs fuzzers find are mainly due to errors and deficiencies in <em>input processing</em>.</li>
<li>To catch errors, have as many <em>consistency checkers</em> as possible.</li>
</ul>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our team built <code>FuzzerCheck</code>, a Python command-line tool that demonstrates random fuzzing using two examples adapted from the chapter. It generates inputs, reports passing and failing trials, and displays sample failing inputs.</p>
<p>You can view the project here: <a href="https://github.com/Jsharsh33v/fuzzercheck">FuzzerCheck on GitHub</a>.</p>
</div>
</div>
</div>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Reference">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-2-contents" aria-controls="callout-2" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Reference
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-2" class="callout-2-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Unless otherwise noted, the source code segments in this article are excerpted directly from the <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. The authors of this online book licensed the source code and its written content under the <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0 Creative Commons License</a>. More details about the license for the Fuzzing Book are available in the <a href="https://github.com/uds-se/fuzzingbook/blob/master/LICENSE.md">The Fuzzing Book License</a>.</p>
</div>
</div>
</div>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>
</section>

 ]]></description>
  <category>post</category>
  <category>software engineering</category>
  <category>fuzzing book</category>
  <guid>https://www.developerdevelopment.com/blog/fb3-fall2026/</guid>
  <pubDate>Wed, 16 Sep 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Why Teamwork Matters in Software Engineering</title>
  <dc:creator>Anshu Pathak</dc:creator>
  <dc:creator>Aidana Kuat</dc:creator>
  <dc:creator>Jake McCallen</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/se3-fall2026/</link>
  <description><![CDATA[ 




<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>This article explains why teamwork is one of the most important parts of software engineering. It shows that being a good programmer is not enough because engineers also need to communicate, share ideas, and work well with others. Many programmers are afraid to show unfinished work because they worry about being judged or making mistakes. However, hiding work can slow down progress and prevent people from getting useful feedback. The article also challenges the “Genius Myth,” which is the idea that successful software is usually created by one brilliant person working alone. In reality, most successful software is created by teams that not only share knowledge, review each other’s work, but also solve problems together. Getting feedback early and making sure that more than one person understands the project can make development safer and faster. Thus, the author’s main idea is that strong collaboration and trust are just as important as technical skills when building successful software.</p>
<section id="why-software-engineering-depends-on-teamwork" class="level3">
<h3 class="anchored" data-anchor-id="why-software-engineering-depends-on-teamwork">Why Software Engineering Depends on Teamwork</h3>
<p>Software engineering is not something that people usually do successfully alone. Even though some programmers are remembered as “geniuses,” most successful software is created by many people working together. This is what the author calls the Genius Myth. People often connect Linux with Linus Torvalds or Python with Guido van Rossum, but both projects became successful because many developers contributed ideas, features, testing, and improvements. According to the author technical ability alone is not the most important part of creating a successful project; we should not give one person credit for the achievement of an entire team or community. Engineers also need communication, teamwork, and social skills to build successful software. This changes the way we should think about a good software engineer. Someone can be extremely good at programming but still create problems for the team if they refuse to communicate or cooperate.</p>
</section>
<section id="why-sharing-work-early-matters" class="level3">
<h3 class="anchored" data-anchor-id="why-sharing-work-early-matters">Why Sharing Work Early Matters</h3>
<p>Programmers should avoid hiding their work until it feels perfect for them. Many developers often eel uncomfortable showing unfinished code because they are worried that other people will notice mistakes or judge their abilities. This feeling is normal, however working in complete isolation can create bigger problems later. The article provides an example of someone spending months developing an idea alone, only to discover that another person solved the same problem faster by working with others. Therefore, an early feedback is extremely important. A teammate may notice a mistake in a few minutes that you could spend days trying to solve by yourself.</p>
<p>This idea is closely connected to shifting left. In software development, shifting left means moving important checks earlier in the development process instead of leaving them until the end. For instance, when using a compiler, a programmer would not normally write 10,000 lines of code and compile everything only after finishing. Instead, they would write a small part, compile it, fix any problems, and only then continue. This creates a short feedback loop where mistakes can be found almost immediately.</p>
</section>
<section id="building-a-team-that-can-succeed-together" class="level3">
<h3 class="anchored" data-anchor-id="building-a-team-that-can-succeed-together">Building a Team That Can Succeed Together</h3>
<p>Working as a team also means that knowledge should not stay with only one person. Using the idea of the bus factor from the book, if only one engineer understands an important part of a project, the whole team may struggle if that person suddenly becomes unavailable. Someone could leave the company, move to another team, or simply be away for a long period of time. Because of this, teams need to make sure that important knowledge is shared. When people understand each other’s work, it becomes easier to continue the project and help someone who gets stuck.</p>
<p>The article also shows that the work environment can influence how easily this knowledge is shared. In the past, engineers were often given private offices because people believed that programmers needed complete silence to concentrate. Although quiet time is important, being separated from the rest of the team can create another problem. If asking a simple question means leaving your office, finding another person, or interrupting them formally, people may decide not to ask at all. Small questions can then turn into larger problems because communication does not happen naturally. At the same time, putting everyone into one large open office is not necessarily better. Constant conversations and movements can interrupt engineers when they are trying to solve difficult problems. Because of this, the article argues that neither complete isolation nor constant communication is ideal. A better environment allows both focus and easy communication. Engineers should be able to work without unnecessary interruptions, but asking a teammate for help should also feel normal and simple. Some teams create signals to show when a person should not be disturbed. For example, wearing headphones may mean that someone is concentrating and should only be interrupted for something crucial.</p>
</section>
<section id="the-three-pillars-of-social-interaction" class="level3">
<h3 class="anchored" data-anchor-id="the-three-pillars-of-social-interaction">The Three Pillars of Social Interaction</h3>
<p>Collaboration is built on the “3 pillars” of social skills that serve as a foundation for healthy interaction.</p>
<ul>
<li><strong>Humility</strong>: You are not the center of the universe, are not omniscient, and can make mistakes. Be open to self improvement.</li>
<li><strong>Respect</strong>: Care about the people you work with, treat them kindly and appreciate their contributions, abilities, and accomplishments.</li>
<li><strong>Trust</strong>: Believe that others are competent and will do the right thing and have faith that they will be able to handle themselves.</li>
</ul>
<p>Performing a root-cause analysis on most social conflicts almost always reveals a lack of one of the three at the most basic level.</p>
</section>
<section id="why-do-these-pillars-matter" class="level3">
<h3 class="anchored" data-anchor-id="why-do-these-pillars-matter">Why Do These Pillars Matter?</h3>
<p>Dealing with social problems can be difficult, but is incredibly useful when engaging in any work, as collaboration can lead to a more efficient workflow. Work groups will outlast any project, and can meet deadlines much faster than if each person would instead have done their own thing.</p>
</section>
<section id="humility-trust-and-respect-in-practice" class="level3">
<h3 class="anchored" data-anchor-id="humility-trust-and-respect-in-practice">Humility, Trust, and Respect in Practice</h3>
<p>Being a proper team member may sound incredibly difficult, but when put into practice, is incredibly easy if broken down to the simplest levels.</p>
<ul>
<li>Relax and/or drop your ego</li>
<li>Give and take criticism</li>
<li>Fail fast, iterate, and improve</li>
<li>Learn proper patience</li>
<li>Be open to influence</li>
</ul>
</section>
<section id="blameless-post-mortem-culture" class="level3">
<h3 class="anchored" data-anchor-id="blameless-post-mortem-culture">Blameless Post-Mortem Culture</h3>
<p>Understanding failures can be made easier by performing a root-cause analysis and writing a “postmortem” (as is called at Google and other companies). Ensure that the report isn’t a list of apologies or excuses, and addresses what exactly failed and what has been learned.</p>
<ul>
<li>A good postmortem should include:
<ul>
<li>An event summary</li>
<li>Timeline of the event</li>
<li>The cause of the event</li>
<li>Impact/damage assessment</li>
<li>A list of action items and owners to fix the problem</li>
<li>A set of action items to prevent the event from reoccurring</li>
<li>Lessons learned</li>
</ul></li>
</ul>
</section>
<section id="being-googley" class="level3">
<h3 class="anchored" data-anchor-id="being-googley">Being “Googley”</h3>
<p>“Googley” in this document is more so just a wide term for a set of attitudes and behaviors that represent strong leadership and exemplify humility, respect, and trust.</p>
<ul>
<li><strong>Thrives in ambiguity</strong>: Can deal with conflicting requests and directions even when the environment is constantly shifting.</li>
<li><strong>Values feedback</strong>: Can receive and give feedback gracefully and understands the value of that feedback.</li>
<li><strong>Challenges the status quo</strong>: Can set ambitious goals and pursue them even when there may be resistance or inertia from others</li>
<li><strong>Puts the user first</strong>: Has empathy and respect for the users of products.</li>
<li><strong>Cares about the team</strong>: Has empathy and respect for coworkers.</li>
</ul>
</section>
</section>
<section id="take-home-message" class="level2">
<h2 class="anchored" data-anchor-id="take-home-message">Take Home Message</h2>
<p>Just be aware of the pros and cons of solo work, understand the time that you and your team spend communicating and in conflict. Working effectively with a team or large organization requires being aware of your and their preferred working styles.</p>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our team built <code>handoff</code>, a simple CLI for tracking project owners, backups, and runbooks. You can view the project here: <a href="https://github.com/pathakanshu/handoff">handoff on GitHub</a>.</p>
</div>
</div>
</div>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>professional development</category>
  <category>software engineering</category>
  <guid>https://www.developerdevelopment.com/blog/se3-fall2026/</guid>
  <pubDate>Mon, 14 Sep 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Understanding Code Coverage</title>
  <dc:creator>Alexander Goddard</dc:creator>
  <dc:creator>Anshu Pathak</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/fb2-fall2026/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This chapter introduces code coverage, a core idea in software testing that helps us measure how much of a program is actually executed during a test run. In the Fuzzing Book, coverage is not just a metric for reporting test quality; it is also a tool for guiding fuzzers toward inputs that reach new code paths. By understanding coverage, developers can write better tests, detect risky untested code, and improve the quality of their software.</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<section id="what-is-code-coverage" class="level3">
<h3 class="anchored" data-anchor-id="what-is-code-coverage">What Is Code Coverage?</h3>
<p>Code coverage measures which parts of a program are executed when tests or fuzzing inputs run. If a line, branch, or function is never reached, then it is not being validated by the current test suite. A high coverage score suggests that more of the program has been exercised, but it does not guarantee that the program is correct.</p>
<p>In the Fuzzing Book, the authors use coverage to answer a practical question: Are our tests reaching important behavior in the code, or are they only exercising a small subset of the program? This idea is especially useful in fuzzing, where the goal is to generate inputs that drive execution into new and potentially buggy paths.</p>
</section>
<section id="why-coverage-matters" class="level3">
<h3 class="anchored" data-anchor-id="why-coverage-matters">Why Coverage Matters</h3>
<p>A program can appear to work for a few examples while still hiding serious problems in rarely used branches. Coverage helps expose this problem by telling us which code was reached and which code was skipped. For example, if an error-handling branch is never executed, then we cannot know whether that branch works as intended.</p>
<p>Coverage is useful because it:</p>
<ul>
<li>identifies untested code;</li>
<li>guides the creation of new test inputs;</li>
<li>measures how effective a test suite is;</li>
<li>helps guide automated fuzzing toward unexplored behavior.</li>
</ul>
</section>
<section id="black-box-and-white-box-testing" class="level3">
<h3 class="anchored" data-anchor-id="black-box-and-white-box-testing">Black-Box and White-Box Testing</h3>
<p>The Fuzzing Book distinguishes between black-box and white-box testing.</p>
<ul>
<li>Black-box testing derives tests from the program specification. The tester knows what the program should do, not how it does it.</li>
<li>White-box testing derives tests from the implementation. The tester knows the structure of the code and writes inputs that exercise specific branches and statements.</li>
</ul>
<p>A simple example is a function called <code>cgi_decode()</code>, which decodes strings such as <code>"Hello+world"</code> and <code>"Hello%2c+world%21"</code>. A black-box tester would check the expected behavior of decoding plus signs and percent-encoded values. A white-box tester would look at the internal <code>if</code> and <code>while</code> statements and make sure each branch is covered.</p>
</section>
<section id="statement-coverage" class="level3">
<h3 class="anchored" data-anchor-id="statement-coverage">Statement Coverage</h3>
<p>One common coverage metric is statement coverage. A statement is covered if it is executed at least once during testing. If a function contains a branch that is never reached, then the statements in that branch have zero coverage.</p>
<p>For a function like <code>cgi_decode()</code>, we must cover the code blocks for:</p>
<ul>
<li><code>if c == '+'</code></li>
<li>the valid <code>%xx</code> case;</li>
<li>the invalid <code>%xx</code> case;</li>
<li>the default <code>else</code> case.</li>
</ul>
<p>If any of these blocks are never executed, we may miss a bug in that path.</p>
</section>
<section id="branch-coverage" class="level3">
<h3 class="anchored" data-anchor-id="branch-coverage">Branch Coverage</h3>
<p>Branch coverage is stricter than statement coverage. It requires that each control decision is exercised in both directions: true and false. In other words, a test suite must cover both outcomes of an <code>if</code> or <code>while</code> condition.</p>
<p>This matters because a statement may be executed once while still leaving key decision branches untested. For example, only exercising the true branch of a condition does not tell us whether the false branch behaves correctly.</p>
</section>
<section id="tracing-execution" class="level3">
<h3 class="anchored" data-anchor-id="tracing-execution">Tracing Execution</h3>
<p>In Python, coverage can be collected by tracing execution with <code>sys.settrace()</code>. A custom tracing function can record each executed line, along with its function name and line number. This is the foundation of coverage measurement in the Fuzzing Book.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sys</span>
<span id="cb1-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> types <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> FrameType, TracebackType</span>
<span id="cb1-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> typing <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Any, Callable, Optional</span>
<span id="cb1-4"></span>
<span id="cb1-5">coverage <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> traceit(frame: FrameType, event: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, arg: Any) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> Optional[Callable]:</span>
<span id="cb1-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> event <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'line'</span>:</span>
<span id="cb1-9">        coverage.append((frame.f_code.co_name, frame.f_lineno))</span>
<span id="cb1-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> traceit</span>
<span id="cb1-11"></span>
<span id="cb1-12"></span>
<span id="cb1-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> cgi_decode_traced(s: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-14">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">global</span> coverage</span>
<span id="cb1-15">    coverage <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb1-16">    sys.settrace(traceit)</span>
<span id="cb1-17">    cgi_decode(s)</span>
<span id="cb1-18">    sys.settrace(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span></code></pre></div></div>
<p>This produces a trace of every executed line, which can then be converted into a set of covered locations.</p>
</section>
<section id="a-coverage-class" class="level3">
<h3 class="anchored" data-anchor-id="a-coverage-class">A Coverage Class</h3>
<p>The Fuzzing Book wraps this tracing logic in a <code>Coverage</code> class. The basic pattern is simple:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> Coverage() <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> cov:</span>
<span id="cb2-2">    cgi_decode(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a+b"</span>)</span>
<span id="cb2-3"></span>
<span id="cb2-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cov.coverage())</span></code></pre></div></div>
<p>The <code>Coverage()</code> object records every executed source location inside the <code>with</code> block. After execution, <code>coverage()</code> returns the set of covered locations. We can also print the object to see which lines were executed and which lines were not, with missed lines marked for attention.</p>
<p>This turns coverage into a practical feedback loop:</p>
<ol type="1">
<li>run a test or fuzzing input;</li>
<li>collect the covered lines;</li>
<li>compare against the target coverage goal;</li>
<li>add or generate inputs to reach the uncovered code.</li>
</ol>
</section>
<section id="coverage-and-fuzzing" class="level3">
<h3 class="anchored" data-anchor-id="coverage-and-fuzzing">Coverage and Fuzzing</h3>
<p>Coverage is especially valuable for fuzzing, because fuzzing aims to generate inputs that explore new behaviors. A fuzzer that only produces random data may rarely reach certain branches. By measuring coverage, we can see whether the fuzzer is improving or whether it is repeatedly exercising the same code.</p>
<p>This chapter shows that even with random inputs, coverage grows over time as more strings reach new branches. The same idea applies to many other testing methods: if a test generator is not covering code, it is probably missing bugs.</p>
</section>
<section id="the-key-lesson" class="level3">
<h3 class="anchored" data-anchor-id="the-key-lesson">The Key Lesson</h3>
<p>Coverage does not prove correctness, but it is a very good approximation of how much of a program has been executed. It helps us answer questions such as:</p>
<ul>
<li>Did our tests reach the error-handling path?</li>
<li>Did we cover both true and false branches?</li>
<li>Are our fuzzing inputs exploring new parts of the program?</li>
</ul>
<p>As the chapter notes, a program can have a large amount of input space and still contain bugs in paths that never appear in a simple test suite. Coverage gives us a way to focus our attention on those unexplored areas.</p>
</section>
</section>
<section id="quiz-check" class="level2">
<h2 class="anchored" data-anchor-id="quiz-check">Quiz Check</h2>
<section id="q1.-what-is-the-main-purpose-of-code-coverage" class="level3">
<h3 class="anchored" data-anchor-id="q1.-what-is-the-main-purpose-of-code-coverage">Q1. What is the main purpose of code coverage?</h3>
<ul class="task-list">
<li><label><input type="checkbox">To guarantee that a program is bug-free.</label></li>
<li><label><input type="checkbox">To measure which parts of a program were executed during testing.</label></li>
<li><label><input type="checkbox">To rewrite the code automatically.</label></li>
<li><label><input type="checkbox">To replace the need for assertions and debugging.</label></li>
</ul>
<details>
<summary>
Click to Expand for the Answer
</summary>
<p><strong>Answer!</strong> Code coverage measures which parts of a program were executed during testing.</p>
</details>
</section>
<section id="q2.-which-of-the-following-is-a-difference-between-black-box-and-white-box-testing" class="level3">
<h3 class="anchored" data-anchor-id="q2.-which-of-the-following-is-a-difference-between-black-box-and-white-box-testing">Q2. Which of the following is a difference between black-box and white-box testing?</h3>
<ul class="task-list">
<li><label><input type="checkbox">Black-box testing checks internal implementation details.</label></li>
<li><label><input type="checkbox">White-box testing derives tests from the implementation and structure of the code.</label></li>
<li><label><input type="checkbox">Black-box testing is only used for fuzzing.</label></li>
<li><label><input type="checkbox">White-box testing ignores runtime behavior.</label></li>
</ul>
<details>
<summary>
Click to Expand for the Answer
</summary>
<p><strong>Answer!</strong> White-box testing derives tests from the implementation and internal structure of the code.</p>
</details>
</section>
</section>
<section id="reflection" class="level2">
<h2 class="anchored" data-anchor-id="reflection">Reflection</h2>
<p>A few important takeaways from the code coverage chapter are:</p>
<ul>
<li>Coverage tells us how much of the code has been executed.</li>
<li>Statement coverage checks whether each line runs at least once.</li>
<li>Branch coverage checks whether each decision has both true and false outcomes.</li>
<li>Tracing allows us to collect coverage automatically during execution.</li>
<li>Coverage is useful for fuzzing because it helps guide test generation toward unexplored branches.</li>
</ul>
<p>Coverage is not a substitute for a correct specification or a strong oracle, but it is an essential tool for finding gaps in testing. When used well, it helps developers focus on the paths most likely to contain defects and gives them a better sense of whether their test suite is actually exploring the program.</p>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Coverage and software engineering">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Coverage and software engineering
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>The core idea is straightforward: if code is not executed, it cannot be validated. Coverage gives software engineers a practical way to discover where testing is weak and where unknown bugs may still be hiding.</p>
</div>
</div>
</div>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-2-contents" aria-controls="callout-2" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-2" class="callout-2-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our team built <code>coverlab</code>, a command-line program that shows code coverage in action. You can view the project here: <a href="https://github.com/pathakanshu/coverlab">CoverLab on GitHub</a>.</p>
</div>
</div>
</div>
<!-- Include the license statement for the online book -->
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Reference">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-3-contents" aria-controls="callout-3" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Reference
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-3" class="callout-3-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Unless otherwise noted, the source code segments in this article are excerpted directly from the <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. The authors of this online book licensed the source code and its written content under the <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0 Creative Commons License</a>. More details about the license for the Fuzzing Book are available in the <a href="https://github.com/uds-se/fuzzingbook/blob/master/LICENSE.md">The Fuzzing Book License</a>.</p>
</div>
</div>
</div>
<!-- Include reference back to the listing of blog posts -->
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>software engineering</category>
  <category>fuzzing book</category>
  <guid>https://www.developerdevelopment.com/blog/fb2-fall2026/</guid>
  <pubDate>Wed, 09 Sep 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>What is Software Engineering?</title>
  <dc:creator>Aidana Kuat</dc:creator>
  <dc:creator>Eyra Co</dc:creator>
  <dc:creator>Logan Butler</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/se2-fall2026/</link>
  <description><![CDATA[ 




<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>Software engineering is different from programming because it focuses on more than just writing code. It considers time, scale, and the decisions involved in maintaining software. While a program might only need to work temporarily, software engineering focuses on creating systems that can continue to work and adapt over time. Sustainability is an important part of software engineering. Software should be able to change when technology, security issues, or user needs change. Engineers must also consider teamwork, organization, and maintaining projects as they grow.</p>
</section>
<section id="further-explorations" class="level2">
<h2 class="anchored" data-anchor-id="further-explorations">Further Explorations</h2>
<p>The reading introduces Hyrum’s Law, which explains that users may depend on behaviors in a system even if those behaviors were never officially promised. Because of this, even small changes can unexpectedly cause problems. The reading also highlights the difference between code that simply works and code that is maintainable. Good software engineering requires developers to think about how their code may need to change in the future.</p>
<section id="time-and-change" class="level3">
<h3 class="anchored" data-anchor-id="time-and-change">Time and Change</h3>
<p>Time plays a major role in software engineering. Short programs may only be used once, but long-term projects need regular updates and maintenance. As technology changes, software must be able to adapt. Instead of avoiding changes because they are difficult, engineers should design software in a way that makes future updates easier. Sustainable software is not software that never changes, but software that can change when needed. <a href="https://abseil.io/resources/swe-book/html/images/seag_0101.png">See the graph showing how software changes over time</a></p>
</section>
<section id="scale-and-efficiency" class="level3">
<h3 class="anchored" data-anchor-id="scale-and-efficiency">Scale and Efficiency</h3>
<p>The first main topic is about how software and engineering processes should work when a company, team, or codebase becomes much bigger. A system is not really scalable if every time the project grows, engineers have to spend much more time and effort doing the same tasks. Software should scale not only in terms of memory, storage, or computing power, but also in terms of human work. One important example is software updates. If every team has to update their code manually every time something changes, this can work in a small company, but it becomes a serious problem in a large organization. Google found that it is better when expert infrastructure teams manage these changes or automate them. This way, the same problem does not have to be solved separately by many different teams. Automation and testing are also very important. Google uses the “Beyoncé Rule,” which means that if a team depends on some software behavior, they should have a CI test for it. Infrastructure engineers cannot manually contact hundreds of teams every time they make a change, so automated tests make the process much more scalable.</p>
<p>The compiler upgrade example shows another important lesson about scalability and long-term maintenance. Google once waited around five years before upgrading its compiler, and the upgrade became very difficult. After that, they started upgrading more regularly. Engineers gained experience, the code became less dependent on old behavior, and parts of the process could be automated. Another important idea is “shifting left.” It means finding problems earlier in the development process. A bug found during coding or testing is usually much cheaper to fix than a bug found after the software is already in production. As shown in Figure 1-2, detecting problems earlier in the timeline usually makes them cheaper and easier to fix.</p>
<div id="fig-shift-left" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-shift-left-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://www.developerdevelopment.com/blog/se2-fall2026/images/shift-left.png" class="img-fluid figure-img" style="width:90.0%">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-shift-left-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Figure 1-2. Timeline of the developer workflow
</figcaption>
</figure>
</div>
</section>
<section id="trade-offs-and-costs" class="level3">
<h3 class="anchored" data-anchor-id="trade-offs-and-costs">Trade-offs and Costs</h3>
<p>The second main topic is about how engineers make decisions. In software engineering, there is usually no perfect choice, because different solutions have different advantages and disadvantages. Engineers need to compare these options and think about their costs. Cost does not only mean money. It can also include computing resources, engineer time, effort, opportunity cost, and even the possible effect of software on society. For example, Google talks about whiteboard markers. Buying many markers costs some money, but making employees waste time looking for working markers could cost even more. The same idea applies to software. Sometimes it is better to spend more money on better tools or computing resources if this saves engineers a lot of time.</p>
<p>Some costs are easy to measure, such as CPU usage, RAM, or money, while others are much harder to measure. For example, it can be difficult to calculate the quality of an API or the social impact of a product. Even if something cannot be measured exactly, engineers should still consider it when making decisions. Good decisions also should not be treated as permanent. New information can appear, situations can change, and a choice that seemed good before may no longer be the best one. Because of this, engineers should use evidence when making decisions, but they should also be ready to change their minds, review old decisions, and learn from mistakes.</p>
</section>
</section>
<section id="takeaways" class="level2">
<h2 class="anchored" data-anchor-id="takeaways">Takeaways</h2>
<p>Looking back at everything covered in this reading it becomes clear that software engineering is not a more advanced or more technical version of programming. It is a different kind of problem entirely because programming is about writing code that works now and software engineering is about writing code that keeps working and keeps making sense and keeps being useful as time passes as the team grows and as the world around the code changes.</p>
<p>The reading shows that engineers can never fully control how their code will be used so they have to expect that even small changes might break something for somebody. Scale shows that solutions which work for a team can completely fall apart once a company grows, which is why automation, testing and shared expertise matter so much. Trade-offs show that there is rarely one answer in software engineering. Instead engineers have to weigh costs whether that is money, time, effort or even the impact on users and society and be willing to revisit decisions if the situation changes.</p>
<p>In the end, the reading makes the case that good software engineering’s not about avoiding change. It is about being ready for it. Sustainable software is software that can adapt when it needs to and sustainable engineering teams are the ones who plan for that of being caught off guard by it. That is really the heart of the difference, between programming and software engineering.</p>
<p><strong>Why should engineers not think about cost only as money?</strong></p>
<details>
<summary>
Click to Expand for categories the book referenced
</summary>
<p>Because engineering cost includes more than just money. It can also include engineer time, computing resources, effort, opportunity cost, and the possible impact on users or society. A solution that looks cheaper in dollars might actually cost more if it wastes a lot of time or creates more work later.</p>
</details>
<p><strong>Why can a process that works for a small software team fail when the organization becomes much larger?</strong></p>
<details>
<summary>
Click to Expand
</summary>
<p>A process may work for a small team because only a few people need to perform it. But as the organization grows, repeating the same manual task across many teams can require too much time and effort. Software engineering tries to make these processes scalable through automation, testing, and shared tools so that the amount of work does not grow too quickly with the size of the organization.</p>
</details>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our team built <code>ScaleSense</code>, a scaling review tool. You can view the project here: <a href="https://github.com/loganbutler01/ScaleSense">ScaleSense on GitHub</a>.</p>
</div>
</div>
</div>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>professional development</category>
  <category>software engineering</category>
  <guid>https://www.developerdevelopment.com/blog/se2-fall2026/</guid>
  <pubDate>Wed, 09 Sep 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Software Engineering Beyond Programming</title>
  <dc:creator>Dylan Headley</dc:creator>
  <dc:creator>V Rieger</dc:creator>
  <dc:creator>Ritesh Ojha</dc:creator>
  <dc:creator>Anshu Pathak</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/se1-fall2026/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This blog post discusses the <a href="https://abseil.io/resources/swe-book/html/pr01.html">“Preface”</a> in the <a href="https://abseil.io/resources/swe-book">Software Engineering at Google book</a>!</p>
<p>The preface of <em>Software Engineering at Google</em> introduces two fundamental questions from which we derive our course name, “CMPSC 203: Software Engineering.”</p>
<p>The first distinguishes the difference between programming and software engineering as disciplines. The authors argue that software engineering is more than simply writing code; <strong>it includes the tools and processes an organization uses to build and maintain software over time.</strong> The central idea of the preface is that software engineering can be viewed as <strong>“programming integrated over time.”</strong> Software must be able to adapt to changing requirements, continue to be maintained, and remain valuable throughout its life cycle.</p>
<p>The second aims to emphasize the difference in rigor between software engineering and more traditional engineering roles. Where mechanical and civic engineers build something physical, it is more often than not that software is regarded with less real-world consequence. But in the age of artificial intelligence and growing concerns of cybersecurity, <em>Software Engineering at Google</em> believes that we as software engineers should strive to match the rigor of other fields.</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p><em>Software Engineering at Google</em> uses its preface to make its fundamental perspective on the discipline of software engineering clear: “as software becomes more integrated into our lives, we must adopt and rely on more rigorous engineering methods.” But what do the authors mean by this?</p>
<p>The difference between “programming” and “software engineering” is intent. Software engineering is the integration of programming over time because it relies on the intent of <strong>sustainability</strong>, as well as more <strong>rigorous</strong> methods to ensure the health of the project.</p>
<section id="disciplinary-rigor-engineering-for-sustainability" class="level3">
<h3 class="anchored" data-anchor-id="disciplinary-rigor-engineering-for-sustainability">Disciplinary Rigor &amp; Engineering for Sustainability</h3>
<p>This book is dedicated to teaching software engineers how to think more rigorously like other engineering disciplines to build something that is effective, and which lasts.</p>
<p>There are three pairs of indicators that reveal the needs of a project to remain sustainable.</p>
<ul>
<li><em>Time and Change</em>: How will the <strong>codebase</strong> need to adapt to remain <strong>relevant and healthy</strong>?</li>
<li><em>Scale and Growth</em>: How will the <strong>organization</strong> responsible for the codebase need to adapt as it <strong>evolves</strong>?</li>
<li><em>Trade-offs and Costs</em>: How will the <strong>organization</strong> use the metrics of <em>Time and Change</em> and <em>Scale and Growth</em> to inform their engineering decisions?</li>
</ul>
</section>
<section id="googles-software-engineering-landscape" class="level3">
<h3 class="anchored" data-anchor-id="googles-software-engineering-landscape">Google’s Software Engineering Landscape</h3>
<p>Google focuses growth and sustainability in software engineering. They break this concept into three main points.</p>
<ul>
<li><h4 id="culture" class="anchored">Culture</h4></li>
</ul>
<p>How software is developed through teamwork and how this allows for growth. Some chapters in this section are “How to Work on Teams”, “Knowledge Sharing”, “Leading at Scale”, and “Measuring Engineering Productivity”. This section emphasizes the importance of working together to solve problems. Bringing different perspectives to the table can allow for better solutions and a more productive and healthier work environment.</p>
<ul>
<li><h4 id="processes" class="anchored">Processes</h4></li>
</ul>
<p>How Google has developed best practices for software engineers. They point out having an informed perspective due to Google’s large size. The chapter names include “Style Guides and Rules”, “Documentation”, “Testing Overview”, and “Deprecation”. This touches upon all different aspects of software engineering, from planning and creation to testing and deprecation.</p>
<ul>
<li><h4 id="tools" class="anchored">Tools</h4></li>
</ul>
<p>How to use tools to your advantage, whether they be your own or open source options. Some chapter names are “Version Control and Branch Management”, “Code Search”, “Dependency Management”, and “Large-Scale Changes”. Using a combination of your own tools and ones that already exist can be helpful in getting the wanted outcome by tailoring your tools to your needs but also not making extra work for yourself.</p>
</section>
<section id="what-this-book-isnt" class="level3">
<h3 class="anchored" data-anchor-id="what-this-book-isnt">What this book isn’t ?</h3>
<p>The authors made it very clear what their intentions with <em>Software Engineering at Google</em> were, but they also made it clear what they were <strong>not</strong>. This book is not:</p>
<ul>
<li>a guide to software design</li>
<li>a comprehensive treatment of all the practical concerns that shape modern software development</li>
</ul>
<p>As a result, it leaves out many important topics such as project management, API design, security hardening, internationalization, user interface frameworks, and other language-specific concerns. These omissions are not a statement that these issues are unimportant; rather, they reflect the book’s deliberate choice to focus on software engineering as a discipline rather than trying to cover every aspect of software development in depth.</p>
</section>
</section>
<section id="reflection" class="level2">
<h2 class="anchored" data-anchor-id="reflection">Reflection</h2>
<p>This distinction between programming and software engineering becomes concrete when we think about the kinds of tools teams need to maintain software over time. Our CLI tool reflects the Preface’s central idea that software engineering is not just writing code, but managing a system over time. By checking which dependencies are outdated and which versions are newer, the tool emphasizes the importance of continuous maintenance and adaptation.</p>
<p>In a real project, dependencies change constantly, and failing to notice those updates can leave software vulnerable, inefficient, or incompatible with newer tools. Similarly, scanning for missing docstrings adds a more rigorous form of quality control. Documentation is not only for readability; it helps future developers understand the purpose and behavior of code, especially as a team and codebase grow.</p>
<p>This is a stronger example of software engineering because it goes beyond “does the code run?” and instead asks whether the project is healthy, maintainable, and sustainable. By surfacing outdated packages, missing docstrings, and other maintenance issues, the tool makes project quality visible in a concrete and actionable way. It supports the Preface’s themes of Time and Change and Scale and Growth by showing that as projects expand, engineers need systematic ways to track complexity, change, and long-term health. In this way, <code>bumpd</code> is not simply a convenience tool; it reflects the disciplined, evidence-based thinking that distinguishes programming from software engineering.</p>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Open-Source Tool for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Open-Source Tool for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our team built <code>bumpd</code>, a command-line dependency and maintenance audit tool. You can view the project here: <a href="https://github.com/pathakanshu/bumpd">bumpd on GitHub</a>.</p>
</div>
</div>
</div>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>professional development</category>
  <category>software engineering</category>
  <guid>https://www.developerdevelopment.com/blog/se1-fall2026/</guid>
  <pubDate>Mon, 31 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Introduction to Software Testing</title>
  <dc:creator>Kathryn Boidock</dc:creator>
  <dc:creator>Kaitlyn Walker</dc:creator>
  <dc:creator>Aidana Kuat</dc:creator>
  <dc:creator>Eyra Co</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/fb1-fall2026/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This chapter introduces the basic ideas of software testing and explains why testing is important in software development. It uses Python examples like square root function, to show how programmers can test their code and find their errors.</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<section id="simple-testing" class="level3">
<h3 class="anchored" data-anchor-id="simple-testing">Simple Testing</h3>
<p>Software testing involves running a program with different inputs and checking whether the results are correct. The chapter uses a <code>my_sqrt()</code> function to show how testing can help determine if a program works as expected. Testing is important because a program may work correctly for some inputs but still have problems with others.</p>
<ul>
<li>Test a function with different inputs to check its results.</li>
<li>Use debugging tools, such as <code>print()</code> statements, to understand what the program is doing.</li>
<li>Check the output against what is expected to make sure the function is correct.</li>
</ul>
<p>Testing the <code>my_sqrt()</code> function with different values helps us find out if it actually calculates square roots correctly.</p>
</section>
<section id="understanding-python-programs" class="level3">
<h3 class="anchored" data-anchor-id="understanding-python-programs">Understanding Python Programs</h3>
<p>Before testing Python code, it is important to understand the basic parts of the program:</p>
<ul>
<li>Python uses indentation to organize code blocks.</li>
<li>Python is dynamically typed, so variable types are determined while the program runs.</li>
<li>Python uses common programming features such as loops, assignments, and comparisons.</li>
</ul>
<p>Understanding how the code works makes it easier to test the program and find problems when the results are not what we expect.</p>
</section>
<section id="test-automation" class="level3">
<h3 class="anchored" data-anchor-id="test-automation">Test Automation</h3>
<p>Automating tests makes it so we don’t have to constantly do manual checks of our code and let the computer do all the work of testing for us. To do this we use the assert statement which takes any condition you give it and if the condition is true nothing will happen however if the condition is false assert will raise an exception letting you know that the test failed.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> my_sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span></code></pre></div></div>
<p>Executing this line of code would produce no result this lets us know that the condition is true.</p>
<p>Its important to also handle floating-point computations because of the rounding errors that they have to do this you will want to use an Epsilon value that you will have to call. Epsilon is a constant so you have to apply your own value to it. Epsilon will keep the values below a certain value to ensure equality between iterations.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1">Epsilon <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span></span></code></pre></div></div>
</section>
<section id="run-time-verification" class="level3">
<h3 class="anchored" data-anchor-id="run-time-verification">Run-Time Verification</h3>
<p>There are many different ways to manually verify a program, but a more effective approach is to integrate the verification process into the program itself. Implementing an automatic run-time check will ensure that for every computation, the result is verified against the expected outcome.</p>
<p>Uses of Run-Time Verification:</p>
<ul>
<li><p><strong>Performance Monitoring</strong>: Run-time verification can be used to monitor the performance of a program during execution, ensuring that it meets the required performance criteria. It also gives developers the immediate feedback they need to make adjustments to the program as necessary.</p></li>
<li><p><strong>Security</strong>: Run-time verification can help detect security vulnerabilities in a program by checking for unexpected behavior or unauthorized access during execution. It will stop a program from running if it detects any security issues, preventing potential exploits.</p></li>
</ul>
<p>You may have to be careful of the assumptions that you make about the program’s behavior, as run-time verification can only check for conditions that are explicitly defined. If a condition is not defined, it may not be checked, leading to potential errors or vulnerabilities being missed. Keep in mind of the cost that run-time verification can introduce, as it may slow down the execution of the program.</p>
</section>
<section id="question-which-of-the-following-is-a-benefit-of-run-time-verification" class="level3">
<h3 class="anchored" data-anchor-id="question-which-of-the-following-is-a-benefit-of-run-time-verification">Question: Which of the following is a benefit of run-time verification?</h3>
<ul class="task-list">
<li><label><input type="checkbox">It reduces the complexity of the program.</label></li>
<li><label><input type="checkbox">It can detect security vulnerabilities during execution.</label></li>
<li><label><input type="checkbox">It eliminates the need for testing.</label></li>
<li><label><input type="checkbox">It guarantees that the program will run without errors.</label></li>
</ul>
<details>
<summary>
Click to Expand for the Answer
</summary>
<p><strong>Answer!</strong> It can detect security vulnerabilities during execution.</p>
</details>
</section>
<section id="system-input-versus-function-input" class="level3">
<h3 class="anchored" data-anchor-id="system-input-versus-function-input">System Input versus Function Input</h3>
<p>To begin with, it is important to understand the difference between function input and system input. Function input is the data that a function receives from another part of a program, where usually programmers know the function’s aim and its requirements. For example, <code>my_sqrt(x)</code> is designed to work with non-negative numbers, so giving it a negative number would not follow the function’s preconditions. System input comes from outside of a program, for example from a user, another file, a network, an API, and so on. It is not as safe or predictable as function input. Therefore, a program that work with system input should have input validation and error handling. A function usually has preconditions, and a system interface cannot assume that external users will follow them.</p>
<p>In the example from <em>The Fuzzing Book</em>, the function <code>my_sqrt()</code> is used inside another program called <code>sqrt_program()</code>. This program accepts a string as external input and then converts it into an integer:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sqrt_program(arg: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb3-2">   x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(arg)</span>
<span id="cb3-3">   <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'The root of'</span>, x, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'is'</span>, my_sqrt(x))</span></code></pre></div></div>
<p>If the user gives a normal input such as <code>"4"</code>, the program works as expected:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1">sqrt_program(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>)</span></code></pre></div></div>
<p>and gives:</p>
<pre class="text"><code>The root of 4 is 2.0</code></pre>
<p>However, the problem appears when the user gives an input that the function was not ready to work with. For example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1">sqrt_program(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-1"</span>)</span></code></pre></div></div>
<p>Our original <code>my_sqrt()</code> function does not properly handle negative numbers, and because of that it enters an infinite loop. To prevent this, the program can check the value before calling <code>my_sqrt()</code>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sqrt_program(arg: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb7-2">   x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(arg)</span>
<span id="cb7-3">   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb7-4">       <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Illegal Input"</span>)</span>
<span id="cb7-5">   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb7-6">       <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'The root of'</span>, x, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'is'</span>, my_sqrt(x))</span></code></pre></div></div>
<p>Now, if the user enters:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1">sqrt_program(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-1"</span>)</span></code></pre></div></div>
<p>the program responds with:</p>
<pre class="text"><code>Illegal Input</code></pre>
<p>instead of sending the negative number to <code>my_sqrt()</code>. However, this still does not solve every possible problem. For example, a user can also enter something like:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1">sqrt_program(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xyzzy"</span>)</span></code></pre></div></div>
<p>The line:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1">x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(arg)</span></code></pre></div></div>
<p>tries to convert <code>"xyzzy"</code> into an integer, which is impossible, so Python raises a <code>ValueError</code>. To avoid crashes, the program can use <code>try</code> and <code>except</code>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sqrt_program(arg: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb12-2">   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb12-3">       x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(arg)</span>
<span id="cb12-4">   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>:</span>
<span id="cb12-5">       <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Illegal Input"</span>)</span>
<span id="cb12-6">   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb12-7">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb12-8">           <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Illegal Number"</span>)</span>
<span id="cb12-9">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb12-10">           <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'The root of'</span>, x, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'is'</span>, my_sqrt(x))</span></code></pre></div></div>
<p>Now the program can handle several different types of inputs:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1">sqrt_program(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>)</span></code></pre></div></div>
<p>produces:</p>
<pre class="text"><code>The root of 4.0 is 2.0</code></pre>
<p>while:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1">sqrt_program(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-1"</span>)</span></code></pre></div></div>
<p>produces:</p>
<pre class="text"><code>Illegal Number</code></pre>
<p>and:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1">sqrt_program(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xyzzy"</span>)</span></code></pre></div></div>
<p>produces:</p>
<pre class="text"><code>Illegal Input</code></pre>
<p>Programs that receive system input need to be prepared for unexpected values. The programmer cannot just assume that every user will enter the correct type of data. Since a system should be able to handle many different kinds of input without crashing or entering an uncontrolled state, we, as a software engineers, can intentionally send unusual or incorrect inputs to the program and see what happens. For instance, trying negative numbers as shows above, text instead of numbers, empty strings, or very large values and so on. The goal is to find inputs that can crash/break the program and then fix them. With function input, however, we usually need to know the function’s preconditions before generating test values for it.</p>
</section>
<section id="limits-of-testing" class="level3">
<h3 class="anchored" data-anchor-id="limits-of-testing">Limits of Testing</h3>
<p>Testing can find many bugs, but it cannot guarantee that a program is completely free of errors. There are too many possible inputs to test every single one.</p>
<ul>
<li>Random testing may miss unusual or important inputs.</li>
<li>Some bugs only happen with specific values or conditions.</li>
<li>Run-time checks cannot guarantee that a program will always reach the result being checked.</li>
</ul>
<p>For example, the <code>my_sqrt()</code> function can fail when given <code>0</code>, even though it may work correctly with many other values.</p>
<p>Because of these limitations, programmers should use different types of tests and carefully choose inputs that could cause problems. Testing increases confidence in software, but it does not prove that the program is perfect.</p>
</section>
</section>
<section id="quiz-check" class="level2">
<h2 class="anchored" data-anchor-id="quiz-check">Quiz Check</h2>
<section id="q1.-which-of-the-following-additions-to-the-code-will-fix-this-error" class="level3">
<h3 class="anchored" data-anchor-id="q1.-which-of-the-following-additions-to-the-code-will-fix-this-error">Q1. Which of the following additions to the code will fix this error?</h3>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1">...</span>
<span id="cb19-2">   <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> my_sqrt(x):</span>
<span id="cb19-3">       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Computes the square root of x, using the Newton-Raphson method"""</span></span>
<span id="cb19-4">       approx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb19-5">       guess <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb19-6">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">while</span> approx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> guess:</span>
<span id="cb19-7">           approx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> guess</span>
<span id="cb19-8">           guess <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (approx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> approx) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb19-9">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> approx</span>
<span id="cb19-10"></span>
<span id="cb19-11"></span>
<span id="cb19-12">   <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sqrt_program(arg: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb19-13">       x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(arg)</span>
<span id="cb19-14">       <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'The root of'</span>, x, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'is'</span>, my_sqrt(x))</span></code></pre></div></div>
<pre class="text"><code>Traceback (most recent call last):
 File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_1231/1288144681.py", line 2, in &lt;module&gt;
   sqrt_program("-1")
 File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_1231/449782637.py", line 3, in sqrt_program
   print('The root of', x, 'is', my_sqrt(x))
                                 ^^^^^^^^^^
 File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_1231/2661069967.py", line 5, in my_sqrt
   while approx != guess:
         ^^^^^^^^^^^^^^^
 File "Timeout.ipynb", line 43, in timeout_handler
   raise TimeoutError()
TimeoutError (expected)</code></pre>
<details>
<summary>
Click to Expand for the Answer
</summary>
<p><strong>Answer!</strong></p>
<p>To fix the error in the <code>my_sqrt</code> function, you need to add a check for negative input values. The square root of a negative number is not defined in the realm of real numbers, and attempting to compute it will lead to an error. We can edit the <code>sqrt_program</code> function as follows:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1">...</span>
<span id="cb21-2">   <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sqrt_program(arg: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb21-3">       x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(arg)</span>
<span id="cb21-4">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb21-5">           <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Illegal Input"</span>)</span>
<span id="cb21-6">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb21-7">           <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'The root of'</span>, x, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'is'</span>, my_sqrt(x))</span></code></pre></div></div>
</details>
</section>
<section id="q1.5-which-of-the-following-will-fix-a-string-input-error-in-the-sqrt_program-function" class="level3">
<h3 class="anchored" data-anchor-id="q1.5-which-of-the-following-will-fix-a-string-input-error-in-the-sqrt_program-function">Q1.5: Which of the following will fix a string input error in the <code>sqrt_program</code> function?</h3>
<ul class="task-list">
<li><label><input type="checkbox">Add a try-except block to catch <code>TypeError</code> exceptions when converting</label></li>
<li><label><input type="checkbox">Add a try-except block to catch <code>ValueError</code> exceptions when converting</label></li>
<li><label><input type="checkbox">Add a try-except block to catch <code>ZeroDivisionError</code> exceptions when converting</label></li>
<li><label><input type="checkbox">Add a try-except block to catch <code>IndexError</code> exceptions when converting</label></li>
</ul>
<details>
<summary>
Click to Expand for the Answer
</summary>
<p><strong>Answer!</strong> Add a try-except block to catch <code>ValueError</code> exceptions when converting</p>
</details>
</section>
</section>
<section id="reflection" class="level2">
<h2 class="anchored" data-anchor-id="reflection">Reflection</h2>
<p>A few takeaways from this chapter include:</p>
<ul>
<li><p><strong>Test Different Inputs</strong>: Testing a program with different and unusual inputs can help find bugs that may not appear during normal use.</p></li>
<li><p><strong>Automate Testing</strong>: Using assertions and automatically generated tests makes testing faster and easier to repeat.</p></li>
<li><p><strong>Validate Input</strong>: Programs should use checks to validate external inputs and prevent errors and unexpected behavior.</p></li>
<li><p><strong>Understand the Limits</strong>: Testing can improve confidence in a program, but it cannot guarantee that every possible bug has been found.</p></li>
</ul>
<p>Software testing is an important part of development because it helps us find problems early and make our programs more reliable. As such, our software engineering team should make sure that we always write test cases for all of the functions in our code.</p>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Detection of failures for Software Engineers">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Detection of failures for Software Engineers
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Our team built <code>thetool</code>, a command-line tool to detect failures in code. You can view the project here: <a href="https://github.com/Aidana-Kuat/thetool">thetool on GitHub</a>.</p>
</div>
</div>
</div>
<!-- Include the license statement for the online book -->
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Reference">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-2-contents" aria-controls="callout-2" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Reference
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-2" class="callout-2-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Unless otherwise noted, the source code segments in this article are excerpted directly from the <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. The authors of this online book licensed the source code and its written content under the <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0 Creative Commons License</a>. More details about the license for the Fuzzing Book are available in the <a href="https://github.com/uds-se/fuzzingbook/blob/master/LICENSE.md">The Fuzzing Book License</a>.</p>
</div>
</div>
</div>
<!-- Include reference back to the listing of blog posts -->
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>software engineering</category>
  <category>fuzzing book</category>
  <guid>https://www.developerdevelopment.com/blog/fb1-fall2026/</guid>
  <pubDate>Sat, 29 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Reducing Failure-Inducing Inputs</title>
  <dc:creator>Philip Olwoc</dc:creator>
  <dc:creator>Hannah Brown</dc:creator>
  <dc:creator>Rebekah Rudd</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/fb9-fall2024/</link>
  <description><![CDATA[ 




<!-- TODO: None of the code segments in this article are actually executable -->
<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This article covers the <a href="https://www.fuzzingbook.org/html/Reducer.html">Reducing Failure-Inducing Inputs</a> chapter from <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. This chapter builds on the concepts from the <a href="https://www.fuzzingbook.org/html/Fuzzer.html">Fuzzing</a> and <a href="https://www.fuzzingbook.org/html/Grammars.html">Fuzzing With Grammars</a> chapters. Let’s get started and learn more about increasing the efficiency of fuzzed inputs and bug finding!</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>Taking failure-inducing input is a reducer which is reduced to a minimum that still give the failure. This article talks about “Reducer” classes that use reducers. Reduction helps us debug the failure so the instance where it happens can be found. There are manual ways to do this but for large and complex inputs a way to automate it will help reducing be faster.</p>
</section>
<section id="delta-debugging" class="level2">
<h2 class="anchored" data-anchor-id="delta-debugging">Delta Debugging</h2>
<p>Delta debugging uses fuzzing to find what fails and then takes the large input and reduces it to the part of the string that is failing. This decreases the inputs and helps the programmer know what is failing so that then they are able to find the bug more easily. The goal is to find failures in order to then find the reason why the code failed and how to fix the issue.</p>
<p>The chapter explains that “A reducer takes a failure-inducing input and reduces it to the minimum that still reproduces the failure.” This chapter shows the <code>Reducer</code> class which is implemented in the following way:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> Reducer:</span>
<span id="cb1-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Base class for reducers."""</span></span>
<span id="cb1-3"></span>
<span id="cb1-4">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, runner: Runner, log_test: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-5">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Attach reducer to the given `runner`"""</span></span>
<span id="cb1-6">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.runner <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> runner</span>
<span id="cb1-7">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.log_test <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> log_test</span>
<span id="cb1-8">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.reset()</span>
<span id="cb1-9"></span>
<span id="cb1-10">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> reset(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-11">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Reset the test counter to zero. To be extended in subclasses."""</span></span>
<span id="cb1-12">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.tests <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb1-13"></span>
<span id="cb1-14">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> test(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, inp: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> Outcome:</span>
<span id="cb1-15">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Test with input `inp`. Return outcome.</span></span>
<span id="cb1-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        To be extended in subclasses."""</span></span>
<span id="cb1-17"></span>
<span id="cb1-18">        result, outcome <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.runner.run(inp)</span>
<span id="cb1-19">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.tests <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb1-20">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.log_test:</span>
<span id="cb1-21">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Test #</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%d</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.tests, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">repr</span>(inp), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">repr</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(inp)), outcome)</span>
<span id="cb1-22">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> outcome</span>
<span id="cb1-23"></span>
<span id="cb1-24">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">reduce</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, inp: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>:</span>
<span id="cb1-25">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Reduce input `inp`. Return reduced input.</span></span>
<span id="cb1-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        To be defined in subclasses."""</span></span>
<span id="cb1-27"></span>
<span id="cb1-28">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.reset()</span>
<span id="cb1-29">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Default: Don't reduce</span></span>
<span id="cb1-30">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> inp</span></code></pre></div></div>
<p>Manual reduction input has to do with manually testing and iterating through the code in order to find the bug; where as delta debugging automates this process of testing in order to find the failures.</p>
<p>Delta debugging first tests the first half of the code to see if it fails. If it passes it will then test the second half of the string. If that also passes the delta debugger will iterate through different combinations of the string quarters. The size of the string that the delta debugger tests gets smaller and smaller until there are only one or two characters left. But this can be confusing so lets walk through an example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1">dd_reducer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DeltaDebuggingReducer(mystery, log_test<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb2-2">dd_reducer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">reduce</span>(failing_input)</span></code></pre></div></div>
<pre class="text"><code>Round 1 (1/2):
Test #1 ' 7:,&gt;((/$$-/-&gt;.;.=;(.%!:50#7*8=$&amp;&amp;=$9!%6(4=&amp;69\':\'&lt;3+0-3.24#7=!&amp;60)2/+";+&lt;7+1&lt;2!4$&gt;92+$1&lt;(3%&amp;5\'\'&gt;#' 97 FAIL
Test #2 '\'&lt;3+0-3.24#7=!&amp;60)2/+";+&lt;7+1&lt;2!4$&gt;92+$1&lt;(3%&amp;5\'\'&gt;#' 49 PASS
Test #3 " 7:,&gt;((/$$-/-&gt;.;.=;(.%!:50#7*8=$&amp;&amp;=$9!%6(4=&amp;69':" 48 PASS

Round 2 (1/4): 
Test #4 '50#7*8=$&amp;&amp;=$9!%6(4=&amp;69\':\'&lt;3+0-3.24#7=!&amp;60)2/+";+&lt;7+1&lt;2!4$&gt;92+$1&lt;(3%&amp;5\'\'&gt;#' 73 FAIL
Test #5 "50#7*8=$&amp;&amp;=$9!%6(4=&amp;69':&lt;7+1&lt;2!4$&gt;92+$1&lt;(3%&amp;5''&gt;#" 49 PASS
Test #6 '50#7*8=$&amp;&amp;=$9!%6(4=&amp;69\':\'&lt;3+0-3.24#7=!&amp;60)2/+";+' 48 FAIL
Test #7 '\'&lt;3+0-3.24#7=!&amp;60)2/+";+' 24 PASS
Test #8 "50#7*8=$&amp;&amp;=$9!%6(4=&amp;69':" 24 PASS

Round 3 (1/8):
Test #9 '9!%6(4=&amp;69\':\'&lt;3+0-3.24#7=!&amp;60)2/+";+' 36 FAIL
Test #10 '9!%6(4=&amp;69\':=!&amp;60)2/+";+' 24 FAIL
Test #11 '=!&amp;60)2/+";+' 12 PASS
Test #12 "9!%6(4=&amp;69':" 12 PASS
Test #13 '=&amp;69\':=!&amp;60)2/+";+' 18 PASS
Test #14 '9!%6(4=!&amp;60)2/+";+' 18 FAIL
Test #15 '9!%6(42/+";+' 12 PASS
Test #16 '9!%6(4=!&amp;60)' 12 FAIL
Test #17 '=!&amp;60)' 6 PASS
Test #18 '9!%6(4' 6 PASS
Test #19 '6(4=!&amp;60)' 9 FAIL
Test #20 '6(460)' 6 FAIL
Test #21 '60)' 3 PASS
Test #22 '6(4' 3 PASS
Test #23 '(460)' 5 FAIL
Test #24 '460)' 4 PASS
Test #25 '(0)' 3 FAIL
Test #26 '0)' 2 PASS
Test #27 '(' 1 PASS
Test #28 '()' 2 FAIL
Test #29 ')' 1 PASS
'()'</code></pre>
<section id="benefits" class="level3">
<h3 class="anchored" data-anchor-id="benefits">Benefits</h3>
<p>First, one benefit of a delta debugger is that it “reduces the cognitive load of the programmer”. It makes it so the test cases can address one problem specifically rather than broad unavoidable problems. Second, it also makes the problem easier to communicate to others. And finally, reducing the failure-inducing input can make it more obvious to programmers if there are duplicates in their test cases.</p>
<p><strong>But is this effective?</strong></p>
<p>The best case for this is logarithmic Big O curve, while the worst case is an exponential Big O curve as pictured on the graph below. The worst chase situation happens when the program runs and the last character fails. If the last character fails the program will then return an AssertionError. The goal is for the last character to pass so that it is clear that the error resulted in the penultimate character. Here is a graph of these Big O notations:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.developerdevelopment.com/blog/fb9-fall2024/big0n_graph.gif" class="img-fluid figure-img"></p>
<figcaption>Big O(n) graph comparisons</figcaption>
</figure>
</div>
<p><a href="https://stackoverflow.com/questions/23329234/which-is-better-on-log-n-or-on2">Source for this graph about worst-case time complexity</a></p>
</section>
<section id="drawbacks" class="level3">
<h3 class="anchored" data-anchor-id="drawbacks">Drawbacks</h3>
<p>One issue is that with delta debugging is that it is prone to failure. This method is not always accurate. In addition, another issue is that it is not the most efficient method of determining the failing piece of code. Which leads us to the another method of iterating through the fuzzing produced string in order to find the piece of the string that is failing called Grammar-Based Reduction.</p>
</section>
</section>
<section id="grammar-based-reduction" class="level2">
<h2 class="anchored" data-anchor-id="grammar-based-reduction">Grammar Based Reduction</h2>
<p>Delta debugging may take multiple attempts at reduction, if the input language is syntactically complex.This is where Grammar-Based Reduction comes in, this approach uses grammars to simplify complex syntactic inputs.</p>
<section id="lexical-reduction-versus-syntactic-rules" class="level3">
<h3 class="anchored" data-anchor-id="lexical-reduction-versus-syntactic-rules">Lexical Reduction versus Syntactic Rules</h3>
<p>With Lexical Reduction, the input is broken down based on character, without taking into account the grammar rules. In the example below the string, <code>"1 + (2 * 3)"</code> is broken down many times into various versions of itself, but it doesn’t follow the same grammatical pattern.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1">expr_input <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1 + (2 * 3)"</span></span>
<span id="cb4-2">dd_reducer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DeltaDebuggingReducer(mystery, log_test<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb4-3">dd_reducer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">reduce</span>(expr_input)</span></code></pre></div></div>
<p>This is an issue because it produces many invalid invalid which in turn lead to meaningless invalid test cases.</p>
<p>On the other hand using syntactic rules allows you to produce valid inputs to parse so that your test cases are meaningful, since the inputs it produces still follow the intended grammatical pattern.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> EvalMysteryRunner(MysteryRunner):</span>
<span id="cb5-2">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb5-3">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.parser <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EarleyParser(EXPR_GRAMMAR)</span>
<span id="cb5-4"></span>
<span id="cb5-5">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> run(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, inp: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> Tuple[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, Outcome]:</span>
<span id="cb5-6">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb5-7">            tree, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.parser.parse(inp)</span>
<span id="cb5-8">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">SyntaxError</span>:</span>
<span id="cb5-9">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (inp, Runner.UNRESOLVED)</span>
<span id="cb5-10"></span>
<span id="cb5-11">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">super</span>().run(inp)</span>
<span id="cb5-12">eval_mystery <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EvalMysteryRunner()</span>
<span id="cb5-13"></span>
<span id="cb5-14">dd_reducer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DeltaDebuggingReducer(eval_mystery, log_test<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-15">dd_reducer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">reduce</span>(expr_input)</span></code></pre></div></div>
<p>In this example the inputs are either valid or unresolved allowing you to use the valid one in you test cases.</p>
</section>
<section id="a-grammar-based-reduction-approach" class="level3">
<h3 class="anchored" data-anchor-id="a-grammar-based-reduction-approach">A Grammar-Based Reduction Approach</h3>
<p>The grammar-based reduction approach simplifies complex inputs by operating on the structure of the input’s derivation tree, rather than just reducing the string. There are two key strategies: “Replacing the subtrees” and “Alternative Expansions”. Let’s investigate each of these strategies in more detail!</p>
<section id="replacing-the-subtrees" class="level4">
<h4 class="anchored" data-anchor-id="replacing-the-subtrees">Replacing the Subtrees</h4>
<p>Replacing the sub-trees means to take a larger part of the tree and replace it with a smaller part of the tree. In the example given it shows the original tree which makes up the string <code>"1 + (2 * 3)"</code> and then being broken down to <code>"(2 * 3)"</code> by replacing the upper most <code>&lt;expr&gt;</code> with the lowest <code>&lt;expr&gt;</code>.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> Grammars <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Grammar</span>
<span id="cb6-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> GrammarFuzzer <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> all_terminals, expansion_to_children, display_tree</span>
<span id="cb6-3">derivation_tree, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EarleyParser(EXPR_GRAMMAR).parse(expr_input)</span>
<span id="cb6-4">display_tree(derivation_tree)pyt</span></code></pre></div></div>
</section>
<section id="alternative-expansions" class="level4">
<h4 class="anchored" data-anchor-id="alternative-expansions">Alternative Expansions</h4>
<p>Using alternative expansions we would change how the term is expanded. In the example given in the book it took the non-terminal <code>&lt;term&gt; * &lt;factor&gt;</code> which would have given the output <code>(2 * 3)</code>, and broke it by altering how the term would expand, which is <code>&lt;term&gt; : := &lt;factor&gt;</code>. Therefore changing the grammatical rule of how <code>&lt;term&gt;</code> would expand.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> copy</span>
<span id="cb7-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> Grammars <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Grammar</span>
<span id="cb7-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> GrammarFuzzer <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> all_terminals, expansion_to_children, display_tree</span>
<span id="cb7-4">new_derivation_tree <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> copy.deepcopy(derivation_tree)</span>
<span id="cb7-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># We really should have some query language</span></span>
<span id="cb7-6">sub_expr_tree <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> new_derivation_tree[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb7-7">display_tree(sub_expr_tree)</span></code></pre></div></div>
</section>
<section id="a-depth-oriented-strategy" class="level4">
<h4 class="anchored" data-anchor-id="a-depth-oriented-strategy">A Depth-Oriented Strategy</h4>
<p>The log above after test <code>#2</code> is reduced to <code>"2 * 3"</code> for the input tree the <code>GrammarReducer</code> goes to replace the tree <code>"2"</code> and <code>"3"</code> being the alternate <code>&lt;term&gt;</code> subtrees. This can work but if there are many subtrees, it will take time trying all the subtrees possible.</p>
<p>Delta debugging is trying to split inputs in half trying to get to a minimum input. Having a tree be replaces with subtrees it could make a tree less important. However this may take sever tries. A good way to go about this is to look at large subtrees first. To locate large subtrees, we reduce the depth of the search for replacements. Looking at direct descendants first, then lower descendants.</p>
<p>The <code>depth</code> parameter in the <code>subtrees_with_symbol()</code> function, which is passed through the calling functions, controls this behavior. When set, it ensures that only symbols at the specified depth are returned. An example with derivation tree:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1">grammar_reducer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GrammarReducer(</span>
<span id="cb8-2">    mystery,</span>
<span id="cb8-3">    EarleyParser(EXPR_GRAMMAR),</span>
<span id="cb8-4">    log_reduce<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-5"></span>
<span id="cb8-6">all_terminals(derivation_tree)</span>
<span id="cb8-7"></span>
<span id="cb8-8">display_tree(derivation_tree)</span></code></pre></div></div>
<p>The <code>&lt;term&gt;</code> symbol is not here at depth of 1:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1">[all_terminals(t) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> grammar_reducer.subtrees_with_symbol(</span>
<span id="cb9-2">    derivation_tree, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;term&gt;"</span>, depth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span></code></pre></div></div>
<p>The <code>&lt;term&gt;</code> subtree is here at depth of 2 on the left hand side:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1">[all_terminals(t) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> grammar_reducer.subtrees_with_symbol(</span>
<span id="cb10-2">    derivation_tree, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;term&gt;"</span>, depth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)]</span></code></pre></div></div>
<p>The approach is to begin with a depth of 0 and increase it as we move forward:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> GrammarReducer(GrammarReducer):</span>
<span id="cb11-2">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> reduce_tree(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, tree):</span>
<span id="cb11-3">        depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb11-4">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">while</span> depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> max_height(tree):</span>
<span id="cb11-5">            reduced <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.reduce_subtree(tree, tree, depth)</span>
<span id="cb11-6">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> reduced:</span>
<span id="cb11-7">                depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Start with new tree</span></span>
<span id="cb11-8">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb11-9">                depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extend search for subtrees</span></span>
<span id="cb11-10">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> tree        </span>
<span id="cb11-11"></span>
<span id="cb11-12">grammar_reducer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GrammarReducer(</span>
<span id="cb11-13">    mystery,</span>
<span id="cb11-14">    EarleyParser(EXPR_GRAMMAR),</span>
<span id="cb11-15">    log_test<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb11-16">grammar_reducer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">reduce</span>(expr_input)</span></code></pre></div></div>
<!-- TODO: To do what? The answer does not give enough explanation. -->
<p><strong>Discussion Question: What does a depth-oriented strategy show?</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
It needs less steps
</details>
</section>
</section>
<section id="comparing-strategies" class="level3">
<h3 class="anchored" data-anchor-id="comparing-strategies">Comparing Strategies</h3>
<p>There are some differences between text-based delta debugging and grammar-based reduction. Building a long expression:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> GrammarFuzzer <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> GrammarFuzzer</span>
<span id="cb12-2"></span>
<span id="cb12-3">long_expr_input <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GrammarFuzzer(EXPR_GRAMMAR, min_nonterminals<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>).fuzz()</span>
<span id="cb12-4">long_expr_input</span></code></pre></div></div>
<p>For grammars a couple of tests are needed to find the failure-inducing input:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> Timer <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Timer</span>
<span id="cb13-2"></span>
<span id="cb13-3">grammar_reducer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GrammarReducer(eval_mystery, EarleyParser(EXPR_GRAMMAR))</span>
<span id="cb13-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> Timer() <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> grammar_time:</span>
<span id="cb13-5">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(grammar_reducer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">reduce</span>(long_expr_input))</span>
<span id="cb13-6"></span>
<span id="cb13-7">grammar_reducer.tests</span>
<span id="cb13-8"></span>
<span id="cb13-9">grammar_time.elapsed_time()</span></code></pre></div></div>
<p>However, with delta debugging it takes more tests and the reduction is not as good compared to grammar-based reducer.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1">dd_reducer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DeltaDebuggingReducer(eval_mystery)</span>
<span id="cb14-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> Timer() <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> dd_time:</span>
<span id="cb14-3">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(dd_reducer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">reduce</span>(long_expr_input))</span>
<span id="cb14-4"></span>
<span id="cb14-5">dd_reducer.tests</span>
<span id="cb14-6"></span>
<span id="cb14-7">dd_time.elapsed_time()</span></code></pre></div></div>
<p>A grammar to reduce inputs better to use if an input is syntactically complex.</p>
</section>
</section>
<section id="conclusion" class="level2">
<h2 class="anchored" data-anchor-id="conclusion">Conclusion</h2>
<p>This article talked about reducing inputs down to the smallest piece that is breaking or hindering the code. This has many really world applications. Can you think of any real world uses for delta debugging?</p>
<!-- Include the license statement for the online book -->
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Reference">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Reference
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Unless otherwise noted, the source code segments in this article are excerpted directly from the <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. The authors of this online book licensed the source code and its written content under the <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0 Creative Commons License</a>. More details about the license for the Fuzzing Book are available in the <a href="https://github.com/uds-se/fuzzingbook/blob/master/LICENSE.md">The Fuzzing Book License</a>.</p>
</div>
</div>
</div>
<!-- Include reference back to the listing of blog posts -->
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>software engineering</category>
  <category>fuzzing book</category>
  <guid>https://www.developerdevelopment.com/blog/fb9-fall2024/</guid>
  <pubDate>Wed, 04 Dec 2024 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Code Review</title>
  <dc:creator>Hannah Brown</dc:creator>
  <dc:creator>Philip Olwoc</dc:creator>
  <dc:creator>Rebekah Rudd</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/se9-fall2024/</link>
  <description><![CDATA[ 




<section id="overview-summary" class="level2">
<h2 class="anchored" data-anchor-id="overview-summary">Overview &amp; Summary</h2>
<p>This blog post discusses the <a href="https://abseil.io/resources/swe-book/html/ch09.html">Code Review</a> chapter in the <a href="https://abseil.io/resources/swe-book">Software Engineering at Google book</a>. This chapter discusses the best practice of having someone besides the author of the code review the code before it is added to a code base. This chapter introduces Google’s process and overviews the required steps that must be taken before any change to the code base is added.</p>
</section>
<section id="introduction" class="level2">
<h2 class="anchored" data-anchor-id="introduction">Introduction</h2>
<p>There are many strategies that different companies have employed when it comes to code review, from “gate-keeping” to having certain teams responsible for different aspects of the process. Beyond these, this chapter considers the many benefits of code review from debugging to knowledge sharing. There are even psychological benefits discussed.</p>
<section id="code-review-flow" class="level3">
<h3 class="anchored" data-anchor-id="code-review-flow">Code Review Flow</h3>
<p>When code reviews take place they can happen at many different stages of development. When a change is looked over before added to a code base that is called a “precommit review”. Sometimes, the reviewer of the code will give the “looks good to me” (LGTM) to the developer. This is a signal that the code is ready to be added to the code base.</p>
<!-- **What does LGTM mean and how is it used at Google?** -->
<p><strong>How do these steps of the typical code review process at Google translate to our own course projects?</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<ol type="1">
<li>A developer makes changes to the code base.</li>
<li>Once the creator is done with the change they will send it or share it with a colleague.</li>
<li>Reviewer(s) of the code make comments and change requests to the new code.</li>
<li>The change maker will make any required changes.</li>
<li>The reviewer(s) give a “looks good to me” (LGTM).</li>
<li>After the change is approved the change is added to the code base.</li>
</ol>
</details>
</section>
<section id="code-is-a-liability" class="level3">
<h3 class="anchored" data-anchor-id="code-is-a-liability">Code is a Liability</h3>
<p>An important takeaway from this introduction section is that code is always a liability. This chapter compares the importance of code to fuel in an airplane. Just like an airplane needs fuel to fly so programs need code to function. However the airplane’s fuel must be bought, has weight, must be cared for, and other inconveniences. This is similar to how code must be tested and maintained and could introduce bugs to a system but it is often worth the risk because our programs would not work without code.</p>
<p><strong>What are some reasons that code is considered a liability?</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<ul>
<li>it can add bugs to the programs</li>
<li>any code added must be maintained</li>
</ul>
</details>
</section>
</section>
<section id="how-code-review-works-at-google-and-the-benefits-of-code-review" class="level2">
<h2 class="anchored" data-anchor-id="how-code-review-works-at-google-and-the-benefits-of-code-review">How Code Review Works at Google and the Benefits of Code Review</h2>
<section id="code-correctness" class="level3">
<h3 class="anchored" data-anchor-id="code-correctness">Code Correctness</h3>
<p>Code review is a crucial process that ensures the correctness of code changes by assessing their testing, design, and efficiency. It helps catch potential bugs before they are introduced into the codebase, saving time and resources in debugging and regression testing. Human code reviews are vital for catching nuanced issues and aligning with a “shift left” strategy. At Google, the primary value of code review extends beyond correctness, focusing on ensuring code is understandable, maintainable, and scalable over time. This broader focus emphasizes that code reviews are not just about perfection; they are essential for building sustainable, high-quality software.</p>
</section>
<section id="code-comprehension" class="level3">
<h3 class="anchored" data-anchor-id="code-comprehension">Code Comprehension</h3>
<p>Code review is a crucial process that allows an unbiased evaluation of a code change, ensuring its long-term maintainability and comprehension. It is essential for organizations like Google, where the code is often read and maintained more than it is written. The primary goals of code review are to verify correctness and ensure comprehension, which form the basis for an “LGTM” or “Looks Good To Me” approval. However, additional approvals may be required to confirm that the code aligns with long-term sustainability goals, ensuring it can be effectively maintained as the codebase evolves.</p>
<p>Involving a reviewer who may later maintain or use the code is beneficial as their perspective can identify potential issues with clarity and usability. Questions raised during the review should be treated as valid feedback, prompting better explanations or revisions to improve understanding, even if the core logic remains unchanged. This emphasizes the importance of code review as a collaborative and future-focused practice.</p>
</section>
<section id="code-consistency" class="level3">
<h3 class="anchored" data-anchor-id="code-consistency">Code Consistency</h3>
<p>As software scales, maintainability of code is crucial as it will be read, understood, and refactored by others long after the original author has moved on to a new project. Code should conform to consistent standards and avoid unnecessary complexity, making it easier to comprehend and maintain. Google separates LGTM (correctness and comprehension) approval from specialized readability approval, granted by engineers trained in language-specific best practices. Readability reviewers ensure code aligns with language standards, avoids complexity, and maintains consistency with the rest of the codebase. Consistency enhances the code review process, allowing engineers to focus on correctness and comprehension without being hindered by inconsistent practices, ensuring code is robust and maintainable for the long term.</p>
<!-- NOTE: There were two paragraphs that were completely duplicated but with
different subsection headers. Why? -->
</section>
<section id="psychological-and-cultural-benefits" class="level3">
<h3 class="anchored" data-anchor-id="psychological-and-cultural-benefits">Psychological and Cultural Benefits</h3>
<p>Code review is a structured process that promotes collaboration and collaboration among authors, fostering a culture of shared responsibility and growth. It serves as a “bad cop” for feedback, allowing reviewers to offer constructive criticism without creating interpersonal tension. This process also offers psychological benefits, such as validation and motivation for engineers. It acknowledges their efforts and helps alleviate impostor syndrome by confirming the quality of their work. The process encourages a thoughtful approach, minimizing shortcuts and ensuring higher-quality output. Overall, code review benefits individuals and teams by balancing critique with validation, driving better practices, and fostering a supportive engineering culture.</p>
</section>
</section>
<section id="code-review-best-practices" class="level2">
<h2 class="anchored" data-anchor-id="code-review-best-practices">Code Review Best Practices</h2>
<p>Reviewing code can causes many problems. It can cause friction and be a time delay. There are many practices that need to be in place so code review can run smoothly and be worth it for individual developers and the organization.</p>
<p><strong>Discussion Question: Are there any problems that we have run into as a group with code review?</strong></p>
<section id="be-polite-and-professional" class="level3">
<h3 class="anchored" data-anchor-id="be-polite-and-professional">Be Polite and Professional</h3>
<p>Google has an environment of trust and respect. At Google they need a LGTM for one software engineer to show code comprehension. Code review can cause anxiety and stress to all different level of skilled people. For this reason, it is important for all feedback and criticism need to be professional.</p>
<p>If the writer of the code method is deficient the reviewer should point out different approaches but if the writer can prove that approach is a valid way the reviewer should respect the choice. When a code reviewer finds defects it should be taken as an opportunity to learn. Reviewers should ask question and see why code was written a certain way to understand before jumping to an conclusions. Also, is important to see each comment as a TODO item. Each comment should at least be addressed. Instead of marking the comment resolved if you disagree, try to resolve it by both stating their side. A common way to keep conversations civil if the writer disagrees is to ask the reviewer to “please take another look” (PTAL).</p>
<p>If you are the creator of the source code under review, it is important to remember the importance of professionalism. Once you submit your work to the codebase it is not yours anymore it becomes the team’s. You should be open to questions and be able to share why wrote your code in the way you did. Writers of code have a responsibility to make code that can last in the future while being understood by themselves and other team members.</p>
</section>
<section id="write-small-changes" class="level3">
<h3 class="anchored" data-anchor-id="write-small-changes">Write Small Changes</h3>
<p>A way to keep the process quick is to make changes small. It should be easy to look at the review and tackle the issue from both sides. It also helps cut down the time it takes. Having smaller changes makes it easier further down to know where a bug is if one arises. However, small changes can be hard to do with new features. It helps if the code can be broken up into smaller sections. The push for small changes helps the process of large changes to be accommodate.</p>
<p>“Small” changes are usually 200 lines or less of code. The changes should be small enough that it is easy on the reviewer and it does not cause a delay with the review. It is better for a writer if the review is quicker. This helps so the flow does not change. If the works takes a while to reviewed it can disrupt the flow. Additionally this can impact future code and cause time to be wasted if the review is not quick.</p>
</section>
<section id="write-good-change-descriptions" class="level3">
<h3 class="anchored" data-anchor-id="write-good-change-descriptions">Write Good Change Descriptions</h3>
<p>On the first line should be the type of change for a change description. The first line is just like a subject line in an email. It is a summary of the code which is important.</p>
<p>Even though the change is being summaries in the first line, you should still explain what was changed and why. A good way to share if many modifications were made is with a list. Finding the original change helps when fixing a bug.</p>
<p>There are other times when you can add documentations to change. When a reviewer looks at the writer’s code is confuses it is a good sign that the code needs better structure or comments. Always update the change description or or add comments to the implementation if a new decision reached. Code review is not just done in the moment. It is done over times for what was did.</p>
</section>
<section id="keep-reviewers-to-a-minimum" class="level3">
<h3 class="anchored" data-anchor-id="keep-reviewers-to-a-minimum">Keep Reviewers to a Minimum</h3>
<p>Software engineers in the industry often want to get many inputs on their code because each person can add their own insight. However, having too many reviewers can lead to the feedback being less valued. If we trust the people reviewing then it helps the process have less people. If your code review calls for many people then it is important for each person to write on a different part of the change so they are not the same.</p>
</section>
<section id="automate-where-possible" class="level3">
<h3 class="anchored" data-anchor-id="automate-where-possible">Automate Where Possible</h3>
<p>Code review is a process done by humans. If parts of the process can be stream lined do it. An example of a stream line is “presubmits”. Presubmits save people time since it checks what is being sent to be reviewed. This stop people from having to run tests, linters, or formatters is can be done for them. Which makes it easier to change and catch certain errors before being reviewed. It helps people so they can spend other time on bigger issues with the code.</p>
</section>
</section>
<section id="different-types-of-code-reviews" class="level2">
<h2 class="anchored" data-anchor-id="different-types-of-code-reviews">Different Types of Code Reviews</h2>
<p>As we talk about this section one aspect to be consider is what are the buckets/categories does the code we have written as a class generally fall into?</p>
<section id="green-field-reviews-and-new-code" class="level3">
<h3 class="anchored" data-anchor-id="green-field-reviews-and-new-code">Green Field Reviews and New Code</h3>
<p>A “green field” review has to do with writing new code. The chapter opened this section by saying that greenfield code reviews are “the least common type of code review.” Though this might be the case for Google it is unlikely to be the case for our class.</p>
<p><strong>Why might “green field” code review be more likely for our projects?</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<ul>
<li>the size of our code base</li>
<li>the newness of it</li>
</ul>
<p><strong>And what else?</strong></p>
<p><strong>Finally, why do you think it is called “green field”?</strong></p>
</details>
<p>This section also considers the difference between design review and code review. Design review considers the design of the tool or how code is implemented, while code review has to do more with the usability of it. This is also an important time to consider longevity of the code that has been written especially because it is new to the code base.</p>
</section>
<section id="behavioral-changes-improvement-and-optimizations" class="level3">
<h3 class="anchored" data-anchor-id="behavioral-changes-improvement-and-optimizations">Behavioral changes, improvement, and optimizations</h3>
<p>These types of changes are most common at Google and they have to do with changes to existing code within the code base. This section gave the important reminder that some of the best changes to a code base can be deletions. Which we has seen in class with the PR that is deleting the <code>coverage.json</code> file in <code>execexam</code> project. The same steps that apply in the green field review also apply here. With both the green field review and code refactoring changes must be made in a Continuous Integration (CI) system. This has to do with the idea of testing code in the location it will be used and added into.</p>
</section>
<section id="bug-fixes-and-rollbacks" class="level3">
<h3 class="anchored" data-anchor-id="bug-fixes-and-rollbacks">Bug fixes and rollbacks</h3>
<p>Code changes that have to do with bug fixes is should only correct that bug. It is easy to want to changes multiple issues with one change to the code, but this is not good practice when making changes to the code base. Rollbacks are something else that was also addressed in this section. A rollback happens when a change is made in the code base that doesn’t work and there is a decision made to revert to a previous state of the code base before the change. Though the code doesn’t actually go back. The code is going forward but the code base is identical to the version of the code base before the change that didn’t work was implemented. It is important to note that there is always a possibility of having to do a rollback, so this should always be considered when making changes to the code base. A rollback was something that was considered in the <code>gatorgrade</code> code base earlier this semester when there was a bug introduced into the <code>gatorgrade</code> code base.</p>
</section>
<section id="refactorings-and-large-scale-changes-lsc" class="level3">
<h3 class="anchored" data-anchor-id="refactorings-and-large-scale-changes-lsc">Refactorings and Large-Scale Changes (LSC)</h3>
<p>Some changes to the code base are automated. While these changes are written by a machine and not a human they still must be reviewed in the same manner as all other code reviews. Though with LSC no one person can veto a change, otherwise they would take too long to implement.</p>
</section>
</section>
<section id="moving-forward" class="level2">
<h2 class="anchored" data-anchor-id="moving-forward">Moving Forward</h2>
<p>We have implemented many of these code review practices in class, from knowledge sharing through code reviews to writing and creating pull requests. What are aspects of this process that we implement differently from Google? Are there some practices that we should adopt that we are not currently using?</p>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>professional development</category>
  <category>software engineering</category>
  <guid>https://www.developerdevelopment.com/blog/se9-fall2024/</guid>
  <pubDate>Mon, 02 Dec 2024 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Parsing Inputs</title>
  <dc:creator>Pallas-Athena Cain</dc:creator>
  <dc:creator>Coltin Colucci</dc:creator>
  <dc:creator>Chezka Quinola</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/fb8-fall2024/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This post discusses the <a href="https://www.fuzzingbook.org/html/Parser.html">Parsing Inputs</a> chapter from <a href="https://www.fuzzingbook.org/">The Fuzzing Book</a>. This chapter points out that, sometimes we need inputs that follow a certain grammar structure in order to effectively use fuzzing. A good way to do that is to use a parser to break down the grammar of a template string and form new strings that follow the same grammar rules. Then you can generate a whole bunch of valid inputs to use to test to your hearts content! This article breaks down how parsers work so we can use them. How to use them is described in the next chapter.</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>Reminder a non-terminal is the rule or building blocks for the grammar such as <code>&lt;digit&gt;</code> and <code>&lt;letter&gt;</code> whereas a terminal is the actual digit or letter think of it as the destination for the grammar like <code>2</code> or <code>a</code>. Given a string you can decompose it into its constituent parts that correspond to the parts of grammar used to generate it.</p>
<p>You can make a derivation tree of a given string to break it down into its grammar parts. Then it can be recombined using the same grammar to produce new strings. Trees allow us to mutate, crossover, and recombine their parts in order to generate new valid slightly different inputs. There are two main parsing classes to make a string into a derivation tree.</p>
<ul>
<li>Parsing Expression Grammar Parser (<code>PEGParser</code>)</li>
<li>Earley Parsers</li>
</ul>
<p>The <code>PEGParser</code> is efficient but limited to a specific grammar structure — rather than choosing all the rules that can potentially match it stops at the first match that succeeds. The <code>EarleyParser</code> can accept any kind of context-free grammars and explore all parsing alternatives.</p>
<section id="to-use" class="level3">
<h3 class="anchored" data-anchor-id="to-use">To Use</h3>
<p>To use these parsers first you have initiate a grammar:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> Grammars <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> US_PHONE_GRAMMAR</span>
<span id="cb1-2"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> us_phone_parser <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EarleyParser(US_PHONE_GRAMMAR)</span></code></pre></div></div>
<p>Then you use the parse method to retrieve a list of possible derivation trees:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> trees <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> us_phone_parser.parse(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(555)987-6543"</span>)</span>
<span id="cb2-2"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> tree <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(trees)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb2-3"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;&gt;</span> display_tree(tree)</span></code></pre></div></div>
<p><img src="https://www.developerdevelopment.com/blog/fb8-fall2024/example-tree.png" class="img-fluid"></p>
<p>These trees can be used for test generation. Notably for mutating and recombining existing inputs.</p>
</section>
<section id="why-parsing-for-fuzzing" class="level3">
<h3 class="anchored" data-anchor-id="why-parsing-for-fuzzing">Why Parsing for Fuzzing?</h3>
<p>Sometimes trying to generate valid inputs for fuzzing can be hard. For example if you have code that can only run if the first item has to be the strings <code>van</code> or <code>car</code> to work but you are randomly generating the input the chances of getting those to output are very low.</p>
<p>We can give the input generator our grammar but just the grammar itself is not enough to make valid inputs. Even if you modify the fuzzer to know more about the way the inputs are formatted there is still difficulty getting valid inputs.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> PooledGrammarFuzzer(GrammarFuzzer):</span>
<span id="cb3-2">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kwargs):</span>
<span id="cb3-3">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">super</span>().<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kwargs)</span>
<span id="cb3-4">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._node_cache <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb3-5"></span>
<span id="cb3-6">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> update_cache(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, key, values):</span>
<span id="cb3-7">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._node_cache[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> values</span>
<span id="cb3-8"></span>
<span id="cb3-9">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> expand_node_randomly(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, node):</span>
<span id="cb3-10">        (symbol, children) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> node</span>
<span id="cb3-11">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> children <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb3-12">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> symbol <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._node_cache:</span>
<span id="cb3-13">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> random.randint(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb3-14">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">super</span>().expand_node_randomly(node)</span>
<span id="cb3-15">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> copy.deepcopy(random.choice(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._node_cache[symbol]))</span>
<span id="cb3-16">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">super</span>().expand_node_randomly(node)</span>
<span id="cb3-17"></span>
<span id="cb3-18">gf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PooledGrammarFuzzer(CSV_GRAMMAR, min_nonterminals<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb3-19">gf.update_cache(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;item&gt;'</span>, [</span>
<span id="cb3-20">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;item&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'car'</span>, [])]),</span>
<span id="cb3-21">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;item&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'van'</span>, [])]),</span>
<span id="cb3-22">])</span>
<span id="cb3-23">trials <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span></span>
<span id="cb3-24">time <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb3-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(trials):</span>
<span id="cb3-26">    vehicle_info <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gf.fuzz()</span>
<span id="cb3-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb3-28">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">repr</span>(vehicle_info), end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb3-29">        process_vehicle(vehicle_info)</span>
<span id="cb3-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exception</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> e:</span>
<span id="cb3-31">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, e)</span>
<span id="cb3-32">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb3-33">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>()</span></code></pre></div></div>
<!-- NOTE: It would be better if this article had the source code directly
produce output instead of providing an example of the output. -->
<pre class="text"><code>',h,van,|'   Invalid entry
'M,w:K,car,car,van'  Invalid entry
'J,?Y,van,van,car,J,~D+'     Invalid entry
'S4,car,car,o'   invalid literal for int() with base 10: 'S4'
'2*-,van'    not enough values to unpack (expected at least 4, got 2)
'van,%,5,]'  Invalid entry
'van,G3{y,j,h:'  Invalid entry
'$0;o,M,car,car'     Invalid entry
'2d,f,e'     not enough values to unpack (expected at least 4, got 3)
'/~NE,car,car'   not enough values to unpack (expected at least 4, got 3)</code></pre>
<p><strong>The solution: A parser. A parser can extract the template for inputs and valid values from samples and use them for fuzzing!</strong></p>
</section>
<section id="using-a-parser" class="level3">
<h3 class="anchored" data-anchor-id="using-a-parser">Using a Parser</h3>
<p>The parser processes structured input. The parsers in this chapter take an input string and turn it into a derivation tree. The next chapter is about using the parser for testing but this chapter is about understanding how parsers work.</p>
</section>
<section id="an-ad-hoc-parser" class="level3">
<h3 class="anchored" data-anchor-id="an-ad-hoc-parser">An Ad-Hoc Parser</h3>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Used to extract the information</span></span>
<span id="cb5-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> simple_parse_csv(mystring: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> DerivationTree:</span>
<span id="cb5-3">    children: List[DerivationTree] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb5-4">    tree <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (START_SYMBOL, children)</span>
<span id="cb5-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, line <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(mystring.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)):</span>
<span id="cb5-6">        children.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"record </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%d</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> i, [(cell, [])</span>
<span id="cb5-7">                                           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cell <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> line.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">','</span>)]))</span>
<span id="cb5-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> tree</span>
<span id="cb5-9"></span>
<span id="cb5-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Change the orientation to Left to Right</span></span>
<span id="cb5-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> lr_graph(dot):</span>
<span id="cb5-12">    dot.attr(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'node'</span>, shape<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'plain'</span>)</span>
<span id="cb5-13">    dot.graph_attr[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rankdir'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'LR'</span></span>
<span id="cb5-14"></span>
<span id="cb5-15">tree <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> simple_parse_csv(mystring)</span>
<span id="cb5-16">display_tree(tree, graph_attr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lr_graph)</span></code></pre></div></div>
<p><img src="https://www.developerdevelopment.com/blog/fb8-fall2024/csv-lr-graph.png" class="img-fluid"></p>
<p>This is a simple example and if we encounter more complexity it may not parse correctly. We can separate these incorrectly parsed inputs manually but that would be insanity! It would be so much work. Instead we use formal parsers. With those changing the external structure does not have much impact on the internal structure.</p>
</section>
<section id="grammars-in-parsing" class="level3">
<h3 class="anchored" data-anchor-id="grammars-in-parsing">Grammars in Parsing</h3>
<p>Non-terminals are the building block rules that may be expanded. The symbols themselves are typically terminals unless they can be expanded further.</p>
<p>Here is an example derivation tree for this grammar:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1">tree <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;start&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;expr&gt;'</span>,</span>
<span id="cb6-2">                     [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;expr&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;integer&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;digit&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'1'</span>, [])])])]),</span>
<span id="cb6-3">                      (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'+'</span>, []),</span>
<span id="cb6-4">                      (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;expr&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;integer&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;digit&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'2'</span>,</span>
<span id="cb6-5">                                                               [])])])])])])</span>
<span id="cb6-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> mystring <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> tree_to_string(tree)</span>
<span id="cb6-7">display_tree(tree)</span></code></pre></div></div>
<p><img src="https://www.developerdevelopment.com/blog/fb8-fall2024/derivation-tree.png" class="img-fluid"></p>
<section id="recursion" class="level4">
<h4 class="anchored" data-anchor-id="recursion">Recursion</h4>
<p>Recursion is possible in grammar such as with <code>&lt;expr&gt;</code> being used in its own definition. There are two kinds of recursion to note in parsing left-recursive and right-recursive.</p>
<p><strong>Left-recursive</strong></p>
<p>A non-terminal is directly left-recursive if the left-most symbol of any of its productions is itself.</p>
<p>Example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1">LR_GRAMMAR: Grammar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb7-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;start&gt;'</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>],</span>
<span id="cb7-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;a'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span>],</span>
<span id="cb7-4">}</span>
<span id="cb7-5"></span>
<span id="cb7-6">mystring <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'aaaaaa'</span></span>
<span id="cb7-7">display_tree(</span>
<span id="cb7-8">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;start&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>, []), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span>, [])]), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span>, [])]),</span>
<span id="cb7-9">                 (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span>, [])]))</span></code></pre></div></div>
<p><img src="https://www.developerdevelopment.com/blog/fb8-fall2024/left-tree.png" class="img-fluid"></p>
<p>A grammar can also be indirectly left-recursive if the left-most symbols can be expanded using their definitions to produce the non-terminal as the left-most symbol of the expansion. For example <code>&lt;integer&gt;</code> will be considered hidden-left recursive if <code>&lt;digit&gt;</code> could derive an empty string.</p>
<p><strong>Right-recursive</strong></p>
<p>Right recursive is the same idea but it expands the other direction.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1">RR_GRAMMAR: Grammar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb8-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;start&gt;'</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>],</span>
<span id="cb8-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a&lt;A&gt;'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span>],</span>
<span id="cb8-4">}</span>
<span id="cb8-5"></span>
<span id="cb8-6">display_tree((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;start&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>, [</span>
<span id="cb8-7">                  (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span>, []), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span>, []), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>, [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span>, []), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>, [])])])])]</span>
<span id="cb8-8">             ))</span></code></pre></div></div>
<p><img src="https://www.developerdevelopment.com/blog/fb8-fall2024/right-tree.png" class="img-fluid"></p>
<p><strong>Discussion Question</strong>: Do you think left or right recursion is better for top-down parsers and why?</p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<p><strong>Answer: Right Recursion!</strong></p>
<p>Left recursion can get caught in infinite loops with top-down parsers which is not ideal. Right recursion avoids that problem because it waits to do more recursive calls until after the regular input.</p>
</details>
</section>
<section id="ambiguity" class="level4">
<h4 class="anchored" data-anchor-id="ambiguity">Ambiguity</h4>
<p>Sometimes there are multiple trees from the same grammar called <strong>parses</strong>. The string <code>1+2+3</code> has two ways it can be parsed using the <code>A1_GRAMMAR</code>. One method to deal with this is to simply choose an order of resolution, perhaps choose the first tree in any case (PEGParser). Another approach returns all the trees (Earley parser).</p>
</section>
</section>
</section>
<section id="a-parser-class" class="level2">
<h2 class="anchored" data-anchor-id="a-parser-class">A Parser Class</h2>
<p>To develop parsers there needs to be defined interface for parsing. There are two approaches to parsing a string using a grammar.</p>
<p>The first approach is to use a lexer. A lexer tokenizes an incoming string then feeds the grammar one token at a time. Each token represents a meaningful unit such as a number or keyword. The lexer handles the tokenization process, while the parser only has to focus on understanding the structure of the language using these tokens. The result of parsing is usually a shallow derivation tree, which can be converted into an Abstract Syntax Tree (AST).</p>
<p>The second approach is using a tree pruner. This occurs after the complete parse. The tree pruner removes the nodes that correspond to individual tokens and then replaces them with their actual string values as leaf nodes. This approach is more flexible and powerful additionally there is no separate step for lexing and parsing.</p>
</section>
<section id="parsing-expression-grammars" class="level2">
<h2 class="anchored" data-anchor-id="parsing-expression-grammars">Parsing Expression Grammars</h2>
<p>Parsing Expression Grammars (PEG) are recognition based grammars that specify a sequence of steps to take to parse a given string. Parsing expression grammars are represented by a set of nonterminals and corresponding alternatives representing how to match each.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1">PEG1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb9-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;start&gt;'</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'b'</span>]</span>
<span id="cb9-3">}</span></code></pre></div></div>
<p>Unlike context-free grammars alternatives represent ordered choices, meaning the parser will stop at the first matching rule it finds.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1">PEG2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb10-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;start&gt;'</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ab'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'abc'</span>]</span>
<span id="cb10-3">}</span></code></pre></div></div>
<section id="the-packrat-parser-for-predicate-expression-grammars" class="level3">
<h3 class="anchored" data-anchor-id="the-packrat-parser-for-predicate-expression-grammars">The Packrat Parser for Predicate Expression Grammars</h3>
<p>Packrat parsing is one of the simplest parsing techniques used for PEGs. It works by caching results from previous parsing steps so if the same problem comes up again it can reuse the cached solution instead of redoing the work.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1">mystring <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1 + (2 * 3)"</span></span>
<span id="cb11-2">peg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PEGParser(EXPR_GRAMMAR)</span>
<span id="cb11-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tree <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> peg.parse(mystring):</span>
<span id="cb11-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> tree_to_string(tree) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> mystring</span>
<span id="cb11-5">    display(display_tree(tree))</span></code></pre></div></div>
<p><img src="https://www.developerdevelopment.com/blog/fb8-fall2024/Packrat.png" class="img-fluid"></p>
</section>
<section id="parsing-context-free-grammars" class="level3">
<h3 class="anchored" data-anchor-id="parsing-context-free-grammars">Parsing Context-Free Grammars</h3>
<section id="problems-with-peg" class="level4">
<h4 class="anchored" data-anchor-id="problems-with-peg">Problems with PEG</h4>
<p>PEGs may at first appear simple but in some cases may include a little bit more thinking.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1">PEG_SURPRISE: Grammar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb12-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;A&gt;"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a&lt;A&gt;a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"aa"</span>]</span>
<span id="cb12-3">}</span></code></pre></div></div>
<p>When interpreted as a context free grammar and used as a string generator it will produce strings of the form <code>aa</code>, <code>aaaa</code>, <code>aaaaaa</code>. It produces strings where the number of <code>a</code> is <img src="https://latex.codecogs.com/png.latex?2%20*%20n">. PEGs are oriented towards language recognition and it is also unclear how to translate a PEG to a CFG. With the main focusing being fuzzing next we are going to look at parsers that can accept context-free grammars.</p>
</section>
</section>
</section>
<section id="earley-parsers" class="level2">
<h2 class="anchored" data-anchor-id="earley-parsers">Earley Parsers</h2>
<p>The <strong>Earley parser</strong> is a versatile general-purpose parser capable of parsing any arbitrary Context-Free Grammar (CFG). It was developed by <strong>Jay Earley</strong> in 1970 for computational linguistics. Although its computational complexity is <img src="https://latex.codecogs.com/png.latex?O(n%5E3)"> for parsing strings with arbitrary grammars, it can efficiently parse strings with unambiguous grammars in <img src="https://latex.codecogs.com/png.latex?O(n%5E2)"> time. It can also parse all <strong>LR(k)</strong> grammars in linear time, <img src="https://latex.codecogs.com/png.latex?O(n)"> as noted by <strong>Joop M.I.M. Leo</strong> in 1991. Further enhancements, particularly in handling epsilon rules, were introduced by <strong>Aycock et al.</strong> in 2002.</p>
<p><strong>Discussion Question</strong>: How does the computational complexity of the Earley parser affect its efficiency when dealing with large or ambiguous grammars? Can the parser be optimized further for specific use cases?</p>
<section id="grammar-restrictions" class="level3">
<h3 class="anchored" data-anchor-id="grammar-restrictions">Grammar Restrictions</h3>
<p>A notable limitation in the Earley parser implementation is that the start symbol can only have one alternative in its alternative expressions. However, this restriction can be easily bypassed by introducing a new start symbol. For example, given a grammar:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1">grammar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb13-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;start&gt;'</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;B&gt;'</span>],</span>
<span id="cb13-3">    ...</span>
<span id="cb13-4">}</span></code></pre></div></div>
<p>You can rewrite it to conform to the single-alternative rule:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1">grammar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb14-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;start&gt;'</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;start_&gt;'</span>],</span>
<span id="cb14-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;start_&gt;'</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;A&gt;'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt;B&gt;'</span>],</span>
<span id="cb14-4">    ...</span>
<span id="cb14-5">}</span></code></pre></div></div>
<p><strong>Discussion Question</strong>: Why might the Earley parser require the start symbol to have only one alternative, and what implications does this have for the flexibility of grammar representations?</p>
</section>
<section id="implementing-the-earleyparser" class="level3">
<h3 class="anchored" data-anchor-id="implementing-the-earleyparser">Implementing the EarleyParser</h3>
<p>To implement the <strong>EarleyParser</strong>, we can create a class derived from a basic <code>Parser</code> class. Here’s an example of how to use the Earley parser with some simple expressions:</p>
</section>
<section id="example-1-parsing-an-expression" class="level3">
<h3 class="anchored" data-anchor-id="example-1-parsing-an-expression">Example 1: Parsing an Expression</h3>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1">mystring <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1 + (2 * 3)"</span></span>
<span id="cb15-2">earley <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EarleyParser(EXPR_GRAMMAR)</span>
<span id="cb15-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tree <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> earley.parse(mystring):</span>
<span id="cb15-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> tree_to_string(tree) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> mystring</span>
<span id="cb15-5">    display(display_tree(tree))</span></code></pre></div></div>
<p>The derivation tree for this example might look like this:</p>
<pre><code>&lt;start&gt;
  &lt;expr&gt;
    &lt;term&gt;
      +
      &lt;expr&gt;
        &lt;factor&gt;
          &lt;integer&gt;
            &lt;digit&gt;
              1 (49)
        &lt;term&gt;
          &lt;factor&gt;
            ( (40)
        &lt;expr&gt;
          ) (41)
        &lt;term&gt;
          &lt;factor&gt;
            *
            &lt;term&gt;
              &lt;integer&gt;
                &lt;digit&gt;
                  2 (50)
              &lt;factor&gt;
                &lt;integer&gt;
                  &lt;digit&gt;
                    3 (51)</code></pre>
</section>
<section id="example-2-parsing-another-expression-with-decimals" class="level3">
<h3 class="anchored" data-anchor-id="example-2-parsing-another-expression-with-decimals">Example 2: Parsing Another Expression with Decimals</h3>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1">mystring <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1 * (2 + 3.35)"</span></span>
<span id="cb17-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tree <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> earley.parse(mystring):</span>
<span id="cb17-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> tree_to_string(tree) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> mystring</span>
<span id="cb17-4">    display(display_tree(tree))</span></code></pre></div></div>
<p>The derivation tree here might look like:</p>
<pre><code>&lt;start&gt;
  &lt;expr&gt;
    &lt;term&gt;
      &lt;factor&gt;
        *
        &lt;term&gt;
          &lt;integer&gt;
            &lt;digit&gt;
              1 (49)
          &lt;factor&gt;
            ( (40)
        &lt;expr&gt;
          ) (41)
        &lt;term&gt;
          +
        &lt;expr&gt;
          &lt;factor&gt;
            &lt;integer&gt;
              &lt;digit&gt;
                2 (50)
          &lt;term&gt;
            &lt;factor&gt;
              &lt;integer&gt;
                . (46)
              &lt;integer&gt;
                &lt;digit&gt;
                  3 (51)</code></pre>
<p><strong>Discussion Question</strong>: How does the parser handle nested expressions, and how does the structure of the derivation tree help us understand the parsing process?</p>
</section>
<section id="testing-the-parsers" class="level3">
<h3 class="anchored" data-anchor-id="testing-the-parsers">Testing the Parsers</h3>
<p>Testing parsers can be done effectively by generating random grammars and their corresponding strings. This provides an interesting way to ensure that parsers are working as expected.</p>
<p><strong>Discussion Question</strong>: What challenges might arise when testing parsers with random grammars, and how can fuzzing help identify edge cases or parsing issues?</p>
</section>
<section id="background" class="level3">
<h3 class="anchored" data-anchor-id="background">Background</h3>
<p>There are various parsing techniques available, each designed to handle specific types of grammars. Some common approaches include <strong>LL</strong> and <strong>LR</strong> parsing. <strong>LL parsing</strong> processes the input left-to-right, using a leftmost derivation. <strong>LR parsing</strong> works similarly but uses a rightmost derivation. These approaches are particularly efficient, with <strong>LR(1)</strong> grammars parseable in linear time.</p>
<p><strong>Discussion Question</strong>: How do LL and LR parsing differ in terms of efficiency and applicability, and when might one be preferred over the other?</p>
</section>
<section id="complexities-of-parsing" class="level3">
<h3 class="anchored" data-anchor-id="complexities-of-parsing">Complexities of Parsing</h3>
<!-- NOTE: How does boolean matrix multiplication reduce the complexity of
parsing? Can you please clarify this statement further? -->
<p>For <strong>arbitrary CFGs</strong>, the best-known algorithms typically have a worst-case complexity of <img src="https://latex.codecogs.com/png.latex?O(n%5E3)">. More advanced techniques, like <strong>boolean matrix multiplication</strong>, could theoretically reduce this further, but practical implementations often remain cubic.</p>
<p><strong>Discussion Question</strong>: What factors influence the complexity of parsing algorithms, and how can they be optimized for practical use cases?</p>
</section>
<section id="peg-parsing" class="level3">
<h3 class="anchored" data-anchor-id="peg-parsing">Peg Parsing</h3>
<p><strong>Parsing Expression Grammars (PEGs)</strong> are another important concept. While PEGs are effective for many contexts, their ability to represent certain languages (like <strong><code>anbncn</code></strong>) remains an open question. However, PEGs have the advantage of providing a simple top-down interpretation, making them intuitive for writing parsers.</p>
<p><strong>Discussion Question</strong>: In what scenarios would PEG parsing be more advantageous than other parsing techniques, and what are its limitations?</p>
<p>This concludes our overview of the Earley parser and its role in parsing arbitrary context-free grammars. By integrating it with fuzzing techniques, we can effectively test parsers against a variety of grammars, ensuring robustness and correctness.</p>
</section>
</section>
<section id="reflection" class="level2">
<h2 class="anchored" data-anchor-id="reflection">Reflection</h2>
<p>The article “Parsing Inputs” highlights the critical role of parsers in fuzzing by emphasizing how input parsers break down strings into derivation trees, which can then be mutated and recombined to generate new, valid inputs. I found the explanation of non-terminals, terminals, and the use of parsers like <code>PEGParser</code> and <code>EarleyParser</code> to be insightful. The examples, particularly the one about using a parser to improve fuzzing, demonstrated how incorporating grammar into the fuzzing process can significantly increase the likelihood of generating valid inputs, thus making fuzzing more effective.</p>
<p>I particularly appreciated the in-depth exploration of the <code>EarleyParser</code> and its flexibility in handling context-free grammars, which was crucial for understanding how such parsers can be used for fuzz testing. The emphasis on using parsers to simplify complex input generation is an actionable takeaway that I will apply when generating more structured inputs in future fuzzing exercises. The discussion of recursion, ambiguity, and grammar restrictions also gave me a clearer understanding of the complexities involved in parsing different types of grammars, which can be beneficial when working with more complex systems.</p>
</section>
<section id="action-items" class="level2">
<h2 class="anchored" data-anchor-id="action-items">Action Items</h2>
<p>The action items derived from the reading emphasize the importance of understanding and implementing parsing techniques for enhancing fuzzing capabilities. To start, it is crucial to experiment with different parsing methods, such as PEG and Earley Parsers, to determine their applicability in generating valid input for fuzzing tools. The next step is to implement a parser class with the ability to handle context-free grammars, as it can support more complex structures and enhance the flexibility of fuzzing processes.</p>
<p>Furthermore, the implementation of a grammar fuzzer should be explored, particularly using techniques like cache updates and random node expansions, to facilitate the generation of diverse test cases. Additionally, it is important to apply these parsing methods to generate meaningful and valid test data, as well as to test the parsers against various types of grammars, ensuring that all edge cases are addressed. Finally, an evaluation of the performance of each parsing method in terms of parsing efficiency and the quality of generated test inputs should be conducted, with the goal of optimizing fuzzing strategies.</p>
<!-- Include the license statement for the online book -->
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Reference">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Reference
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Unless otherwise noted, the source code segments in this article are excerpted directly from the <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. The authors of this online book licensed the source code and its written content under the <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0 Creative Commons License</a>. More details about the license for the Fuzzing Book are available in the <a href="https://github.com/uds-se/fuzzingbook/blob/master/LICENSE.md">The Fuzzing Book License</a>.</p>
</div>
</div>
</div>
<!-- Include reference back to the listing of blog posts -->
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>software engineering</category>
  <category>fuzzing book</category>
  <guid>https://www.developerdevelopment.com/blog/fb8-fall2024/</guid>
  <pubDate>Wed, 20 Nov 2024 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Style Guides and Rules</title>
  <dc:creator>Pallas-Athena Cain</dc:creator>
  <dc:creator>Coltin Colucci</dc:creator>
  <dc:creator>Chezka Quinola</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/se8-fall2024/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>Style guides are essential tools for scaling and sustaining engineering teams. They define rules that align with project values, fostering consistency, readability, and maintainability. However, creating effective rules requires thoughtful consideration—rules should advance specific goals, be optimized for readers, and avoid introducing unnecessary complexity.</p>
<p>Google’s approach emphasizes balance: rules must be impactful without being overly restrictive, and exceptions should be allowed when justified by practical needs. Automation tools like linters and formatters help enforce rules consistently, while regular reviews ensure style guides evolve with the needs of the team and the industry. By focusing on practical, evidence-based principles, teams can craft style guides that enhance both code quality and developer efficiency.</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<section id="why-have-rules" class="level3">
<h3 class="anchored" data-anchor-id="why-have-rules">Why Have Rules?</h3>
<p>This chapter discusses the importance of rules and style guides in software engineering, focusing on their role in promoting consistency, readability, and effective collaboration. It outlines the process of creating and evaluating rules, emphasizing the need for rules to align with organizational values and goals. The chapter also highlights the balance between maintaining consistency and allowing for practical exceptions when necessary. It explores principles for writing effective style guides, such as optimizing for the reader, avoiding error-prone constructs, and making rules that can scale. Additionally, it discusses the dynamic nature of style guides, the role of style arbiters, and the importance of automation tools for enforcing rules consistently across large codebases.</p>
<p><strong>Discussion Question: What values do we want to have for our codebases?</strong></p>
</section>
<section id="creating-the-rules" class="level3">
<h3 class="anchored" data-anchor-id="creating-the-rules">Creating the Rules</h3>
<p>When creating the rules it is important to question why you are making something a rule. Questions you can ask yourself when think of rules are:</p>
<ul>
<li>“What goal or goals are we trying to advance?”</li>
<li>“Why does this belong in the style guide?”</li>
<li>“What value does this rule add to our style guide?”</li>
<li>“Does the rule bring us closer to our goal or goals?”</li>
</ul>
<p>These are productive questions because they require you to reflect on why a rule exists instead of mindlessly creating rules for the sake of having rules.</p>
<section id="guiding-principles" class="level4">
<h4 class="anchored" data-anchor-id="guiding-principles">Guiding Principles</h4>
<p>Google has the goal of making the codebase manageable while still allowing for productivity. However there is an important trade-off of making rules. <strong>The larger the body of rules the more choice is restricted</strong>. So the large body of rules should always be aiming to lead us towards our goals instead of just acting as a limiting factor.</p>
<p>Given this there are some overarching principles to guide in rule development which are:</p>
<ul>
<li>Rules should pull their weight</li>
<li>Rules should be optimized for the reader</li>
<li>Rules should be consistent</li>
<li>Rules should avoid error-prone and surprising constructs</li>
<li>Rules should concede to practicalities when necessary</li>
</ul>
<section id="rules-must-pull-their-weight" class="level5">
<h5 class="anchored" data-anchor-id="rules-must-pull-their-weight">Rules Must Pull their Weight</h5>
<p>With more rules it becomes increasingly harder to remember them all. It can also become more expensive and challenging to maintain the more rules you have.</p>
<p>Choose to not include rules that are self-evident because they add to everyone’s mental load without being worth it.</p>
<p>For example in the context of our work we will not release debugging <code>print</code> statements in our production code. This rule is likely understood by all of us already and is not worth adding into an official style guide for that reason.</p>
</section>
<section id="optimize-for-the-reader" class="level5">
<h5 class="anchored" data-anchor-id="optimize-for-the-reader">Optimize for the Reader</h5>
<p>Another guiding principle is writing code for the reader rather than the author. This goes back to the principle <strong>Code is written once but read many times.</strong></p>
<p>This means we should adhere to the principle: <strong>Simple to read &gt; Simple to write</strong>.</p>
<p><strong>However, there is a trade-off</strong>: More cost more for engineers but easier to read.</p>
<p><strong>Ways to make code easier to read</strong>:</p>
<ul>
<li>Longer and more descriptive variable names</li>
<li>Using more descriptive conditional structures</li>
<li>Descriptive doc-strings</li>
<li>Well written comments</li>
</ul>
<p><strong>Types of comments</strong>:</p>
<ul>
<li>Documentation Comments that describe the design or intent of the code that follows</li>
<li>Implementation comments justify or highlight non-obvious choices, underscore important parts, or explain the tricky parts</li>
</ul>
</section>
<section id="be-consistent" class="level5">
<h5 class="anchored" data-anchor-id="be-consistent">Be Consistent</h5>
<p>Consistency in code bases and in work spaces makes it easier to jump from project to project. Think about the setup between <code>gatorgrade</code> and <code>execexam</code> both utilize <code>uv</code> so you were familiar with aspects of the tool before jumping in. That is part of why it is so hard to update <code>gatorgrader</code>. It was written before a lot of the dependencies we use in our other code bases so it is harder to get a grip on what is happening. That is why it is a task to convert it to a method that is more consistent with the rest of our code bases.</p>
<p><strong>Why consistency is good</strong>:</p>
<ul>
<li>Engineers can focus on what’s getting done over how it is presented</li>
<li>Chunking of problems; solving in a similar way</li>
<li>Enables scaling code wise; make the code work the same everywhere</li>
<li>Enables scaling human-wise; mobility across projects</li>
<li>Resilience to time</li>
</ul>
<p>Do not let preserving consistency stop you from updating your code at scale. If things change the standard may change and past code may need updated such as with <code>gatorgrader</code></p>
<p>Being consistent starts locally but sometimes standards of the external community should be taken into account. An example of this that you have used before is citation standards or the <code>YAML</code> standards for <code>yaml</code> files. We also using linting to make sure our codes are up to an outside standard.</p>
<p>An example they use in the book is that Google used to only use two space indents for their Python code but the outside community used four. Eventually they realized the Google standard did not fit compared to the outside standard. The more your code interacts with the outside world the more staying consistent with outside standards matter.</p>
</section>
<section id="avoid-error-prone-and-surprising-constructs" class="level5">
<h5 class="anchored" data-anchor-id="avoid-error-prone-and-surprising-constructs">Avoid Error-prone and Surprising Constructs</h5>
<p>Even if current developers understand a confusing construct there is no guarantee the future will. These non-obvious features can cause misuse and introduce bugs.</p>
<p>Google’s Python style guide avoids using “power” features such as reflection. <code>hasattr()</code> and <code>getattr()</code> for example give access to an object using strings.</p>
<p>Here is an example in Python:</p>
<p>The first Python file:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1">A_CONSTANT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb1-2"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'foo'</span>,</span>
<span id="cb1-3"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bar'</span>,</span>
<span id="cb1-4"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'baz'</span>,</span>
<span id="cb1-5">]</span></code></pre></div></div>
<p>The second Python file:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1">values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb2-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> field <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> some_file.A_CONSTANT:</span>
<span id="cb2-3">values.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(my_object, field))</span></code></pre></div></div>
<p>Confusing code can also cause security flaws since this code is hard to test and can be hard to identify if messages are validated incorrectly.</p>
<p>Some cases <code>hasattr()</code> and <code>getattr()</code> are valid but in most cases they are confusing. The traceback feature we have for example is a case where we needed to use these Python features to grab the information on the source code and source files.</p>
<p>There is higher value in code that is understandable and easier to maintain than code that jumps to get the job done quickly.</p>
</section>
<section id="concede-to-practicalities" class="level5">
<h5 class="anchored" data-anchor-id="concede-to-practicalities">Concede to Practicalities</h5>
<p><strong>“A foolish consistency is the hobgoblin of little minds.”</strong> - Ralph Waldo Emerson</p>
<p>It is okay to have exceptions to the style guide. Do not ignore everything else just because you are in pursuit of simple and consistent code. When needed exceptions can be made for optimizations and practicalities that otherwise would conflict with the rules.</p>
<p><strong>Discussion Question: Can you describe one of the guiding principles and why it is important?</strong></p>
</section>
</section>
<section id="the-style-guide" class="level4">
<h4 class="anchored" data-anchor-id="the-style-guide">The Style Guide</h4>
<p>Good style guides have rules that do three things: - Rules to avoid dangers - Rules to enforce best practices - Riles to ensure consistency</p>
<p>Dangerous rules are things that allow bugs to creep in such as using lambda expressions or hard to use language features.</p>
<p>Best practices are meant to make code more readable.</p>
<p>Building consistency is how you can choose a standard and not debate about them wasting time. You choose a standard and stick with it.</p>
</section>
</section>
<section id="changing-the-rules" class="level3">
<h3 class="anchored" data-anchor-id="changing-the-rules">Changing the Rules</h3>
<p>Style guides are not static. As with many things in software engineering, style guides are an ever evolving thing. With this being said certain styles can become outdated based on new features. If a rule is causing engineers to invest an excess amount of effort that may indicate that a change is needed. When looking into changing the rules the first thing that is important to evaluate is why the rule is in place to start. In doing this evaluation it is also important to have evidence to back up keeping a rule or creating a change. It is also important to document the reasons for change. In the future it will allow active users to have a more educated opinion on whether or not the rule is still effective or needs to be changed. An example of this is Google using CamelCase as opposed to snake_case naming style for method names.</p>
<p>The reason for this is that most of Google’s Python usage at the time was for C++ developers using Python as a scripting layer on top of a C++ codebase. Because Google’s C++ naming convention follows CamelCase style, it was important to keep that consistent. When doing this they found that there were other issues with CamelCase. CamelCase did not conform to the third-party Python libraries that were being used. This made maintaining CamelCase more complex than it needed to be. Another downside that was discovered was that this nonconformist convention was surprising and somewhat weird for the community. Ultimately when weighing the pros and cons of CamelCase and snake_case Google decided to switch back to snake_case naming in Python.</p>
<section id="the-process" class="level4">
<h4 class="anchored" data-anchor-id="the-process">The Process</h4>
<p>The process used at Google for changing a style guide is a solution based one. This means that if an update is proposed it has to be a solution to an existing problem and not a hypothetical situation.</p>
<p><strong>Why might this be an effective approach?</strong></p>
</section>
<section id="the-style-arbiters" class="level4">
<h4 class="anchored" data-anchor-id="the-style-arbiters">The Style Arbiters</h4>
<p>At Google each language’s style guide has to be approved by the style arbiters. This group is are long-time language experts and are designated to make the final decisions. With this being said they do not make the decision on their own. They have to take into account the trade-offs for the proposed change and each change has to be agreed upon and have a specific goal for the change.</p>
<p><strong>At Google this group is composed of a four person committee. Why might you want an even number on this committee as opposed to an odd number?</strong></p>
</section>
<section id="exceptions" class="level4">
<h4 class="anchored" data-anchor-id="exceptions">Exceptions</h4>
<p>Yes, you should follow the rules. However there are times when you may think that not following a specific rule may save a lot of your time or energy.</p>
<p><strong>What do you think you should do in this scenario?</strong></p>
<p>When wanting to make an exception you should first ask yourself if it is worth going through the process of doing so. The general rule that is followed is that exceptions are allowed in cases where it is gauged to be more beneficial to permit a rule-breaking than to avoid it. An example of this would be breaking the C++ style guide of not allowing implicit type conversions. However, for types that are designed to transparently wrap other types, where the underlying data is still accurately and precisely represented, it is reasonable to allow implicit conversion. While this is a valid exception it is also important to note that this rule covers enough broad circumstances that it is still valid to have in place.</p>
</section>
</section>
<section id="guidance" class="level3">
<h3 class="anchored" data-anchor-id="guidance">Guidance</h3>
<p>Guidance can come in many different forms. It can be as simple as pointing to advice on best practices or as complex as having an in depth conversation on a nuanced topic. Guidance is supposed to represent the best practices that have been extracted from lessons learned along the way of getting familiar with style guides. Think of guides as “shoulds,” and rules as “musts.”</p>
<p>An example of a pool of guidance is primers. Primers do not delve into every detail of a topic but they should provide explanations and recommend use. This can be useful for new members to reference because primers can give you the necessary information needed to implement a feature without any excess.</p>
<p>As with many things done at Google these guides are covering many issues that have already occurred. It is not focused on situations that are hypothetical but instead common issues that have real application. With this being said they are still pieces of advice, unlike the rules in the style guide. Guidance is more broad and applied. An example of this would be a short “Tip of the Week” article that is short and to the point. This is one of the many ways guidance can be economically offered.</p>
<p>Oftentimes software engineers come into a project with knowledge of a programming language but lack knowledge in how it applies to a specific company or project. At Google they provide full-day courses in order to bridge this gap. This could apply in our team as well. Using knowledge sharing to familiarize somebody working on a new project or codebase could help to gain traction leading to better overall development.</p>
</section>
<section id="applying-the-rules" class="level3">
<h3 class="anchored" data-anchor-id="applying-the-rules">Applying the Rules</h3>
<section id="error-checkers" class="level4">
<h4 class="anchored" data-anchor-id="error-checkers">Error Checkers</h4>
<p>Error checkers are invaluable for ensuring that coding standards are consistently followed. Google uses tools like <code>clang-tidy</code> for C++ and <code>Error Prone</code> for Java to automatically identify rule violations and suggest fixes. These tools are deeply integrated into the development process, which helps engineers focus on writing quality code without needing to memorize every detail of the rules.</p>
<p>Here is an interesting insight from this chapter: “When we began using tools to flag deprecated functions based on source tagging, surfacing both the warning and the suggested fix in place, the problem of having new usages of deprecated APIs disappeared almost overnight.” This demonstrates how automation not only enforces rules but also makes compliance nearly effortless for engineers.</p>
<p>By automating rule enforcement, these tools minimize “the variance in how a rule is interpreted and applied,” reducing the risk of inconsistent expectations. They also scale easily as the organization grows, ensuring that enforcement costs remain manageable, even with thousands of engineers working on millions of lines of code.</p>
</section>
<section id="code-formatters" class="level4">
<h4 class="anchored" data-anchor-id="code-formatters">Code Formatters</h4>
<p>Formatting debates are a common frustration for engineers, but automated formatters resolve them effectively. Tools like <code>clang-format</code> for C++, <code>gofmt</code> for Go, and <code>dartfmt</code> for Dart enforce consistent code styles across projects. At Google, these formatters are run automatically as part of presubmit checks, ensuring that all code complies before it’s submitted.</p>
<p>Go’s formatter, <code>gofmt</code>, provides a compelling case study. Though some developers initially resisted its strict formatting rules, it quickly became a feature they valued. “Go programmers expect that all Go code is formatted with <code>gofmt</code>,” making it easier to read, share, and maintain code. Standardized formatting also enables tools to make updates without generating confusing or unnecessary changes, streamlining the review process.</p>
</section>
</section>
</section>
<section id="reflection" class="level2">
<h2 class="anchored" data-anchor-id="reflection">Reflection</h2>
<p>Rules in software engineering are essential because they reinforce the values of the project and guide thoughtful development. However, the process of creating and maintaining rules requires balance. Rules should advance clear goals without adding unnecessary mental load. For example, choosing to omit self-evident rules like “Do not leave debugging prints in production” prevents over-complicating the style guide.</p>
<p>Google’s approach highlights the importance of optimizing for the reader, ensuring consistency, and avoiding constructs that are error-prone or confusing. These principles not only make codebases easier to maintain but also enable scaling—both in terms of engineering teams and the longevity of projects. While consistency is valuable, flexibility and practicality should also be considered to accommodate exceptions or evolving standards.</p>
<p>Ultimately, rules are not static but require thoughtful revision. By evaluating rules based on evidence and documented trade-offs, engineering teams can maintain a balance between enforcing standards and allowing innovation.</p>
</section>
<section id="action-items" class="level2">
<h2 class="anchored" data-anchor-id="action-items">Action Items</h2>
<p>To improve style guide practices, start by defining the core values of your project, such as consistency, readability, or performance optimization, and use these values to guide rule creation. Automation can be a powerful tool in this process; tools like <code>clang-tidy</code>, <code>gofmt</code>, and other linters can streamline rule enforcement, ensuring compliance without overburdening team members.</p>
<p>Prioritize writing code with the reader in mind by using clear variable names, descriptive comments, and consistent formatting. While striving for consistency across projects, maintain flexibility by allowing justified exceptions and accommodating external standards when necessary. Documenting these exceptions ensures clarity and transparency.</p>
<p>Lastly, invest in knowledge sharing to help team members understand and apply the style guide effectively. Resources such as primers, training sessions, or concise “tip-of-the-week” articles can help bridge knowledge gaps and foster alignment across the team. By implementing these steps, your team can establish a style guide that supports both high-quality code and efficient collaboration.</p>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>professional development</category>
  <category>software engineering</category>
  <guid>https://www.developerdevelopment.com/blog/se8-fall2024/</guid>
  <pubDate>Mon, 18 Nov 2024 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Efficient Grammar Fuzzing</title>
  <dc:creator>Aidan Dyga</dc:creator>
  <dc:creator>Molly Suppo</dc:creator>
  <dc:creator>Titus Smith</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/fb7-fall2024/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This post discusses the <a href="https://www.fuzzingbook.org/html/GrammarFuzzer.html">Efficient Grammar Fuzzing</a> chapter from <a href="https://www.fuzzingbook.org/">The Fuzzing Book</a>. In this post, we will cover derivation trees and what they are, expansion and how it works, and cost functions and how they can be used for grammar fuzzing. We will also examine both the theoretical aspect of these concepts as well as more code-based examples explaining how it works in practice.</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>As we have learned in the past, grammars are essential tools for producing syntactically valid inputs while offering a structured approach to input generation. This chapter <strong>refines the previous string-based algorithm into a tree-based algorithm</strong>, allowing for faster grammars that have much more control over the production of fuzz inputs. In this blog, we will explore how to create a more efficient grammar fuzzer that is more applicable to real word use cases.</p>
<section id="what-is-a-derivation-tree" class="level3">
<h3 class="anchored" data-anchor-id="what-is-a-derivation-tree">What is a Derivation Tree?</h3>
<p>In the context of grammar fuzzing, derivation trees are used to efficiently manage and control the process of expanding grammar rules. A derivation tree represents the entire structure of a generated string, keeping track of which parts have been expanded and which still need to be. This tree-based structure makes it easier to visualize, manipulate, and compare different expansions. Each node in the tree corresponds to either a terminal (<strong>REMINDER:</strong> cannot be expanded further) or a non-terminal (<strong>REMINDER:</strong> can be expanded into other symbols). The tree is built step by step, starting from a root node and progressively expanding non-terminals until only terminal symbols remain.</p>
<section id="make-up-of-a-derivation-tree" class="level4">
<h4 class="anchored" data-anchor-id="make-up-of-a-derivation-tree">Make-Up of a Derivation Tree</h4>
<p>Below are the different components of a derivation tree:</p>
<ul>
<li><p><strong>Terminal Node(s):</strong> These are the “leaf” nodes and represent the actual symbols of the generated string (e.g., characters, words).</p></li>
<li><p><strong>Non-terminal Node(s):</strong> These represent symbols that can be expanded into other symbols according to the grammar rules (e.g., <code>&lt;expr&gt;</code> or <code>&lt;term&gt;</code>).</p></li>
<li><p><strong>Root Node:</strong> The root node represents the start symbol of the grammar.</p></li>
<li><p><strong>Expansion:</strong> The tree is built by recursively expanding non-terminals according to the grammar’s production rules.</p></li>
</ul>
<p>While the simple grammar fuzzer used previously was inefficient and lacked control, leading to potential infinite expansions, derivation trees solve these issues by providing a more structured and efficient approach. By expanding nodes in a derivation tree instead of manipulating strings directly, the algorithm can track progress, avoid infinite expansions, and maintain better control over the process</p>
<p><strong>What is the purpose of using a derivation tree in grammar-based string generation, and how does it improve the process compared to generating a string directly?</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<p>The purpose of using a derivation tree is to provide a structured representation of the string generation process. A derivation tree captures the full history of how a string is derived from the start symbol by expanding non-terminal symbols according to grammar rules. This structure allows for better control, visualization, and manipulation of the generation process. Additionally, derivation trees allow for better visualization and comparing different derivations of the same string, allowing for clearer understanding and debugging of the generation process.</p>
</details>
</section>
</section>
<section id="how-expansion-works" class="level3">
<h3 class="anchored" data-anchor-id="how-expansion-works">How Expansion Works</h3>
<p>Expansion starts by searching for a non-terminal symbol without children. This is also referred to as a “leaf.” The expansion is then added as a child, or child node of the “leaf.” The process then continues as another non-terminal symbol is chosen to expand. This expansion process repeats until there are no non-terminal symbols left to expand.</p>
<p>When defining expansion from a coding standpoint, there are ways to indicate whether a symbol has children and whether it is able to be expanded. We use <code>None</code> to indicate a situation where the symbol has no children and it is non-terminal, meaning we can expand the node. We use <code>[]</code> to indicate a situation where the symbol has no children and it is terminal, meaning we cannot expand the node.</p>
<p><strong>What are the three different kinds of expansion?</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<ul>
<li>Maximum cost</li>
<li>Minimum cost</li>
<li>Random (previously discussed)</li>
</ul>
<p>This relates to the next section regarding cost functions and how they are used to facilitate expansion in certain situations.</p>
</details>
</section>
<section id="cost-functions" class="level3">
<h3 class="anchored" data-anchor-id="cost-functions">Cost Functions</h3>
<p>The process of closing the expansion of a derivation tree involves ensuring that expansions do not inflate the tree size unnecessarily. To achieve this, we introduce cost functions that help determine the most efficient way to expand each symbol in the tree.</p>
<section id="determine-the-cost-of-expanding" class="level4">
<h4 class="anchored" data-anchor-id="determine-the-cost-of-expanding">Determine the Cost of Expanding</h4>
<ol type="1">
<li><p><strong><code>symbol_cost</code></strong>: Computes the minimum cost of all possible expansions for a given symbol, by calling <code>expansion_cost</code> for each possible expansion.</p></li>
<li><p><strong><code>expansion_cost</code></strong>: Calculates the total cost of expanding a symbol by summing up the costs of all its possible expansions. If a non-terminal symbol is revisited during expansion (leading to recursion), the cost is set to infinity to prevent infinite loops.</p></li>
</ol>
</section>
<section id="expanding-by-maximum-cost" class="level4">
<h4 class="anchored" data-anchor-id="expanding-by-maximum-cost">Expanding by Maximum Cost</h4>
<!-- TODO: There is no execution of any of this source code. This source code
will not produce any output so as to help readers understand its behavior. -->
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> GrammarFuzzer(GrammarFuzzer):</span>
<span id="cb1-2">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> expand_node_min_cost(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, node: DerivationTree) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> DerivationTree:</span>
<span id="cb1-3">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.log:</span>
<span id="cb1-4">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expanding"</span>, all_terminals(node), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"at minimum cost"</span>)</span>
<span id="cb1-5"></span>
<span id="cb1-6">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.expand_node_by_cost(node, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>)</span></code></pre></div></div>
</section>
<section id="expanding-by-minimum-cost" class="level4">
<h4 class="anchored" data-anchor-id="expanding-by-minimum-cost">Expanding by Minimum Cost</h4>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> GrammarFuzzer(GrammarFuzzer):</span>
<span id="cb2-2">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> expand_node_max_cost(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, node: DerivationTree) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> DerivationTree:</span>
<span id="cb2-3">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.log:</span>
<span id="cb2-4">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expanding"</span>, all_terminals(node), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"at maximum cost"</span>)</span>
<span id="cb2-5"></span>
<span id="cb2-6">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.expand_node_by_cost(node, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>)</span></code></pre></div></div>
<p><strong>In what specific situations would someone prefer to use expanding by maximum versus minimum costs?</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<ul>
<li>Minimum: This approach is preferred when generating small, efficient fuzz inputs to quickly explore edge cases without inflating the derivation tree.</li>
<li>Maximum: This method is useful for generating complex, deeply nested inputs to stress-test the system and uncover bugs in more intricate scenarios.</li>
</ul>
</details>
</section>
</section>
</section>
<section id="key-takeaways" class="level2">
<h2 class="anchored" data-anchor-id="key-takeaways">Key Takeaways</h2>
<p>Derivation trees and cost functions play a critical role in improving the efficiency and control of grammar-based fuzzing by guiding the expansion of derivation trees. These functions help avoid unnecessary growth in the tree and prevent infinite loops, ensuring that the fuzzer produces valid and varied inputs without redundant or inefficient expansions. However, using these functions can present challenges, especially with large or highly recursive grammars, where calculating the cost of expansions can become computationally expensive and may require optimizations to maintain performance. Lastly, efficient grammar-fuzzing adds increased functionality to our fuzzing tests and allow for more accurate fuzzing.</p>
<!-- Include the license statement for the online book -->
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Reference">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Reference
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Unless otherwise noted, the source code segments in this article are excerpted directly from the <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. The authors of this online book licensed the source code and its written content under the <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0 Creative Commons License</a>. More details about the license for the Fuzzing Book are available in the <a href="https://github.com/uds-se/fuzzingbook/blob/master/LICENSE.md">The Fuzzing Book License</a>.</p>
</div>
</div>
</div>
<!-- Include reference back to the listing of blog posts -->
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>software engineering</category>
  <category>fuzzing book</category>
  <guid>https://www.developerdevelopment.com/blog/fb7-fall2024/</guid>
  <pubDate>Wed, 13 Nov 2024 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Leading at Scale</title>
  <dc:creator>Aidan Dyga</dc:creator>
  <dc:creator>Molly Suppo</dc:creator>
  <dc:creator>Titus Smith</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/se7-fall2024/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This blog focuses on the “Leading At Scale” chapter of the <a href="https://abseil.io/resources/swe-book">Software Engineering at Google</a> book. In previous class sessions we have discussed transitioning from a team member to a leader, but this blog post will mainly focus on <strong>leading at a higher level</strong>. As you move up the management chain, you will realize that your prior technical experience will not be as important. Instead, your success will primarily be judged based on how you can lead people. In this chapter, we will be learning more about the “three always of leadership.”</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>In Software Engineering leadership helps create order, and more importantly, a path towards collective success. This chapter focus on three main areas on how to Scale your Leadership: Always Be Deciding, Always Be Leaving, Always Be Scaling. These sections break down how leaders can effectively ensure their team reaches their goals, including processes for decision making, delegation, and best practices for handling the increased responsibilities.</p>
<section id="always-be-deciding" class="level3">
<h3 class="anchored" data-anchor-id="always-be-deciding">Always Be Deciding</h3>
<p>“Always Be Deciding” builds upon the concepts covered in “How to Lead a Team” and how to elevate from an effective team member to an effective leader. Specifically this section focuses on weighing high-level decisions based on trade-offs rather than specific implementations.</p>
<section id="parable-of-the-airplane" class="level4">
<h4 class="anchored" data-anchor-id="parable-of-the-airplane">Parable of the Airplane</h4>
<p>An illustration of how choices often come with unintended consequences. The story explains how a passenger pays others to vacate an overfilled plane, only to find the plane has other technical issues, causing even further delay. Overall this story explains how trade-offs in complex systems can have unforeseen outcomes. In the case of software engineering the trade-offs come in forms of how to use our resources, mainly the members of our course and their time. A powerful quote from this section, from Ben Collins-Sussman is <strong>“If writing code is analogous to chopping down trees, your job as a leader is to see the forest through the trees and find a workable path through that forest, directing engineers toward the important trees”.</strong></p>
</section>
<section id="identify-the-blinders" class="level4">
<h4 class="anchored" data-anchor-id="identify-the-blinders">Identify the Blinders</h4>
<p>When approaching a long-standing problem, you’ll often find that those involved have developed “blinders” and assumptions that prevent them from seeing alternative solutions. With fresh perspective, you can identify these blinders, question assumptions, and explore new strategies.</p>
</section>
<section id="identify-the-trade-offs" class="level4">
<h4 class="anchored" data-anchor-id="identify-the-trade-offs">Identify the Trade-Offs</h4>
<p>There are no magic answers to all problems. As a leader you must identify the best answer for the moment. This requires weighing the options, and effectively communicate to your team what the trade-offs are.</p>
</section>
<section id="decide" class="level4">
<h4 class="anchored" data-anchor-id="decide">Decide</h4>
<p>After understanding the trade-offs, use the information to create a path forward. This is an ongoing process to ensure that all issues are actively and properly addressed. Iteration is an important factor to this step and we must complete this process in an ongoing fashion.</p>
<p><strong>What are the three steps to successfully avoiding unforeseen outcomes when weighing trade-offs?</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<ul>
<li>Identify the <strong>Binders</strong></li>
<li>Identify the <strong>Trade-offs</strong></li>
<li><strong>Decide</strong> the appropriate course of action.</li>
</ul>
</details>
</section>
</section>
<section id="always-be-leaving" class="level3">
<h3 class="anchored" data-anchor-id="always-be-leaving">Always Be Leaving</h3>
<p>The concept of “Always Be Leaving,” coined by former Google engineering director Bharat Mediratta, emphasizes the importance of building teams that can <strong>function without their leader</strong>. The goal is to avoid becoming a single point of failure (SPOF) and to create what the text calls a “self-driving team.” To achieve this, leaders must focus on three key aspects:</p>
<ol type="1">
<li><p>Dividing the problem space into manageable subproblems</p></li>
<li><p>Delegating these problems to capable leaders while allowing them to learn through potential failures</p></li>
<li><p>Making careful adjustments through thoughtful observation and minimal intervention.</p></li>
</ol>
<p>Rather than micromanaging, effective leaders should spend 95% of their time observing and listening, and 5% making precise, critical adjustments to keep their teams on course. Additionally, leaders should also avoid anchoring their team identity to specific solutions, as this can lead to resistance to change and innovation.</p>
<p><strong>How can a leader effectively balance delegation and minimal intervention to ensure their team becomes self-driving and what are the potential challenges they might face in avoiding the role of a “single point of failure” (SPOF)?</strong></p>
</section>
<section id="always-be-scaling" class="level3">
<h3 class="anchored" data-anchor-id="always-be-scaling">Always Be Scaling</h3>
<p>The concept “Always Be Scaling” utilizes the idea of the cycle of success to balance multiple problems at once. The cycle consists of four stages, analysis, struggle, traction, and reward.</p>
<p>The Cycle of Success:</p>
<ol type="1">
<li>Analysis</li>
<li>Struggle</li>
<li>Traction</li>
<li>Reward</li>
</ol>
<p>Analysis involves identifying blinders, finding the trade-offs, and deciding how to start going about managing both. Struggle involves failures, retries, and iteration. This phase is often referred to as “herding cats”. Traction involves making smarter decisions, and real progress being made. Reward involves succeeding while also creating a new problem. With reward also comes the need to enter the compression phase where half the team works on the problem with half the time to fix the problem.</p>
<p>The scaling concept also applies to scaling yourself and ensuring you are not taking on too much responsibility. This involves protecting your time and your energy especially as it is important.</p>
<p><strong>What are some ways to protect your energy when in a leadership role? Talk in small groups and we will discuss as a class.</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<ul>
<li>Take vacations</li>
<li>Take time to disconnect</li>
<li>Take time to do something you enjoy</li>
<li>Take breaks during the day</li>
</ul>
</details>
</section>
</section>
<section id="reflection" class="level2">
<h2 class="anchored" data-anchor-id="reflection">Reflection</h2>
<p>The first important takeaway from being a leader is to be able to help your team make decisions when it comes to fixing ambiguous problems. This involves identifying blinders and trade-offs and highlighting the importance of finding a solution in a timely manner rather than a perfect solution. The second important takeaway is to ensure your team is able to complete tasks and handle problems without you. In other words, this ensures you avoid a single point of failure problem. Finally, the third takeaway is that protecting your time and energy as a leader is very important. Also it is important to keep in mind the idea of the cycle of success as a good model for how to approach an issue.</p>


</section>

 ]]></description>
  <category>post</category>
  <category>professional development</category>
  <category>software engineering</category>
  <guid>https://www.developerdevelopment.com/blog/se7-fall2024/</guid>
  <pubDate>Mon, 11 Nov 2024 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Fuzzing with Grammars</title>
  <dc:creator>Hemani Alaparthi</dc:creator>
  <dc:creator>Coltin Colucci</dc:creator>
  <dc:creator>Philip Olwoc</dc:creator>
  <dc:creator>Gregory M. Kapfhammer</dc:creator>
  <link>https://www.developerdevelopment.com/blog/fb6-fall2024/</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This article dives into the <a href="https://www.fuzzingbook.org/html/Grammars.html">Fuzzing with Grammars</a> chapter from The <a href="https://www.fuzzingbook.org/html/">Fuzzing Book</a> which builds on previous discussions, specifically those on <a href="https://www.fuzzingbook.org/html/MutationFuzzer.html">Mutation-Based Fuzzing</a>. By defining the legal inputs to a program through grammar specifications, we can streamline and enhance test generation, especially for complex formats. This blog post highlights the importance of structured inputs, which play a critical role in more advanced forms of fuzzing, including configuration fuzzing, API fuzzing, and GUI fuzzing. Here, we explore both the benefits and applications of grammar-based fuzzing, demonstrating how it offers a systematic approach for generating effective test cases across a range of input types. We will be exploring these practices and examining their relevance to our team’s current situation with tools like <code>execexam</code>, connecting them to the concepts discussed last week to highlight how grammar-based fuzzing provides a systematic and effective approach to comprehensive test case generation.</p>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>Grammars are essential tools for producing syntactically valid inputs, offering a structured approach to input generation. In this post, we will examine grammar-based fuzzing as a tool for generating complex, syntactically valid inputs. By seeding grammars in mutation-based fuzzing, we can produce varied inputs that strengthen testing efforts. The post will also highlight the benefits of incorporating character classes, operators, and helper functions to improve the efficiency and accuracy of input generation.</p>
</section>
<section id="input-languages" class="level2">
<h2 class="anchored" data-anchor-id="input-languages">Input Languages</h2>
<p>In software engineering all programs are triggered by the input, and this can be a wide range of sources. Here are some examples of inputs: data that the program reads from files, user input, or even data from interactions with other sources. All these dictate how a program will behave, so it is very helpful to think about possible input sources and get them under control and how to “systemically test them”.</p>
<p>For the sake of simplicity, we will assume that a program has one single input. The range of valid inputs a program can process correctly is referred to as a “language”, because they follow a specific set of rules of syntax and semantics. There are many examples, there are simple languages like comma-separated value (CSV) files and complex languages like Python programs.</p>
<p>For languages to be formally described, the field of formal language theory has developed a set of language specifications to describe a language. “Regular expressions” represent the simplest class of strings, for example <code>[a-z]*</code> represents a simple sequence of lowercase letters. Automata theory links these languages to Finite state machines, these machines help recognize patterns defined by regular expressions.</p>
<p>Regular expressions are good when representing a simple input but from more complex inputs they are limited. This is why we use turning machines. Turing machines can specify more complex input sets like Python. Since Python is Turing Complete it allows us to define and/or list inputs for another program but because testing has to be specific to each program it cannot be done automatically.</p>
</section>
<section id="grammars" class="level2">
<h2 class="anchored" data-anchor-id="grammars">Grammars</h2>
<p>Grammars are a set of rules that define the structure of a language, much like in English it allows us to properly construct sentences so our communication comes out clearly. Grammars are useful in helping understand the structure of an input and describing patterns where elements are nested within each other.</p>
</section>
<section id="representing-grammar-in-python" class="level2">
<h2 class="anchored" data-anchor-id="representing-grammar-in-python">Representing Grammar in Python</h2>
<div id="74364c05" class="cell" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> typing <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> List, Dict, Union, Any, Tuple</span>
<span id="cb1-2"></span>
<span id="cb1-3">SimpleGrammar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Dict[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, List[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>]]</span>
<span id="cb1-4">Option <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Dict[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, Any]</span>
<span id="cb1-5">Expansion <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Union[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, Tuple[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, Option]]</span>
<span id="cb1-6">Grammar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Dict[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, List[Expansion]]</span>
<span id="cb1-7"></span>
<span id="cb1-8">EXPR_GRAMMAR: Grammar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb1-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;start&gt;"</span>:</span>
<span id="cb1-10">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;expr&gt;"</span>],</span>
<span id="cb1-11"></span>
<span id="cb1-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;expr&gt;"</span>:</span>
<span id="cb1-13">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;term&gt; + &lt;expr&gt;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;term&gt; - &lt;expr&gt;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;term&gt;"</span>],</span>
<span id="cb1-14"></span>
<span id="cb1-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;term&gt;"</span>:</span>
<span id="cb1-16">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;factor&gt; * &lt;term&gt;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;factor&gt; / &lt;term&gt;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;factor&gt;"</span>],</span>
<span id="cb1-17"></span>
<span id="cb1-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;factor&gt;"</span>:</span>
<span id="cb1-19">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+&lt;factor&gt;"</span>,</span>
<span id="cb1-20">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-&lt;factor&gt;"</span>,</span>
<span id="cb1-21">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(&lt;expr&gt;)"</span>,</span>
<span id="cb1-22">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;integer&gt;.&lt;integer&gt;"</span>,</span>
<span id="cb1-23">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;integer&gt;"</span>],</span>
<span id="cb1-24"></span>
<span id="cb1-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;integer&gt;"</span>:</span>
<span id="cb1-26">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;digit&gt;&lt;integer&gt;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;digit&gt;"</span>],</span>
<span id="cb1-27"></span>
<span id="cb1-28">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;digit&gt;"</span>:</span>
<span id="cb1-29">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9"</span>]</span>
<span id="cb1-30">}</span>
<span id="cb1-31"></span>
<span id="cb1-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"&lt;identifier&gt;"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EXPR_GRAMMAR</span></code></pre></div></div>
<div class="cell-output cell-output-display" data-execution_count="1">
<pre><code>False</code></pre>
</div>
</div>
</section>
<section id="simplifying-grammar-based-fuzzing" class="level2">
<h2 class="anchored" data-anchor-id="simplifying-grammar-based-fuzzing">Simplifying Grammar-Based Fuzzing</h2>
<p>Grammar-based fuzzing generates complex inputs for testing applications by systematically expanding grammar rules. The <code>simple_grammar_fuzzer</code> function begins with a start symbol (e.g., <code>&lt;start&gt;</code>) and iteratively expands it according to predefined grammar rules to create various expressions.</p>
<p>While effective, this approach is computationally expensive due to repetitive search and replace operations. Additionally, it may encounter expansion errors when it hits limits, such as reaching the maximum number of non-terminals.</p>
<p><strong>Activity: Using <code>nonterminals("&lt;digit&gt;&lt;integer&gt;")</code>, what non-terminals are extracted?</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
<p>The output is <code>["&lt;digit&gt;", "&lt;integer&gt;"]</code>, as these are the symbols enclosed in angle brackets.</p>
</details>
</section>
<section id="simple-grammar-fuzzer" class="level2">
<h2 class="anchored" data-anchor-id="simple-grammar-fuzzer">Simple Grammar Fuzzer</h2>
<p>Let’s put the grammars to use! The <code>simple_grammar_fuzzer</code> is a basic tool that generates random expressions by starting with a placeholder <code>(&lt;start&gt;)</code> and expanding it using a set of grammar rules. It replaces non-terminal symbols like <code>&lt;expr&gt;</code> or <code>&lt;term&gt;</code> with random elements according to these rules until a complete expression is formed. To prevent endless expansion, the fuzzer limits the number of placeholders and retries, though it’s not perfect and sometimes encounters errors.</p>
<div id="6f2f551a" class="cell" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> random</span>
<span id="cb3-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> re</span>
<span id="cb3-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> typing <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Any, Dict, List, Tuple</span>
<span id="cb3-4"></span>
<span id="cb3-5">Grammar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Dict[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, List[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>]]</span>
<span id="cb3-6"></span>
<span id="cb3-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> nonterminals(expansion):</span>
<span id="cb3-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r'</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[^&lt;&gt; ]</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>).findall(expansion)</span>
<span id="cb3-9"></span>
<span id="cb3-10"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> ExpansionError(<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exception</span>):</span>
<span id="cb3-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pass</span></span>
<span id="cb3-12"></span>
<span id="cb3-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> simple_grammar_fuzzer(grammar: Grammar, </span>
<span id="cb3-14">                          start_symbol: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;start&gt;"</span>,</span>
<span id="cb3-15">                          max_nonterminals: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>,</span>
<span id="cb3-16">                          max_expansion_trials: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb3-17">                          log: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-&gt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>:</span>
<span id="cb3-18">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Produce a string from `grammar`.</span></span>
<span id="cb3-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">       `start_symbol`: use a start symbol other than `&lt;start&gt;` (default).</span></span>
<span id="cb3-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">       `max_nonterminals`: the maximum number of non-terminals </span></span>
<span id="cb3-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">         still left for expansion</span></span>
<span id="cb3-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">       `max_expansion_trials`: maximum # of attempts to produce a string</span></span>
<span id="cb3-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">       `log`: print expansion progress if True"""</span></span>
<span id="cb3-24"></span>
<span id="cb3-25">    term <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> start_symbol</span>
<span id="cb3-26">    expansion_trials <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb3-27"></span>
<span id="cb3-28">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">while</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(nonterminals(term)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb3-29">        symbol_to_expand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> random.choice(nonterminals(term))</span>
<span id="cb3-30">        expansions <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> grammar[symbol_to_expand]</span>
<span id="cb3-31">        expansion <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> random.choice(expansions)</span>
<span id="cb3-32">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># In later chapters, we allow expansions to be tuples,</span></span>
<span id="cb3-33">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># with the expansion being the first element</span></span>
<span id="cb3-34">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(expansion, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">tuple</span>):</span>
<span id="cb3-35">            expansion <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> expansion[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb3-36"></span>
<span id="cb3-37">        new_term <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> term.replace(symbol_to_expand, expansion, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb3-38"></span>
<span id="cb3-39">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(nonterminals(new_term)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> max_nonterminals:</span>
<span id="cb3-40">            term <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> new_term</span>
<span id="cb3-41">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> log:</span>
<span id="cb3-42">                <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%-40s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (symbol_to_expand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" -&gt; "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> expansion), term)</span>
<span id="cb3-43">            expansion_trials <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb3-44">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb3-45">            expansion_trials <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb3-46">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> expansion_trials <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> max_expansion_trials:</span>
<span id="cb3-47">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> ExpansionError(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Cannot expand "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">repr</span>(term))</span>
<span id="cb3-48"></span>
<span id="cb3-49">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> term</span></code></pre></div></div>
</div>
<p>Now, we can fuzz with a grammar by calling the <code>simple_grammar_fuzzer()</code> function!</p>
<div id="f68523ba" class="cell" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>):</span>
<span id="cb4-2">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(simple_grammar_fuzzer(grammar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>EXPR_GRAMMAR, max_nonterminals<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>--((-+-((-+(1))))) / +(8) / (++(+-(--((+6))) - (+6.121) - (-+2)) + -4) + +-+++(-4 + +(--(8 / (((+7))) * 4 * (8 + -+9.7 * --5) + +70) * +++3 / 8)) / -9 / (-1.1)
--+-+1 + --+7 + (-2 + -4.06 / +-+---+620.4) - +-+8
(7.6) - +51 / -18
0.3 / -2 + +1 + -+((-+-0 * (--(9) + +(++63)) / ((0 * --+-+45.7)) + +++5)) / 1 / 3 * 6
8.9 / (((996)) * 5 + ---5) - 5 + ++3 / 8 * (-+-1176 + 2.3 * 3.0)
15.6 * (5.7 * +(4 * +5.0))
-+-7 - (--4 + 0 / (+5 / 8.9) * -+(1 * -(6) / -4 * 77) - (+-8.3)) - 1.0 + 8.7
(+2.20) / 3 + -+73.7 + 878
3 * +-877 - -2391 + -+7 * ((-4.5 + -+(7.1 * 07 - (+(--(((6) * -+-84)) + +(-(+-2 - ++-4.4 - 5)) - 2) - -(+((-7.5 / 17 + (736)))))))) + --++7 - ---1.57
+-((7 * 8)) + 2 + -(-0.18 + (-+(+((+((+5)) * (+1 - 019)))) * --+++(2) / ++(-+7 / (4 / 8.4 / ((2) / ((++(-7 / (1)) + 4) * 55 + (+0 * +-(-+++0 + -91194) - -(-(088)) * (+17.1))) * 8.09)) / -+-3 * +33.7) + 0)) + -49</code></pre>
</div>
</div>
<p>While our fuzzer does the job in most cases, it has a number of drawbacks.</p>
<p><strong>Activity: What drawbacks does <code>simple_grammar_fuzzer()</code> have?:</strong></p>
<p><strong>A. It has a large number of string search and replace operations</strong></p>
<p><strong>B. It may fail to produce a string (i.e., throw an <code>ExpansionError</code>)</strong></p>
<p><strong>C. It often picks some symbol to expand that does not even occur in the string</strong></p>
<p><strong>D. All of the above</strong></p>
<details>
<summary>
Click to Expand for the Answer
</summary>
The answer is D!
</details>
</section>
<section id="some-grammars" class="level2">
<h2 class="anchored" data-anchor-id="some-grammars">Some Grammars</h2>
<p>Here’s a grammar for <code>cgi_decode()</code> introduced in the <a href="https://www.fuzzingbook.org/html/Coverage.html">Coverage</a> chapter.</p>
<div id="cdd109db" class="cell" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1">CGI_GRAMMAR: Grammar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb6-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;start&gt;"</span>:</span>
<span id="cb6-3">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;string&gt;"</span>],</span>
<span id="cb6-4"></span>
<span id="cb6-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;string&gt;"</span>:</span>
<span id="cb6-6">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;letter&gt;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;letter&gt;&lt;string&gt;"</span>],</span>
<span id="cb6-7"></span>
<span id="cb6-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;letter&gt;"</span>:</span>
<span id="cb6-9">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;plus&gt;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;percent&gt;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;other&gt;"</span>],</span>
<span id="cb6-10"></span>
<span id="cb6-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;plus&gt;"</span>:</span>
<span id="cb6-12">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+"</span>],</span>
<span id="cb6-13"></span>
<span id="cb6-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;percent&gt;"</span>:</span>
<span id="cb6-15">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%&lt;hexdigit&gt;&lt;hexdigit&gt;"</span>],</span>
<span id="cb6-16"></span>
<span id="cb6-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;hexdigit&gt;"</span>:</span>
<span id="cb6-18">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7"</span>,</span>
<span id="cb6-19">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f"</span>],</span>
<span id="cb6-20"></span>
<span id="cb6-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;other&gt;"</span>:  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Actually, could be _all_ letters</span></span>
<span id="cb6-22">        [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>],</span>
<span id="cb6-23">}</span></code></pre></div></div>
</div>
<div id="fb97e52a" class="cell" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>):</span>
<span id="cb7-2">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(simple_grammar_fuzzer(grammar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CGI_GRAMMAR, max_nonterminals<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>%292
+
-
%84-+
%70
-
%de%0d%08
++3%f6
3c
%43+</code></pre>
</div>
</div>
</section>
<section id="grammar-toolbox" class="level2">
<h2 class="anchored" data-anchor-id="grammar-toolbox">Grammar Toolbox</h2>
<p>In your own grammar toolbox there are many different ways in which you could use grammars. It is important to note that grammars are not very effective in meeting complex constraints. The example of this that is given in the Fuzzing Book is that it would be hard to express a port range that is supposed to be between 1024 and 2048.</p>
<p>There are a few different reasons why this would be hard to express, one of them being that there is a limited range and thus the grammar could not allow a number larger than 2048. This means that there would have to be specific rules in place to make sure that 2048 is valid and 2049 is invalid. This can become extremely complex to express very quickly when having to set these types of parameters.</p>
<p>An example where grammars may be more practical would be using grammars as mutation seeds. The reason that grammars may be useful as an input is that they almost always can produce valid inputs from a syntactical standpoint. This is useful because when inputs are syntactically valid they can reveal other areas in which inputs may fail.</p>
<p>Another thing worth mentioning is escape characters that can be used for delimiting non-terminals in grammars. This can be useful whenever you want to manipulate the input or output to have a specific value.</p>
<div id="ee150940" class="cell" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1">simple_nonterminal_grammar: Grammar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb9-2">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;start&gt;"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;nonterminal&gt;"</span>],</span>
<span id="cb9-3">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;nonterminal&gt;"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;left-angle&gt;&lt;identifier&gt;&lt;right-angle&gt;"</span>],</span>
<span id="cb9-4">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;left-angle&gt;"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;"</span>],</span>
<span id="cb9-5">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;right-angle&gt;"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;"</span>],</span>
<span id="cb9-6">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;identifier&gt;"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"id"</span>]  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># for now</span></span>
<span id="cb9-7">}</span></code></pre></div></div>
</div>
<p>(Note that this does not work with <code>simple_grammar_fuzzer()</code>, but rather with the <code>GrammarFuzzer</code> class we’ll introduce in the next chapter.)</p>
<p>There are also shortcuts that can be implemented to manipulate how symbols can be used in recursion.</p>
<ul>
<li><code>&lt;symbol&gt;?</code> indicates that <code>&lt;symbol&gt;</code> is optional meaning it can occur 0 or 1 times.</li>
<li><code>&lt;symbol&gt;+</code> indicates that <code>&lt;symbol&gt;</code> can occur 1 or more times repeatedly</li>
<li><code>&lt;symbol&gt;*</code> indicates that <code>&lt;symbol&gt;</code> is completely optional.</li>
</ul>
<p>You can also use parentheses to apply the shortcut to multiple symbols. For instance, <code>(&lt;symbol&gt;&lt;char&gt;)?</code> would indicate that both <code>&lt;symbol&gt;</code> and <code>&lt;char&gt;</code> can optionally occur 0 or 1 times.</p>
</section>
<section id="checking-grammars" class="level2">
<h2 class="anchored" data-anchor-id="checking-grammars">Checking Grammars</h2>
<p>Grammars are introduced as strings making it somewhat easy for there to be errors. There is a solution to this. The helper function <code>is_valid_grammar()</code> can assist in making sure that your grammars are working correctly. This function iterates through a grammar to make sure that all symbols are defined and in use. It also identifies if all symbols are reachable from the start symbol. This helper function should be implemented whenever you are using grammars to assure that the inputs you are giving are what you expected them to be.</p>
</section>
<section id="key-takeaways" class="level2">
<h2 class="anchored" data-anchor-id="key-takeaways">Key Takeaways</h2>
<p>In this blog post, we explored the versatility of grammars in generating syntactically valid inputs and their use in mutation-based fuzzing. Grammars, when combined with character classes and operators, enhance the ease of producing more complex input patterns. How can we further leverage these extensions to streamline input generation during the software testing process for our tools?</p>
<div class="callout callout-style-simple callout-note no-icon callout-titled" title="Reference">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Reference
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Unless otherwise noted, the source code segments in this article are excerpted directly from the <a href="https://www.fuzzingbook.org/">Fuzzing Book</a>. The authors of this online book licensed the source code and its written content under the <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">BY-NC-SA 4.0 Creative Commons License</a>. More details about the license for the Fuzzing Book are available in the <a href="https://github.com/uds-se/fuzzingbook/blob/master/LICENSE.md">The Fuzzing Book License</a>.</p>
</div>
</div>
</div>
<p><i class="fa-solid fa-circle-left" aria-label="circle-left"></i> <a href="../../blog/">Return to Blog Post Listing</a></p>


</section>

 ]]></description>
  <category>post</category>
  <category>software engineering</category>
  <category>fuzzing book</category>
  <guid>https://www.developerdevelopment.com/blog/fb6-fall2024/</guid>
  <pubDate>Wed, 30 Oct 2024 00:00:00 GMT</pubDate>
</item>
</channel>
</rss>
