<?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 Vlad Lyga on Medium]]></title>
        <description><![CDATA[Stories by Vlad Lyga on Medium]]></description>
        <link>https://medium.com/@vladlyga?source=rss-50f0c8943d27------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jqbqTYlFBV4VLs0BMQaLGQ.jpeg</url>
            <title>Stories by Vlad Lyga on Medium</title>
            <link>https://medium.com/@vladlyga?source=rss-50f0c8943d27------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 12:13:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vladlyga/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[Moving Towards an Effective Yet Supportive and Inclusive Code Review Culture]]></title>
            <link>https://medium.com/better-programming/moving-towards-effective-yet-supportive-and-inclusive-code-review-culture-da998a7bc35b?source=rss-50f0c8943d27------2</link>
            <guid isPermaLink="false">https://medium.com/p/da998a7bc35b</guid>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Vlad Lyga]]></dc:creator>
            <pubDate>Thu, 09 Feb 2023 10:13:41 GMT</pubDate>
            <atom:updated>2023-02-10T19:43:59.422Z</atom:updated>
            <content:encoded><![CDATA[<h4>How different contexts can improve code reviews</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JRHu-GfNInEOKaDj" /><figcaption>Photo by <a href="https://unsplash.com/@judmackrill?utm_source=medium&amp;utm_medium=referral">Jud Mackrill</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Writing code may be one of the craziest things I do.</p><p>It’s hard, and sometimes, the result surprises even me, the author. After all the hard work of getting everything factored, working, and passing tests, I’m elated as I proudly look at the result — another small masterpiece — until the code review comes.</p><p>Reviewing code and getting my code reviewed became an integral part of my developer experience. Depending on which side you’re on at a given review it can be a great opportunity to learn, teach, or problem-solve together. On top of that, code reviews are well-established practices for upholding and improving our code — and code is the internal quality of our products.</p><p>But I’ve also experienced the kind of code review that was ineffective and, on occasion, stressful, frustrating, and all around — a missed opportunity.</p><p>Fortunately, there is a fix — and it starts with the context.</p><blockquote>“There are few if any context-free solutions, but many valid context-specific ones.” — Dave Snowden</blockquote><h3>What We Look for In a Code Review?</h3><p>We might have different expectations from a code review, depending on the context. Participants and their roles, the type and size of the feature, and which stage of the software development lifecycle (SDLC) we’re in, can help us understand which context we’re in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q_fn2D4M4HdaEgoThm0SNw.png" /><figcaption>Understand which context you are in | image by author</figcaption></figure><h3>Different Contexts of a Code Review</h3><p>Here are the different contexts of a code review and what to look for in each:</p><h4><strong>Problem-solving</strong></h4><p>Use the power of the group to devise and evaluate the best solution for your problem. This is especially effective when you are in the early stages of a new design or planning to refactor for new functionality.</p><p>Challenge: Intimate understanding of the problem is needed to find subtle issues within the solution. Pick your partner wisely.</p><p>It can easily be confused with defect finding, but it’s not the same.</p><p>In defect finding, we aim to discover bugs and defects in our solution, but problem-solving is about finding the most appropriate solution in the first place.</p><h4><strong>Defect finding</strong></h4><p>Now that an appropriate solution path has been chosen and the first lines of code have been written, it’s time to pause and see if you can discover bugs and defects in the solution. The solution is reviewed to ensure the overall factoring makes sense, the right abstractions were chosen, and core algorithms can perform what is needed.</p><p>Challenge: Deep domain knowledge and understanding of the problem space are needed to discover subtle defects, bugs, and other quality-related issues.</p><h4><strong>Maintaining norms</strong></h4><p>When talking about norms, we discuss maintaining organizational preference. These things may not be essential to maintaining a healthy code base and include code formatting, common idioms, and styling.</p><h4><strong>Gatekeeping</strong></h4><p>Contrary to the “shared code” ownership that dilutes responsibility, I am a strong proponent of the “your code is your code” view. This means that each team has one or more repos they own, and each part of the repo tree is owned by someone known as the code owner.</p><p>For a code owner, any code coming from ‘outside’ (usually outside your team) is something to stay aware of. We want to protect our code from outside contributions that might not be experts in our domain.</p><p><strong>Important</strong>: this goes beyond readability.</p><p>When reviewing code in the gatekeeping context, we look for things that do not align with our design principles, compromise the language of our service, or break the conceptual wholeness of our design.</p><h4><strong>Accident prevention</strong></h4><p>When near or at ‘code completion,’ we rarely seek big, design-altering inputs from a code review. But we still would like another pair of eyes to ensure we didn’t miss test corner cases, for example, or find bugs related to concurrency, etc.</p><p>This may sound like ‘defect finding,’ but it happens in a later stage and with a much-reduced scope. Here, the demand for deep knowledge and understanding of the problem is reduced; instead, we rely on high technical proficiency.</p><h4><strong>Education</strong></h4><p>When reviewing code with a new team member, for example, we would like to introduce them to the complexities of our problem space and explain the idiosyncrasies of our code base.</p><p>While performing the code review, we emphasize education and use this opportunity for mentoring, learning, and disseminating knowledge.</p><h4><strong>Readability</strong></h4><p>We want to ensure we only accept clean and coherent code. Therefore, a readability review is the time and place to enforce and ensure any submitted code follows these objective standards.</p><p>Challenge: Everyone has their own perception of code cleanliness and readability. This means that code is often reviewed and accepted based on subjective opinion, creating inconsistencies in quality, coherence, and cleanliness.</p><p>To prevent this, create team and organization-wide style guides. These guides will be the objective definitions of clean and readable code. Based on these guides, you can objectively assess the submitted code.</p><h3>Notes For Reviewers</h3><h4><strong>It is not your code</strong></h4><p>Sometimes, you may become a co-author of the change, especially for bigger features or early in the development cycle. But, in the context of a code review, please remember that the reviewed code is not your code but the author&#39;s.</p><p>The implications here are:</p><ul><li>Comments in the spirit of “I would do it differently” rarely serve any purpose</li><li>When the author disagrees with your suggestions, consider if they may be right. Even if you are not convinced, remember it is still their code.</li></ul><h4><strong>Own the comments</strong></h4><p>Comments and requests that you open as a reviewer — should only be closed/resolved by you. If you feel pressure from the author to close comments, ask yourself if it’s because they feel you slow them down.</p><p>We do not want to hold the PR ‘hostage’ by our comments.</p><p>While you should insist on some things because insisting is, sometimes, the only way to fix something that otherwise won’t be fixed, the following behaviors may help you be more efficient:</p><ul><li>Be respectful</li><li>Focus on the ‘Why’</li><li>Be objective (refer to authoritative sources as much as possible)</li><li>Be fast</li></ul><h4><strong>Speed</strong></h4><p>Even the best code review will come under pressure if it takes a day to arrive. Answering clarification questions an hour or a day after submitting makes a world of difference. Delivering timely and fast reviews is a sure way to alleviate many of the usual complaints about strictness, etc.</p><p>Be fast.</p><h3>For Change Authors</h3><h4><strong>Choose reviewers wisely</strong></h4><p>A good reviewer has the following qualities:</p><ul><li>Regularly works on the relevant code</li><li>Has relevant domain knowledge</li><li>Framework/language experts</li></ul><p>The best reviewers are usually code owners. Often, they can give you the most thorough and correct review.</p><h4>Preparing your code for review</h4><ul><li>Consolidate TODOs: try to leave as few TODO items as possible. <br>Only real dilemmas should be left.</li><li>Set the context: give a good description and link to a ticket to explain the problem and the proposed solution.</li><li>Make sure you’ve cleaned the commit history (git rebase and squash)</li><li>Check that all tests have passed</li></ul><h4>Resolving comments</h4><p>Avoid resolving/closing comments or change requests unilaterally.</p><p>Yes, it is your code, and sometimes you will find yourself under pressure to approve this PR now, but treating the reviewer comments as a barrier to PR approval, instead of seeing it as valuable input to improve work — is a sure way to devalue the entire process.</p><h4>Getting to LGTM</h4><p>It is the code authors — yours— responsibility to get the code approved so it can be merged. This has several implications:</p><ul><li>Do not fire and forget. Actively seek reviewers and make sure the code is reviewed</li><li>Fix it. If reviewers say they do not understand something in your code, work on clarifying your code, comments, documentation, etc.</li><li>Resolve conflict by trying to reach a consensus with the reviewer. They are on your side</li></ul><h3>Improving the Design of Your Process</h3><p>Focus on convergent practices.</p><h4>When working on smaller features or stable code bases</h4><ul><li>Feature small, localized changes (the bulk of a change should usually be in one file/class)</li><li>Short-lived branches (1–3 days max)</li><li>90% of reviews should not need more than two reviewers (most should do with one)</li><li>Pair program with someone who is a qualified reviewer for the code so your code is reviewed as you go along</li><li>Lean into in-person reviews where the reviewee can walk the reviewer through the code and the reviewer can ask questions online</li><li>During the review, focus on education, readability, maintainability, and accident prevention</li></ul><h4><strong>When working on big features or greenfield projects</strong></h4><ul><li>Start reviewing early</li><li>May have longer-lived branches (up to two weeks)</li><li>Attach supporting documentation</li><li>During the review, focus on conceptual integrity, good design, mutual problem solving, education, defect finding, gatekeeping</li><li>Keep some architects/leads for the first several iterations</li></ul><h3>Flow</h3><p>Every big task design starts with a design review. A big task is anticipated to take two or more weeks.</p><ul><li>Big picture: High-level look at the initial design. Very little to no code, mostly reviewing documents. The focus is on understanding requirements and preparing questions for the following reviews. Reviewers and contributors are architects and stakeholders.</li><li>Intermediate designs: A series of reviews that use partial code. The code here is mostly scaffolding. Usually, we would like to design one or more POCs here and review them. Reviewers and (at least partly implementers) are architects/tech leads.</li><li>Early code review: Looking for subtle design flaws and errors. Reviewers should have a good understanding of requirements.</li><li>Code review: The flow is similar to the ‘stable/legacy systems’ flow.</li></ul><p>Thanks for reading. Stay tuned for more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da998a7bc35b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/moving-towards-effective-yet-supportive-and-inclusive-code-review-culture-da998a7bc35b">Moving Towards an Effective Yet Supportive and Inclusive Code Review Culture</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Going beyond unit tests — here’s how to decide which higher level test to write and when]]></title>
            <link>https://blog.devgenius.io/what-test-is-this-the-language-of-tests-is-overloaded-and-it-can-be-hard-to-know-which-is-which-e2c0d86c9739?source=rss-50f0c8943d27------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2c0d86c9739</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Vlad Lyga]]></dc:creator>
            <pubDate>Tue, 20 Sep 2022 07:09:10 GMT</pubDate>
            <atom:updated>2023-02-07T09:12:01.092Z</atom:updated>
            <content:encoded><![CDATA[<h3>Going beyond unit tests — here’s how to decide which higher level test to write and when</h3><h4>Unit tests are not great at detecting inconsistencies between integrated units, or checking a whole system build. Learn which types of higher level testing to use and when.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*lGciOiVD2cs6mwKXl3Okiw.jpeg" /></figure><p>As an architect, I get to work with smart people in different teams. But I continue to see one recurring issue of having different meanings for the same testing concepts. When the same word has multiple meanings makes the language around testing overloaded and confusing.</p><blockquote>Hey, why did you put a UnitTest in our component tests folder?</blockquote><h4>This article is a guide to help you choose the right test for almost any situation.</h4><figure><img alt="Summary table image" src="https://cdn-images-1.medium.com/max/1024/1*XtOUMWXMQHbs5ZfFysnrMg.png" /><figcaption>Summary table</figcaption></figure><p>Read below for expanded explanation on the above table.</p><h3>Our example system</h3><p>Let’s imagine we have a system of 4 ‘things’ A, B, C, and D. These can be microservices, or components in a monolith.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vNLZcFjlKzoG4c1O2U1jgA.png" /><figcaption>Service A B C D</figcaption></figure><h3>Unit Testing</h3><p><strong>The goal</strong></p><p>Test individual units of composition for being fit to use</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S3lB5Ugo8zMMG_FaIAMKjQ.png" /><figcaption>unit test diagram (source: Author)</figcaption></figure><p><strong>Defining characteristics</strong></p><ul><li>Testing methods, functions, etc</li><li><a href="https://en.wikipedia.org/wiki/White-box_testing">Whitebox(ish)</a></li><li>Easiest to write, fastest to run, completely automated</li></ul><p><strong>ProTip</strong></p><ul><li>Tests should be guided by an independent oracle of correct behavior. Use a source of truth external to yourself, and resist ‘inventing’ test cases.</li></ul><h3>Integration Testing</h3><p><strong>The goal</strong></p><p>Detect inconsistencies between integrated software units</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AVzn9AzDC2pyTD7-ctx1UQ.png" /><figcaption>integration test (source: Author)</figcaption></figure><p><strong>Defining characteristics</strong></p><ul><li>Test combined units of software as aggregates</li><li><a href="https://en.wikipedia.org/wiki/Black-box_testing">Black-box</a></li><li>Aggregates (B and C in this case) are executed in the context of real-world scenarios</li><li>More challenging to write relative to Unit Tests, not everything can be automated</li></ul><p><strong>ProTip</strong></p><ul><li>Requirements guide tests</li></ul><h3>Functional Testing</h3><p><strong>The goal</strong></p><p>Test whether the part of the system meets its expected behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UUiOmK4parjeCtE878PdXg.png" /><figcaption>functional test (source: Author)</figcaption></figure><p><strong>Defining characteristics</strong></p><ul><li>Testing whole slices of functionality software (different than Integration Test)</li><li>May interact with dependencies (different than Integration Test)</li><li>Executed in the context of real-world scenarios</li><li>Black-box</li><li>Even harder to write than Integration Tests, includes significant manual scenarios</li></ul><p><strong>ProTip</strong></p><ul><li>Tests guided by the business requirements</li></ul><h3><strong>System (aka E2E) Testing</strong></h3><p><strong>The goal</strong></p><p>To check if the system meets its specifications and purpose</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WAexl5YMP3THmZuK9hNQUA.png" /><figcaption>system test diagram (source: Author)</figcaption></figure><p><strong>Defining characteristics</strong></p><ul><li>The system is executed in the context of the real-world <strong>field use</strong></li><li>Testing the whole integrated system with dependencies</li><li>Black-box (what the system does)</li><li>The hardest to automate and will require the most manual work relative to other tests to execute</li></ul><h3>Automation gradation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VTL8L6ZonoHT9VTUt9Bc7g.png" /></figure><h3>Closing Words: Why do we test?</h3><p>As Gerald M. Weinberg beautifully wrote in his <a href="https://www.amazon.com/Perfect-Software-Other-Illusions-Testing/dp/0932633692">“Perfect Sofwtare”</a> — as humans, we are not perfect thinkers. But we still need to make decisions about software. These decisions can be risky. <br>Testing can provide information to reduce risk when making decisions.</p><p>Vladi</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2c0d86c9739" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/what-test-is-this-the-language-of-tests-is-overloaded-and-it-can-be-hard-to-know-which-is-which-e2c0d86c9739">Going beyond unit tests — here’s how to decide which higher level test to write and when</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Not all testing is equal, or useful, and some is even damaging]]></title>
            <link>https://blog.devgenius.io/not-all-testing-is-equal-or-useful-and-some-is-actually-damaging-9b2b130f96f3?source=rss-50f0c8943d27------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b2b130f96f3</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[unit-testing]]></category>
            <dc:creator><![CDATA[Vlad Lyga]]></dc:creator>
            <pubDate>Thu, 02 Jun 2022 18:49:12 GMT</pubDate>
            <atom:updated>2022-06-03T21:18:29.922Z</atom:updated>
            <content:encoded><![CDATA[<h4>Software/Testing</h4><h4>Let’s explore how some of the popular beliefs about testing can hurt our testing effectiveness, and what we can do about it.</h4><p>If you are in the business of writing code, there is a big chance you also write tests for it. Probably most of these are unit tests. Unit tests are small, relatively easy, and can even be fun to write. Run quickly they give this immediate sense of satisfaction. Oh, and I love seeing that “green bar”!</p><p>It’s hard to underestimate the importance of testing in achieving quality. But, as the title says, not all testing is equal, or useful, and some can be even damaging. In this article, we’ll explore how to shift the balance in our favor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YG1smjIKRBi3AIKLhkNC6g.jpeg" /><figcaption>Finding the balance (Image by <a href="https://pixabay.com/users/kellepics-4893063/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=7223504">Stefan Keller</a>)</figcaption></figure><h3>Unit tests give the confidence to change the code</h3><p>Being <a href="https://en.wikipedia.org/wiki/White-box_testing">white-box</a>, unit tests can serve as change detectors. <br>This can be beneficial when the change was inadvertently made.<br>But what happens when you want to change a piece of code purposefully, and tens of tests fail?</p><p>Ask every developer what code is easier to change?</p><ul><li>code that has little other code that depends on it</li><li>code that has a lot of other code that depends on it</li></ul><p>Anyone with experience will recognize that code with little dependencies is easier to change since there is a lot less that will break. It means that we get precisely the opposite of what we tried to achieve.<br>Writing unit tests is similar to pouring cement on the code base, because every code change will require a coordinated change to the tests.</p><blockquote>There are claims that there is a way to write tests in such a way that they won’t need changing when the underlying code changes. I don’t know what these tests are testing, but it’s not the underlying functionality and so carries little value.</blockquote><h3>Unit tests speed development</h3><p>Tests are not free. Tests are code. We arrange them in packages and modules. This requires design and maintenance. Some research suggests unit tests can take up to 30% more development time for some teams. <br>There better be a fantastic ROI here, right?</p><p>Keep on reading for tips on maximizing unit-testing ROI.</p><h3>Tests are easier to understand than the code</h3><p>This ties to the common misconception that you can write tests that can be simpler than the code they test. A test cannot be less complex than the code it tests. Because then it carries less info than code, and such a test cannot possibly test the code underneath. Adding to this all the ‘<em>wiring</em>’ that we need to add to run a test (mocks, fixtures, expectations, etc.) we end up with much more test code than code under test.</p><p>See the next section to understand why having a lot of test code is not good.</p><h3>Tests are more reliable (contain fewer bugs) than the code</h3><p>Sometimes we see claims that you can take more care when writing tests to make them bug-free. Whether we want it or not, we introduce a certain amount of bugs for any amount of code written.<br>There are different statistics ranging wildly between 3–50 bugs per 1KLOC. <br>In any case, your test code will include the same proportion of bugs as the production code. Since we know that usually, we have more test code than production code — the test code will fail at a higher rate than the production code. Meaning at any given point of time, some of the tests should fail, but they are not failing, or the test is not even testing what we think it tests because of bugs. <br>Doesn’t it make you think differently about what that green bar means, eh?</p><p>A good piece of advice to anyone who claims to be able to concentrate better and write tests with fewer bugs than the code — use the same technique on the production code itself.</p><blockquote>If I changed the code, and after changing it, I run the tests, and the bar turned green, what does it mean?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*qbb8Mt_L0vr51dxtDy_-EQ.png" /><figcaption>“If I changed the code, and after changing it I run the tests and the bar turned green, what does it mean?”</figcaption></figure><h3>We write unit tests because it helps us to find bugs</h3><p>We have to recognize that most of the time we do only partial and random unit testing. Ask yourself how do you know when to stop writing tests? <br>When you cannot think about more tests to write or maybe when it’s time to move to the next feature? Eventually, we all use some (often different and arbitrary) notion of “completeness”, like “every line is reached at least once”.<br>The issue is that covering each line cannot say anything about whether the code does what it should.</p><p>But how to know what it should do?</p><p>The key to the solution lies in recognizing we cannot be the ones who write the code and be the oracles for correct code behavior at the same time. <br>Without an external, independent oracle of correct behavior, we are simply randomly guessing about which tests to write.</p><h3>If you are an OO developer your unit is not a class</h3><p>While most of us write in one of the varieties of “OO” languages, we fall into the trap of what actually is the unit we are testing in our ‘unit test’.<br>The thing is that there is an impedance mismatch between the unit of composition of our software (the Class), and the actual unit of code we can test which is a method/function.<br>So while we cannot execute a class, we can execute a function. <br>But the most interesting and valuable errors happen between functions (where a call graph of functions is invoked during run time to accomplish a task).</p><h3>Summary: Unfortunately most unit tests are not that useful</h3><ul><li>Chasing coverage is counter productive</li><li>Tests can not be simpler than the code itself</li><li>Unit tests can make it hard to change underlying code</li><li>Tests cannot promise that something works</li><li>Testing is sampling at best</li></ul><h3>Tips to maximize that unit test ROI</h3><ul><li>Concentrate on writing unit tests for key algorithms for which there is a third-party oracle of correctness. These parts of the system are usually the core and thus change rarely so the cost to change is amortized over time.</li><li>Delete any tests that you cannot link to a business value (what it means if this test fails)</li><li>Regression tests, where regression is defined as ‘Bug that was found in production and was reproduced with a test’</li><li>Delete tests that fail often</li><li>Delete tests that don’t fail at all</li><li>If something can be tested with a system test or unit test — prefer a system test</li></ul><p>Reading material referenced here, and that inspired this article:</p><ul><li>Articles by one of my greatest teachers and mentors James Coplien <a href="https://rbcs-us.com/documents/Why-Most-Unit-Testing-is-Waste.pdf">here</a>, and <a href="https://rbcs-us.com/documents/Segue.pdf">here</a></li><li><a href="https://www.researchgate.net/publication/4279048_A_Comparative_Case_Study_on_the_Impact_of_Test-Driven_Development_on_Program_Design_and_Test_Coverage">A Comparative Case Study on the Impact of Test-Driven Development on Program Design and Test Coverage</a></li><li><a href="https://www.amazon.com/Perfect-Software-Other-Illusions-Testing/dp/0932633692">Perfect Software by Jerry Weinberg</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b2b130f96f3" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/not-all-testing-is-equal-or-useful-and-some-is-actually-damaging-9b2b130f96f3">Not all testing is equal, or useful, and some is even damaging</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Branching model considerations for modern organizations]]></title>
            <link>https://faun.pub/branching-model-considerations-in-modern-organizations-5cee131a1d39?source=rss-50f0c8943d27------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cee131a1d39</guid>
            <category><![CDATA[developer-productivity]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[git-branching-model]]></category>
            <dc:creator><![CDATA[Vlad Lyga]]></dc:creator>
            <pubDate>Mon, 30 May 2022 19:57:01 GMT</pubDate>
            <atom:updated>2022-06-03T17:29:56.424Z</atom:updated>
            <content:encoded><![CDATA[<h3>Branching model considerations for modern agile organizations</h3><h4>Stuck on choosing a Git branching model? This article will help you decide.</h4><p>It’s always the same story. I join a new project with a new team, excited about what we are about to create together. Software making is a team sport so, together is a key-word here. We brainstorm together, and design together. But, unfortunately, most of the time we code alone. Like always we quickly remember that all our code has to be then merged somehow, and so the history repeats itself. We are choosing a branching model — again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p38sm26YpaOA8YQ41-3cOw.jpeg" /><figcaption>Beautiful branches <a href="https://pixabay.com/photos/oak-tree-tree-huge-old-charleston-2018822/">https://pixabay.com/photos/oak-tree-tree-huge-old-charleston-2018822/</a></figcaption></figure><p>If your team also facing the dilemma of choosing a branching model, keep reading. In this article, I compiled a lot of thinking points, facts, and perspectives that will allow you to elevate these discussions with your team way beyond the “this is how we did it in my previous team” level.</p><h3>We are choosing a branching model, again</h3><p>For convenience, I’ve divided this into sections:</p><ul><li>Culture and value considerations</li><li>The models compared</li><li>Best practices</li><li>Key Metrics</li><li>Data from the world to support the above (So we can be data-driven as much as possible)</li></ul><h3><strong>Culture values and principles</strong></h3><p>As DevOps is one of the byproducts of Agile, it’s heavily dependent on culture.<br>Since the inception of Agile it always prioritized the following values:</p><ul><li>Collaboration and communication: <strong>Individuals and interactions</strong> over processes and tools (agile manifesto 2001)</li><li>Simplicity: <strong>Working software </strong>over comprehensive documentation (agile manifesto 2001)</li><li>Feedback: <strong>Responding to change </strong>over following a plan (agile manifesto 2001)</li><li>Courage: Psychological safety to feel safe taking risks</li></ul><p><strong>Principles</strong></p><ul><li>Have a lightweight and clear change process</li><li>Aim for trunk-based development as an ideal</li><li>Continuous Integration</li><li>Continuous delivery (depends on CI and Trunk based development)</li></ul><blockquote>The models and practices below are currently the state of the art as far as supporting and acting out these values and principles.</blockquote><h3><strong>The models</strong></h3><h3><strong>Utopia Model (usually not feasible)</strong></h3><p><strong><em>Committing straight to the trunk, good for 1–100 devs</em></strong></p><h4><strong>What is it</strong></h4><p>Basically no branches.<br>When you are ready to commit — you just commit to the mainline (trunk).</p><h4><strong>Benefits</strong></h4><ul><li>The <em>real continuous</em> <em>integration</em>.</li><li>Do not need PR cycles.</li><li>Can readily deliver small value increments.</li></ul><h4><strong>Challenges</strong></h4><ul><li>Need a <em>very</em> comprehensive build.</li><li>The full build should be run before each commit and push (and <em>locally</em>).</li><li>Increased risk of breaking code for everyone.</li></ul><h3><strong>The next best thing to the utopia model</strong></h3><p><strong><em>Short-lived branches model (SLB), good for 2–1000 devs</em></strong></p><h4><strong>What is it</strong></h4><ul><li>Only one long-running branch</li><li>Short Branches (breaking branch-feature 1:1 relationship)</li><li>Branches live &lt; 1d</li><li>Have to open PR to merge</li></ul><h4><strong>Benefits</strong></h4><ul><li>Full build run can be deferred</li><li>Lesser risk of breaking the code for everyone</li><li>May conduce work alone (also a disadvantage)</li><li>No need for code freezes*</li></ul><h4><strong>Challenges</strong></h4><ul><li>Need to interrupt some other developer from his flow for PR(context switching)*</li><li>Risk putting too much work in one branch*</li><li>Forced linearisation of commits may create a bottleneck of PRs</li><li>May conduce work alone and developer isolation</li></ul><p>*look at solutions in the ‘best practices’ below</p><h3><strong>Modern Best Practices</strong></h3><p>Use these to help alleviate the above challenges (actual success depends on the culture).</p><h4>Pair programming</h4><p>Pair programming is basically an online code review.<br>Eliminates costly context-switching. Pair programmed PR is essentially already auto-approved (to the point that PRs can be automated)</p><h4>Smaller commits</h4><p>Short-lived branches help with achieving smaller commits.<br>The larger the changes the longer it takes to review and approve. <br>Large PR costs:</p><ul><li>High context switching cost to the author and reviewers because of back and forth until an agreement is reached</li><li>Higher risk of slipping bugs due harder to understand changes</li><li>Hurts productivity and lowers throughput</li></ul><h4>Merge directions</h4><p><em>Rebase</em> to bring your branch up-to-date before opening a PR.<br>This helps to keep your branch — about your changes (contrary to merge that mixes all together).</p><h4>Keep a linear and clean history</h4><p><em>Squash</em> when merging PR to main for clear, clean, and easily traversable history</p><h4>Releases don’t have to be branches</h4><p>Release may be cut from <em>Tag</em> on main.<br>For fixing an issue in production, a release branch can be created <em>retroactively</em> from the <em>Tag </em>(and cherry-picked from main).</p><h4>Cherry-pick fixes from main to release branch</h4><p>This will eliminate the need to do code freezes.<br>No need for error-prone multi-branch merges (as in git-flow).<br>Will keep the history readable, clean, and clear (and auditable).</p><h4>Break 1:1 feature-to-branch relationship</h4><p>A feature is not a branch. If you are using Jira or similar and used to name branches after tasks, try to stop tying branch and ticket life-cycle. Many small and short-lived branches are OK.</p><h3><strong>KPIs and Metrics</strong></h3><p>A shortlist of things to measure will allow you to get a feel for developer experience and spot dev velocity bottlenecks.</p><ol><li>Time from PR to approval (hours is good, days bad)<br>* supporting data in the “data” section below</li><li>Commit rate (the greater the better)</li><li>Median time to build (ideally should be less the time between commits)</li><li>Overall delivery performance</li><li>Lead time: how long from commit to deploy (very dependent on the first three)</li><li>Change failure rate: how many deployed changes caused service degradation/failures</li><li>MTTR: mean time to restore service</li></ol><h3><strong>Interesting Data that we see in the world</strong></h3><p>A sociologist Ron Westrum created a culture model where he defines the following typology of organizations (Westrum 2014). He found that this definition of organizational culture predicts performance outcomes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hOWHNuOuMb6jy9wF" /></figure><p>A two-year google study found similar results (<a href="https://rework.withgoogle.com/blog/five-keys-to-a-successful-google-team/">https://rework.withgoogle.com/blog/five-keys-to-a-successful-google-team/</a>)</p><h4>Statistics about code review from “A modern code review: A case study at Google” (2018)</h4><ul><li>80% are single file changes (over 10% are single-line changes)</li><li>The median time to get code reviewed is 4 hours</li><li>Median dev authors 3 changes a week</li><li>The median changes reviewed per week is 4 (by a dev)</li></ul><h4><strong>How understanding needs to change with the expected outcome of code review</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/0*uHI2P14UbrYqiC3g" /><figcaption>A Microsoft study: Expectations, Outcomes, and Challenges of Modern Code Review (2013)</figcaption></figure><h4><strong>Delivery performance capabilities map (State of DevOps report 2019)</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vH21NaMC7rvTQSfG" /></figure><h4><strong>When it comes to commits — smaller is better.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q9tPHF_0cNByp6JR" /><figcaption><em>Development at the Speed and Scale of Google,” presentation at QCon, San Francisco, CA, 2010</em></figcaption></figure><h4><strong>Delivery Performance</strong></h4><p>State of DevOps reports shows year over year that the highest performing teams:</p><ul><li>Deploy the most frequently</li><li>Have the lowest lead time for changes (from code committed to production)</li><li>The quickest to restore service in case of failure</li><li>Fail less often (% of changes deployed that are bad)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tpitOn2ViXdWNYi-" /></figure><p>To the brave soul who reached this point, I’m proud of you.</p><p>Comments, thoughts, data, and experiences are welcome in the comments below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b31hiO4ynbDLRrXWEFF4aQ.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cee131a1d39" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/branching-model-considerations-in-modern-organizations-5cee131a1d39">Branching model considerations for modern organizations</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why knowledge does not “builds up like compound interest”]]></title>
            <link>https://medium.com/@vladlyga/why-knowledge-does-not-builds-up-like-compound-interest-d88a6363f279?source=rss-50f0c8943d27------2</link>
            <guid isPermaLink="false">https://medium.com/p/d88a6363f279</guid>
            <category><![CDATA[knowledge-management]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[knowledge]]></category>
            <category><![CDATA[skills-development]]></category>
            <category><![CDATA[life-lessons]]></category>
            <dc:creator><![CDATA[Vlad Lyga]]></dc:creator>
            <pubDate>Wed, 23 Feb 2022 13:10:27 GMT</pubDate>
            <atom:updated>2022-02-23T16:33:14.134Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why knowledge does not “build up like compound interest”</h3><h4>Would you play the lottery with the most precious thing you have — time?</h4><figure><img alt="“The lottery ticket seller” by pedrosimoes7 is licensed under (CC BY 2.0)" src="https://cdn-images-1.medium.com/max/969/1*pkqpB7UU8BT263f7s8CblQ.jpeg" /><figcaption><a href="https://www.flickr.com/photos/46944516@N00/262478039">“The lottery ticket seller”</a> by <a href="https://www.flickr.com/photos/46944516@N00">pedrosimoes7</a> is licensed under <a href="https://creativecommons.org/licenses/by/2.0/">(CC BY 2.0)</a></figcaption></figure><p>Warren Buffet says you should read 500 pages a day. The reason? Because according to the Oracle of Omaha that is how knowledge builds up “like compound interest”. But that is not really how it works. Here’s why following this advice might cost you wasted time and effort.</p><blockquote>“Read 500 pages like this every day,” said Buffett, or words to that effect. “That’s how knowledge works. It builds up, like compound interest. All of you can do it, but I guarantee not many of you will do it.” <a href="https://omaha.com/business/investors-earn-handsome-paychecks-by-handling-buffett-s-business/article_bb1fc40f-e6f9-549d-be2f-be1ef4c0da03.html">(source)</a></blockquote><p>Mr. Buffet is a phenomenal investor, and he attributes his success to practicing reading hundreds of pages of financial reports, trade publications, etc. for 8 hours daily. And he has been doing it for 60 years. This is consistency! We’ve known about benefits to regular reading like <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4128180/">strengthening the brain</a>, <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2276592/">preventing cognitive decline</a>, and <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4610292/">building up your vocabulary</a>. But what about accumulating knowledge?</p><h4>Any knowledge is knowledge?</h4><p>The problem is that we are trying to apply a financial concept of compound interest to epistemology. One corollary of this is that we assume a cumulative model of knowledge. This is wrong on the account that it makes unlikely assumptions:</p><ul><li>you never forget anything</li><li>everything you learn stays true forever</li></ul><p>This is because we are used to treating knowledge as something binary. Either we know something, or we don’t.</p><blockquote>Imagine a bank that would periodically “forget” the exact sum on your account…</blockquote><h4>Lost knowledge</h4><p>Of course, we forget. Individually and collectively. Knowledge being lost is a fact of human life. We lose accounts of historical events, past technologies, philosophies, art. A trivial example is how almost anyone can easily think about a book read a year ago and now only vaguely remembered.</p><p>Imagine a bank that would periodically “forget” the exact sum on your account, and then adjust it “from memory”.</p><h4><strong>Unlearning</strong></h4><p>Learning new stuff is exciting. Often it means we discover that something that we thought we knew, was actually wrong. So paradoxically often learning goes hand in hand with the ability to unlearn. <br>Not all we think we know will stay true forever.</p><h4>Experience</h4><p>Some knowledge cannot be acquired through teaching, from a book, or otherwise<em>. </em>Some knowledge can only be acquired through <em>practical experience </em>which<em> </em>takes time, exposure, and practice.</p><h3>Knowledge is not a lottery ticket</h3><h4>Don’t drown in the ocean of human knowledge</h4><p>Same Warren Buffet also said (the continuation of the sentence) that he reads that much, and <em>hopes that something will pop out</em>.<br>This is like playing the lottery. In both cases, we will be counting on random chance. Betting with your time, energy that “something will pop out” is a sure way to the land of wasted learning opportunities.</p><h4>Remove the noise and focus on skill selection</h4><p>For real life, where our resources of time and attention are scarce I suggest adopting a better model of knowledge growth than “all knowledge is knowledge, so we should read as much as possible”.</p><p>You cannot know anything, even in a narrow field. But that’s O.K because knowledge is infinite, and at any given time there are parts of it that we can safely ignore.</p><p>What that means is we let our knowledge evolve according to some selection. Before investing in exploring something ask yourself “Is there a cost to X of not knowing Y?” where X is a skill that you choose to develop.</p><p>The idea is to work on developing knowledge related to skills that are either adjacent to your ‘core’ (investing, programming, writing, etc)— or skills that can create new value when combined with that core.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d88a6363f279" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>