<?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 Alexey Novak on Medium]]></title>
        <description><![CDATA[Stories by Alexey Novak on Medium]]></description>
        <link>https://medium.com/@abovebluesky?source=rss-c0c8cfcccef2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GVhqkW635Ci6XjnqXcA4-A.jpeg</url>
            <title>Stories by Alexey Novak on Medium</title>
            <link>https://medium.com/@abovebluesky?source=rss-c0c8cfcccef2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 05:26:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abovebluesky/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[The Role of Automated Integration Testing in a Startup’s Growth]]></title>
            <link>https://medium.com/swlh/the-role-of-automated-integration-testing-in-a-startups-growth-47e82bc43e86?source=rss-c0c8cfcccef2------2</link>
            <guid isPermaLink="false">https://medium.com/p/47e82bc43e86</guid>
            <category><![CDATA[scaling]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[automated-testing]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Alexey Novak]]></dc:creator>
            <pubDate>Mon, 04 May 2020 23:05:55 GMT</pubDate>
            <atom:updated>2020-05-08T00:14:33.976Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TQ02KEWK1jx2_DKTHcOuzw.jpeg" /></figure><p>After working in both mature organizations as well as early startups, I’ve come to the realization that one of the most important keys to startup success and expansion is automated testing.</p><p>Very often startups look at testing as a massive time waste when there is a sea of features to be delivered. This is true at the early stages when there is not even a v1 product to sell, but as a startup matures, testing could be the only path to growing and scaling up. The following points are reasons why a startup might want to start investing in automated testing sooner rather than later:</p><ul><li><strong>Quality and speed</strong>: Often startups believe that letting teams focus on quality might affect the speed of releasing new features. This thought process is definitely valid in the early stages, but it is not sustainable in the long run of a company.</li><li><strong>False economy</strong>: Contrary to the belief that hiring extra developers can increase output, the speed can actually drop if there are no tests set in place.</li><li><strong>Unlocking frequent releases</strong>: Hotfixes, trunk-based development, and releasing frequently are great concepts but could be extremely dangerous or near-to-useless when there is no good automated regression test suite to run in a CI/CD pipeline.</li><li><strong>Responsibility for the end product</strong>: To ensure product stability, it is very important to know who is responsible for the end-to-end tests for the critical paths.</li><li><strong>Integration versus unit tests</strong>: Knowing when to pick integration tests over unit tests is crucial to avoid time wasted on less important testing.</li><li><strong>Stability is an investment</strong>: Adding integration tests does not yield immediate stability but rather is an investment into a company’s future, similar to how companies invest in their employees over a long period of time.</li></ul><p><strong>Quality and Speed</strong></p><p>Let’s take a look at the project management triangle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*mYl7tJosXEkjBY8JyvlgKw.png" /></figure><p>Any developer knows that QA and documentation never get enough love at any company. Startups are guilty of having even less time dedicated to those activities. For many fresh startups out there, coding new features quickly is the utmost priority. Everyone in the company is rushing to get the product done and out the door, trying to finish v1. It makes sense, since if you have a perfect product then most likely you are already too late to get it out before the competition. Prioritizing speed over quality is often necessary, but there is a catch…</p><p>At early stages a handful of highly talented developers can handle all the incoming bugs because the product is smaller and less complex, but over time issues start to slip through as the product grows. It is inevitable that customers (early adopters) will be a driving force for testing early on. Over time the customer base will grow, features will be used fully, and those occasional bugs will become less tolerable — this is the point when companies might even hire dedicated QA testers or outsource testing. This can temporarily help contain issues from leaking to the production releases, but sooner or later the complexity of the software will outgrow the resources thrown at the problem.</p><p>Refactorings could become dreaded and fearful exercises that potentially touch every part of the system and make any release a nightmare full of “high risk” items. New features could be stretched over many sprints due to the team doing manual testing, trying to predict and assess every possible negative outcome of each long-awaited new addition.</p><p>But by having an automated test suite that is maintained by developers for every new feature, you can still keep the fast pace. It does not matter if a few of the company’s rockstars rip pieces of the existing code and replace it with another massive, newly created codebase overnight. If your tests cover the critical paths and still pass, it means only one thing — customers will experience your product just like they did before the changes. Having a safety net for your team can unlock their speed and thirst for improvements, just as they were at the early stages.</p><p><strong>False Economy</strong></p><p>Most people have a false perception that releasing software is similar to a basic factory production row. At the factory you have skilled people producing the same item over and over again in order to sell. How do you increase the profit of such a factory? You would increase a head count and by doing this you would increase the amount of items produced. Unfortunately, this concept does not work in software companies. The main discrepancy lies in the fact that software has an exponential complexity. Every day developers make changes that contribute to growing the number of use cases, features, and complex user paths within the application.</p><p>Let’s take a look at a basic product where a user is presented with just two buttons, A and B, that can do action A and action B, respectively. Then tomorrow the product manager asks to add a simple toggle, the value of which can modify the outcome of the action. All of a sudden from just two outcomes you get four: A with toggle ON, A with toggle OFF, B with toggle ON, and B with toggle OFF. Now let’s add another toggle that would affect execution and you end up with eight permutations. You can imagine how every new feature, new public API, integration, or UX improvement can increase the complexity of the software exponentially with every release.</p><p>This is exactly the reason why you can sometimes get a slow down in the company by adding extra developers. If you increase the amount of code being produced, you increase the amount of bugs with every release. The team now needs to spend more time verifying and assessing that extra added risk for every released feature. Of course you could hire more people in the QA department or let the outsourced companies do the testing for you. But remember the exponential growth described above. Sooner or later the complexity of the software will outgrow the resources you throw at the problem. So companies will face a decision — go into a rabbit hole of spending more money by hiring ever more people, or force developers to spend more time on testing, or optimize the processes hoping that they will cover that complexity growth for a time. In any case, automated integration testing could be the solution — it is the tool that is always there and always does the same verification of your product no matter how quickly your team grows.</p><p><strong>Unlocking Frequent Releases</strong></p><p>Customers want all the features and they want them finished yesterday. Having a good CI/CD pipeline or something close to trunk-based development is great. But honestly it is useless without a good set of automated regression tests for existing features and critical paths. Just like in the examples above, you would need to ask the manual QA team to scramble very quickly and do a regression test for the application before every push. It could be very tedious and might take a lot of time before the hotfix will get approved to be deployed to production. Now what if you need to deploy a couple of them? What if the team just spent a lot of time testing and then all of a sudden another hotfix is about to be completed? In this case all the effort spent on testing is immediately nullified, leading to more waste of precious resources: time and money.</p><p>Having your CI/CD pipeline executing a “good” automated regression suite to check that everything is still stable and all critical use paths are still working can save lots of headache for customers and allow a company to release much more frequently without the team being asked to create another hotfix outside of work hours.</p><p><strong>Responsibility for the End Product</strong></p><p>Now let’s chat about who is responsible for writing those automated tests. If you are part of a company that adopted a Spotify model of autonomous teams (if so, good for you), then teams might write those tests. If you have a dedicated QA team to test your product (again, good for you), then this QA team might write the tests. Both of those options might work but I would NOT recommend either of them alone — I would instead suggest using a little bit of both.</p><p>Let me explain why…</p><p>A dedicated QA team might quickly get overwhelmed with the amount of small details, which are way too specific, forcing them to constantly ask developers and project managers what to test. This can put lots of strain on the QA team and create tension between teams. When developers have a dedicated team checking their work, it is tempting to put in less effort since they know that someone will come back to point at the exact locations in the code that need to be fixed.</p><p>Just having feature teams writing tests is not the best solution either. Let’s go back to a factory example, which produces cars. You can have one person making a perfect wheel, while another person makes perfect doors, and another person produces a perfect transmission. So it might come as a surprise when a car that came out as the final product is falling apart even though it consists of the best parts. The problem with letting feature teams do all the testing lies in the idea that there is no dedicated person who owns the whole product. If you ask any of your feature teams a question about a user story, there is a good chance that nobody would be able to give a full answer since all the teams are responsible for and experts in only specific parts of the product rather than the whole.</p><p>What is the right answer here? A little bit of both. You need to nurture teams creating their own automated tests that are specific to the implementations they create. But you also need to have some people who will own all pieces of the whole product from start to finish. People who could write true integration tests, which might touch the work of many teams and many departments. Just a handful of dedicated QAs doing those end-to-end cross-team complicated tests would be the best option. The same people could also play the role of release managers since they would know best how every release affects every other part of the company.</p><p><strong>Integration versus Unit Tests</strong></p><p>Most of the time when testing is mandated, developers start by writing unit tests. Unit tests are much easier to start writing and to set up. Yes you can spend a few hours and test your function for different types of inputs, see that it still works, and call it a day. But the most important time investment is undeniably integration testing. Mimicking the critical user paths within an app (such as mimicking a real user navigating a webpage or calling a public API) could potentially be one of the most important tests you could do. After all, customers would not tolerate the product being unstable even if it has a 100% test coverage on some of the functions within the app.</p><p>That said, unit testing could be very useful too. Any function that is integral to a business’s core application would highly benefit from unit tests. Any finance engines, routing logic, or other essential algorithms that lie at the heart of the code would require good unit test coverage.</p><p>Picking the proper kinds of tests for your product is essential.</p><p><strong>Stability Is an Investment</strong></p><p>Some people have expectations that when you start writing automation tests you’ll get better stability the next day. Writing tests is an investment. Just like you nurture junior developers to become rockstar senior developers over years, you need to put time and effort into building your test suite. Implementing automated testing will not solve all the issues right away, but at least you can guarantee that over time confidence will grow and that for every bug you find, the team can write a test so that it will never happen again.</p><p>Automated testing is arguably one of the most important tech investments that a startup could possibly make when it is growing the number of customers and thinking to increase the headcount of the engineering department. You can talk about processes or good code for hours, but it is only when a startup is truly making an investment into automated testing that you can leverage both speed and quality towards scaling your code and product to the next level.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47e82bc43e86" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/the-role-of-automated-integration-testing-in-a-startups-growth-47e82bc43e86">The Role of Automated Integration Testing in a Startup’s Growth</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Seeking Helpful Errors in Go with xerrs]]></title>
            <link>https://medium.com/rose-rocket/seeking-helpful-errors-in-go-with-xerrs-84e6458b893e?source=rss-c0c8cfcccef2------2</link>
            <guid isPermaLink="false">https://medium.com/p/84e6458b893e</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Alexey Novak]]></dc:creator>
            <pubDate>Sat, 20 Oct 2018 18:35:27 GMT</pubDate>
            <atom:updated>2018-10-22T14:46:58.599Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3hsGvrH81XrWL_hbJZUiIg.jpeg" /></figure><p>Many developers would tell you that debugging errors is a dreadful process but that extra printed log lines in the code would help to solve any issues that arise. Unfortunately, this is often wishful thinking, which most of the time doesn’t work in practice. Sooner or later we all find ourselves staring at the screen trying to piece together the full picture within the hundreds upon hundreds of log lines (most of which do not make any sense or are simply useless). Even a tiny bug in a relatively large system can bite a good chunk of time out of the precious ongoing sprint.</p><p>Debugging errors is not such a burden in a relatively small code base, usually only taking a few minutes for the developer to find the problem. But most production systems can easily produce a few GB of logs on a daily basis, making it close to impossible for a developer to scan through the data. In this particular case, you might find yourself wishing that you had more helpful errors.</p><p>What characteristics might an error have to be able to provide as much information as possible for the team? I would answer that such an error would tell you exactly what is wrong in the system even though it spits out generic errors to the client. It is an error that would not require searching for a few specific lines in a scattered, never-ending log file. Finally, such an error would point you directly to the problem in your code, hopefully using a very detailed Stack.</p><p>Different languages provide different sets of tools for error handling. Here at Rose Rocket we have been using GoLang as the main language for our back-end system. Unfortunately, GoLang (<a href="https://golang.org/pkg/errors/">https://golang.org/pkg/errors/</a>) has a pretty basic error interface to work with, and over time you may start to find that it is too simplistic for larger projects.</p><p>Let’s take a look at a very simplified example:</p><pre>FriendlyError := errors.New(&quot;Uh oh system could not process your request&quot;)</pre><pre>type Truck struct {<br>    ID       string `json:”id”`<br>    Name     string `json:”name”`<br>}</pre><pre>func ValidateTruck(truck *Truck) error {<br>    var err error</pre><pre>    if truck.Name == &quot;&quot; {<br>        err = errors.New(&quot;Name of the Truck is incorrect&quot;)<br>        fmt.Errorf(&quot;%v\n&quot;, err)<br>        return err<br>    }</pre><pre>    <em>// some extra business logic we need to do with our model<br>    // we are calling “some api” that might return an error</em><br>    err = extraChecks(truck)<br>    if err != nil {<br>        fmt.Errorf(&quot;%v\n&quot;, err)<br>        return err<br>    }</pre><pre>    return nil<br>}</pre><pre>func CreateTruck(w http.ResponseWriter, r *http.Request) {<br>    var err error<br>    var truck Truck</pre><pre>    if err = ReadJSONBody(r, &amp;truck); err != nil {<br>        fmt.Errorf(&quot;%v\n&quot;, err)<br>        http.Error(w, FriendlyError.Error(), http.StatusBadRequest)<br>        return<br>    }</pre><pre>    if err = ValidateTruck(&amp;truck); err != nil {<br>        fmt.Errorf(&quot;%v\n&quot;, err)<br>        if err.Error() == &quot;Name of the Dock is incorrect&quot; {<br>            http.Error(w, err.Error(), http.StatusInternalServerError)<br>        } else {<br>            http.Error(w, FriendlyError.Error(), http.StatusInternalServerError)<br>        }</pre><pre>        return<br>    }</pre><pre>    if _, err = DBCreate(&amp;truck); err != nil {<br>        fmt.Errorf(&quot;%v\n&quot;, err)<br>        http.Error(w, FriendlyError.Error(), http.StatusInternalServerError)<br>        return<br>    }</pre><pre>    json.NewEncoder(w).Encode(truck)<br>}</pre><h3>Pain Points</h3><p><strong>1.</strong> First and foremost is the ability to print out a detailed error stack. It is important to be able to know the last functions that were executed when an error happened. In the example above we would love to be able to recognize that <em>CreateTruck()</em> function failed because it called <em>ValidateTruck()</em> function, which returned an error.</p><p><strong>2.</strong> We want to avoid adding mindless error logging statements everywhere in the code only so that we can record a line number to debug later on. Not only can different log lines appear at different places in one huge log file, it also makes coding tedious and repetitive since after every single function execution, developers need to remember to add an extra line for log output. No matter how vigorous your PR reviewing process is, it is very time-consuming to catch missing log statements.</p><p><strong>3. </strong>Over time we found that almost every error generated by a function never actually needs to be returned to the client. Rather, we want to hide the real cause of the error behind some friendly generic message that is thrown back to the client, giving them an idea that the system encountered a problem. Masking is a perfect method for that. Any error can have a friendly error sibling which is used for <em>err.Error()</em> function, preventing the real problem from reaching the client.</p><p><strong>4. </strong>The ability to add an extra layer of data cooked into an error could be potentially useful for the clients or for the internal systems (e.g., something like Twitter <em>errorCodes</em>: <a href="https://developer.twitter.com/en/docs/basics/response-codes.html).">https://developer.twitter.com/en/docs/basics/response-codes.html).</a></p><p><strong>5. </strong>You want to prevent introducing a custom error structure that would force the team to rewrite thousands of lines of production-tested code (also forcing them to rewrite those tests). An error based on the built-in error interface would be optimal.</p><h3>Possible Solution?</h3><p><strong>xerrs</strong> (<a href="https://github.com/RoseRocket/xerrs">https://github.com/RoseRocket/xerrs</a>)</p><pre>FriendlyError := errors.New(&quot;Uh oh system could not process your request&quot;)</pre><pre>func ValidateTruck(truck *Truck) error {<br>    if truck.Name == &quot;&quot; {<br>        return xerrs.New(&quot;name of the Truck is incorrect&quot;)<br>    }</pre><pre>    if err := extraChecks(truck); err != nil {<br>        return xerrs.MaskError(err, FriendlyError)<br>    }</pre><pre>    return nil<br>}</pre><pre>func CreateTruck(w http.ResponseWriter, r *http.Request) {<br>    var err error</pre><pre>    defer func() {<br>        <em>// Details returns cause error, mask if specified, and the stack<br>        // In this example only 5 last stack function calls will be printed out</em><br>        fmt.Println(xerrs.Details(err, 5))<br>    }()</pre><pre>    var truck Truck<br>    if err = ReadJSONBody(r, &amp;truck); err != nil {<br>        err = xerrs.MaskError(err, FriendlyError)<br>        http.Error(w, err.Error(), http.StatusBadRequest)<br>        return<br>    }</pre><pre>    if err = ValidateTruck(&amp;truck); err != nil {<br>        http.Error(w, err.Error(), http.StatusBadRequest)<br>        return<br>    }</pre><pre>    if _, err = DBCreate(&amp;truck); err != nil {<br>        err = xerrs.MaskError(err, FriendlyError)<br>        xerrs.SetData(err, &quot;ErrorCode&quot;, 123) <em>// set custom error value</em><br>        http.Error(w, err.Error(), http.StatusInternalServerError)<br>        return<br>    }</pre><pre>    json.NewEncoder(w).Encode(truck)<br>}</pre><p>As you can see, this updated code does not rely on developers printing errors after every single function — instead they can focus on printing errors only at the top function where it matters most (<em>CreateTruck()</em> in this example). Honestly, always logging errors isn’t the best thing to do. Errors are values, especially in Go, and should be treated as such; there are many situations where an error can result in a different execution path but does not necessarily need to be logged.</p><p><em>fmt.Println(x.Details(5))</em> prints a stack that is one blob of output data and does not require looking for scattered log lines.</p><p>Each error has a Mask that is used for the client facing error. This feature could be used on any function as deep as you want it to be. You do not need to have big “if” statements in your top functions for you to determine if you need to return a more generic error to the client instead of the original one.</p><p><strong>xerrs</strong> uses the built-in error interface, which prevents massive code rewrites across a project. Every function can still return an error instead of some custom proprietary struct.</p><p>Each error can carry custom data, which can provide clients with an extra level of information about the issue.</p><h3>Any Alternatives?</h3><p>There are alternatives out there that might end up working for your projects, just like <strong>xerrs</strong>.</p><p><strong>juju/errors</strong> (<a href="https://github.com/juju/errors">https://github.com/juju/errors</a>) We initially tried juju/errors<strong> </strong>for our projects, but it was not exactly the perfect fit for our needs here at Rose Rocket.</p><p><strong>pkg/errors</strong> (<a href="https://github.com/pkg/errors">https://github.com/pkg/errors</a>) This is a smaller BSD licensed library that has less features but might just fit your needs.</p><p>(<a href="https://go.googlesource.com/proposal/+/master/design/go2draft.md">https://go.googlesource.com/proposal/+/master/design/go2draft.md</a>) Some ideas and suggestions are already floating in the GoLang community around error handling, which might change the way Go developers work with errors today.</p><h3>In Conclusion</h3><p>Maybe <strong>xerrs</strong> is exactly the tool you were looking for or maybe it will inspire you to find another one that can fit your needs the best. Whatever you end up picking, I hope that debugging is easy as a breeze and your team can find and fix problems in a matter of minutes regardless of how big or complex the code base is.</p><p>Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84e6458b893e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rose-rocket/seeking-helpful-errors-in-go-with-xerrs-84e6458b893e">Seeking Helpful Errors in Go with xerrs</a> was originally published in <a href="https://medium.com/rose-rocket">Rose Rocket</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>