<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ron Teller  on Medium]]></title>
        <description><![CDATA[Stories by Ron Teller  on Medium]]></description>
        <link>https://medium.com/@ron.teller.8?source=rss-d6ee81239966------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Gkzmn5nH28eqUnYZ</url>
            <title>Stories by Ron Teller  on Medium</title>
            <link>https://medium.com/@ron.teller.8?source=rss-d6ee81239966------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 11:23:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ron.teller.8/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Make Your Code Behave Like You Want and Stay That Way]]></title>
            <link>https://medium.com/dynamicyield-techblog/how-to-make-your-code-behave-like-you-want-and-stay-that-way-f9a46451e6f0?source=rss-d6ee81239966------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9a46451e6f0</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-requirements]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Ron Teller ]]></dc:creator>
            <pubDate>Mon, 13 Jan 2025 11:09:13 GMT</pubDate>
            <atom:updated>2025-02-05T21:28:44.915Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F4Q9vTJvd_ouQXN-cfy2UA.png" /></figure><p>Have you ever struggled to fix a bug or implement a feature, only to realize that unclear software behavior was the root cause? You’re not alone. As projects grow, maintaining software becomes harder, often due to a lack of clarity about how the system is supposed to behave.</p><p>Your first thought might be, “Isn’t that what documentation is for?” Not exactly.</p><p>The solution? Structured, well-defined <strong><em>Software Requirements</em></strong>.</p><p>In this post, I will show you why writing software requirements offers a solution for the above problems and why documentation is NOT a substitute. I will also introduce a novel “<strong>s</strong>pecify, <strong>t</strong>est and <strong>i</strong>mplement” <strong>m</strong>ethod to programming (<strong>STIM</strong>) that makes sure your code is aligned with your requirements.</p><h3>Why documentation isn’t good enough</h3><p>Let’s assume I asked you to document how a baseball game works. You might write something like this:</p><blockquote>“… A player gets 3 chances to hit the ball, and then they are out, or if an opposing team player touches them when they are in the middle of running.”</blockquote><p>Can you spot any problems the above sentence might introduce?</p><p>- <strong>Ambiguity</strong>: Descriptions can be open to interpretation. For example:</p><blockquote>“A player gets 3 chances to hit the ball, and then they’re out.”</blockquote><p>What counts as a “chance”? What if the player is interrupted?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SF1by2719Yx0DoF7gXAW0w.png" /></figure><p>- <strong>Lack of structure</strong>: It’s hard to reference specific rules without a clear numbering system.</p><p>In a lengthy document, finding relevant details can be time-consuming.</p><p>- <strong>Outdated content</strong>: Developers may skip updating documentation after changes.</p><p>If old rules remain while new ones are added, contradictions can arise.</p><p><em>So, if documentation isn’t good enough, what should you do?</em></p><h3>Solution: Write requirements instead!</h3><p>Let’s examine a structured, well-defined approach for writing requirements:</p><blockquote><strong>Rule 5: Playing the Game</strong></blockquote><blockquote>• <strong>5.09: Making an Out</strong></blockquote><blockquote>• <strong>5.09(a)(1):</strong> A batter is out when a third strike is legally caught by the catcher.</blockquote><blockquote>• <strong>5.09(b)(4):</strong> A runner is out when they are tagged while off their base.</blockquote><p>Now that’s more like it!</p><p>You will notice that the rules are no longer ambiguous and have structure, thanks to the following properties:</p><ol><li><strong>Atomic</strong> — The rules have been broken down into individual sections. Each section contains exactly 1 rule.</li><li><strong>Referenceable</strong> — Each individual rule is given its own unique number, and you can clearly reference it by its number.</li><li><strong>Unambiguous</strong> — The rules are well defined in a way that can’t be interpreted differently by you and me. Each word is carefully chosen.</li></ol><h3>Why do we need them?</h3><p>Can you imagine the confusion if baseball rules were written as “documentation” without proper structure and clarity? There would be lots of arguments if a play was legal or not!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5WMYsqKvcNBl4jmDPksl6w.png" /></figure><p>The same can happen when we write software documentation — we haven’t <em>really</em> decided how we want our software to behave. The developer interprets many of the details, and there are often miscommunications between what the client wants and what the developer thinks the client wants.</p><p><em>Requirements enable you to write down exactly what you and your client want in a way that can’t be misinterpreted.</em></p><h3>So, what are software requirements?</h3><p><strong><em>Software requirements are a set of rules that dictate exactly how a software should behave.</em></strong></p><p>If your code does <strong>not do</strong> something that <strong>is specified</strong> in the requirements, there <strong>is a bug</strong>.</p><p>If your code <strong>does</strong> something <strong>not specified </strong>in the requirements, it’s <strong>also a bug</strong>. (Or you haven’t specified everything you need to in the requirements, which in that case you need to add it)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OWHF7MLyIWrvsFZIQjMrWw.png" /></figure><p>If our software is expected to behave in a certain way, it must be explicitly and unambiguously specified in the software requirements. It should not be possible for two different people to understand the same requirement in two different ways.</p><h3>How to write software requirements</h3><p>Writing software requirements is no different than writing baseball rules, as you saw above. You are just writing them for software instead.</p><p>When writing software requirements, we must follow the principles of <strong>Atomicity</strong>, <strong>Referenciability,</strong> and <strong>Unambiguity.</strong></p><p>For example, if we were to specify the “sign up” feature for an email service, it might look something like this:</p><pre>6. Sign up<br>  6.1 Username validation<br>    6.1.1 Username must be at least 1 valid character<br>    6.1.2 Username can&#39;t be longer than 32 valid characters<br>    6.1.3 Username can only contain alphanumeric characters<br>  6.2 Password validation<br>    6.2.1 password must contain at least 8 characters<br>    ...</pre><p>We must break down the requirements into individual atomic requirements. Usually, a tree structure is used to group them logically.</p><p>Now let’s check that the above requirements maintain the 3 properties:<br><strong>Atomic</strong> — Each requirement can’t be broken down into more requirements, so we are good.</p><p>For example, this <strong>wouldn’t</strong> be considered atomic:</p><pre>6. Sign up<br>  6.1 Username<br>    6.1.1 Username must be between 1 to 32 alphanumeric characters</pre><p>Since it contains 3 different system requirements.</p><p><strong>Referenceable</strong> — All requirements are numbered and thus referenceable.</p><p><strong>Unambiguous</strong> — We explicitly state what makes a username valid. It can’t be understood in more than one way.</p><h3>STIM — Specify, Test, and Implement Method</h3><p>The <strong>S</strong>pecify, <strong>T</strong>est and <strong>I</strong>mplement <strong>M</strong>ethod (<strong>STIM</strong>) makes sure that your code aligns with your software requirements or that, at the very least, you will be able to monitor which requirements are not being tested for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDzsQZZsWUOmtIa4T13j_Q.png" /></figure><p>When using STIM, the first thing you must do is specify what change you want in the software requirements. Any software change needs to first be defined as a requirement.</p><p><strong>Specify</strong> — Specify your software requirement. If you add a new feature, such as “sign up” for your email service, specify it in the requirements.</p><p>Example:</p><pre>6. Sign up<br>  6.1 Username<br>    6.1.1 Username must be at least 1 valid character<br>    6.1.2 Username can&#39;t be longer than 32 valid characters<br>    ...</pre><p>If you change a requirement, such as the maximum number of characters a username can have, update the correct requirement (6.1.2).</p><p><strong>Test</strong> — The next step is to write tests for the new requirement you have just added/changed. But you won’t write just any tests. You will write tests specifically for the individual requirements you have added or changed. Each test will test and reference a single requirement.</p><p>The tests look something like this:</p><pre>@(requirement=&quot;6.1.1&quot;)<br>test_username_minimum_length()<br><br>@(requirement=&quot;6.1.2&quot;)<br>test_username_maximum_length()</pre><p>These tests are absolutely crucial in keeping the code aligned with the requirements.</p><p><strong>Implement</strong> — Code your feature. After the tests pass, you know that you have made your “<strong><em>code behave like you want</em></strong>” in the requirements. And with the help of your tests, you can be sure that you will “<strong><em>keep it that way</em></strong>.”</p><h3>Implementing STIM</h3><h4>Leveraging AI</h4><p>As AI capabilities to generate code continue to evolve, less human intervention is required to write code. What remains for us is to specify for the AI how we want our software to behave.</p><p>Using STIM (<strong><em>specify</em></strong>, <em>test</em> and <em>implement</em>), the only part we humans will need to do is <strong><em>specify</em></strong>, and AI will take care of the <em>test</em> and <em>implement</em> parts.<br>People who know how to <strong><em>specify</em></strong> software requirements will be able to leverage AI to generate code in an efficient manner, providing an advantage over competitors who don’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rv7kRfHPCGI5grgWmH1UYA.png" /></figure><h4>Empowering all contributors to drive impact</h4><p>All contributors, including product managers, QA, and developers, can read and understand the requirements written in plain English, effectively communicate about the software, and propose changes to the requirements. The requirements are written in a single place and format that will make it effective to propose changes and drive impact for the product.</p><h4>Knowledge retention = Faster onboarding = Being productive</h4><p>When a newcomer joins the team, it can take a long time for them to get on board and become productive. Knowledge of the system is essential for driving impact, and the faster we can acquire that knowledge, the faster we can become truly productive. Furthermore, if a senior member leaves the team, it creates a vacuum of knowledge since they take with them knowledge only they know. Software requirements ensure that knowledge stays with us.</p><h4>Effective communication</h4><p>Do not underestimate the power of a shared vocabulary and internal company jargon. They enable us to communicate what is on our minds effectively. This happens all around us and in our day-to-day lives.</p><p>Take bowling as an example. There is a special term for knocking down all 10 pins at once — a <strong>strike </strong>and a <strong>spare</strong> if it takes you two tries. It would be much harder to say “knocked down all 10 in one roll” all the time. You will notice that in every sport, field of science, and area of life, we as humans have created new words to describe things around us to communicate in an efficient manner. Software requirements help coin these new terms and document them.</p><h3>Start Investing In Your Software’s Future</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LQQtLJ16yzr0LZZZw9Ac4w.png" /></figure><p>I hope I have demonstrated to you the benefits of software requirements and how they tackle common pitfalls in software development. It might require a higher upfront investment (writing the requirements), but it pays off in the long run.</p><p>The longer a software project continues growing, the more complex and messier it becomes. <strong>If you aren’t proactively working to maintain order, the maintenance costs of tomorrow will inevitably increase exponentially.</strong></p><p><strong>Where to start?<br></strong>You don’t need to have written software requirements for your whole existing system before you can start adding new requirements. You can start by writing requirements for a new feature you need to implement <em>today</em> — and slowly piece the puzzle together by writing software requirements for the rest of the existing software.</p><p>Start investing today, and you will soon realize that the benefits of clarity, reduced ambiguity, and a single source of truth will return its dividends multifold and ensure steady development progress in the long term.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9a46451e6f0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dynamicyield-techblog/how-to-make-your-code-behave-like-you-want-and-stay-that-way-f9a46451e6f0">How to Make Your Code Behave Like You Want and Stay That Way</a> was originally published in <a href="https://medium.com/dynamicyield-techblog">DynamicYield Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>