<?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 Olivier Liechti on Medium]]></title>
        <description><![CDATA[Stories by Olivier Liechti on Medium]]></description>
        <link>https://medium.com/@olivierliechti?source=rss-ade0aaa558e3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qwrIUn90oym5LN58.</url>
            <title>Stories by Olivier Liechti on Medium</title>
            <link>https://medium.com/@olivierliechti?source=rss-ade0aaa558e3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 19:16:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@olivierliechti/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[Backstage meets Vega.js for a visually delightful DX]]></title>
            <link>https://medium.com/avalia-systems-blog/backstage-meets-vega-js-for-a-visually-delightful-dx-bf8466f7ce1a?source=rss-ade0aaa558e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf8466f7ce1a</guid>
            <category><![CDATA[d3js]]></category>
            <category><![CDATA[dx]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[backstage]]></category>
            <category><![CDATA[vega-js]]></category>
            <dc:creator><![CDATA[Olivier Liechti]]></dc:creator>
            <pubDate>Tue, 28 Jun 2022 12:42:33 GMT</pubDate>
            <atom:updated>2022-06-28T12:42:33.880Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post, we explain how we have combined <a href="https://backstage.io/">Backstage</a> and <a href="https://vega.github.io/vega/">Vega.js</a> to bring beautiful and insightful data visualizations into developer portals.</p><p>The combination of these two powerful open-source projects is an enabler for applying <em>software analytics</em> techniques, and thus better understanding what is happening in <em>your</em> software ecosystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-V1QZpj_83Ty5uiYgkXfug.png" /><figcaption>Visualizing software ecosystems with Vega.js</figcaption></figure><h3>Backstage: observe entities from different angles</h3><p><a href="https://backstage.io/">Backstage</a>, open-sourced by Spotify, is a flexible platform for building developer portals. With Backstage, development teams get a single entry point into their software ecosystem. They can easily find information about all sorts of <em>entities</em> that are part of the ecosystem: the <em>components</em> they build, the <em>tools</em> they use, and of course… the <em>people</em> they work with!</p><p>Backstage tracks all these <em>entities</em> in a central <a href="https://demo.backstage.io/catalog?filters%5Bkind%5D=component&amp;filters%5Buser%5D=all">catalog</a> and provides an extensible UI to explore them. <strong>Developers can observe every entity in the catalog from different perspectives</strong>. Depending on the situation, they may look at a component from a “source code” perspective, from a “CI/CD” perspective, from a “team” perspective, etc. Backstage brings all elements in a central place, make the life of developers easier.</p><p><strong>The beauty of Backstage is that it lets portal designers craft these different perspectives with a lot of flexibility</strong>. Backstage really is an application framework: its user interface is easy to extend with new pages, new tabs, new components, etc. This is essentially done by writing React components and following some guidelines.</p><p>In the example below, one may for instance decide to add a “Telemetry” tab to provide runtime information about the component. One might also decide to add a widget in the “Overview” tab to show the number of open bugs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7K8WBOPlyEsqoi42p_qewg.png" /><figcaption>Looking at the artist-lookup component in the Backstage catalog from different angles</figcaption></figure><p>The extensibility of Backstage makes it easy to bring data visualizations into the developer portal. The core platform provides some visualization components (gauges, relations graphs, etc.). But as we will see later, it is possible to bring your own visualization libraries into the framework, thanks to its plugin architecture.</p><h3>Software analytics and data visualization</h3><p>Software analytics has been <a href="https://ieeexplore.ieee.org/abstract/document/6547619">defined</a> as <em>“analytics on software data for managers and software engineers with the aim of empowering software development individuals and teams to gain and share insight from their data to make better decisions.”. </em>The “software data” is typically extracted from code repositories, issue trackers, static code analyzers, production systems, etc.</p><p>This is a field where extensive research has been done in academic and industrial settings. Research outcomes have made their way into developer tools, to support a variety of use cases: architecture understanding, defect prediction, etc.</p><p>At Avalia Systems, we apply software analytics techniques for two main use cases:</p><ul><li><strong>Technical due diligence projects</strong>: here, the goal is to use the information to form an opinion about a particular software organization and its assets. Software analytics allow our experts to go faster and deeper.</li><li><strong>Continuous improvement</strong>: here, the goal is to present feedback to development teams, to make progress visible. Software analytics is about defining leading and lagging indicators, collecting related metrics and presenting insights in a compelling way.</li></ul><p>In both use cases, the visualization of software data is an important part of the process. Visualization is effective both to <em>explore</em> a problem space and to <em>explain</em> a situation to a target audience. These two phases are very different and are best supported by different tools and techniques. Having said that, many of these tools can leverage the same underlying core libraries. Vega.js is one such library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*dsD7ZCMUEQ8TZzaCAI7m7w.png" /><figcaption>Examples of visualizations built with our Vega plugin for Backstage (commits in the Backstage Git repo)</figcaption></figure><h3>Vega.js and the grammar of graphics</h3><p>Vega.js and Vega-Lite.js are two open-source projects that implement the concept of a “visualization grammar”. In other words, they provide a “language” to declare how a specific dataset should be represented visually. The language is used to declare how data properties should be mapped onto graphical properties.</p><p>With Vega.js, data visualization experts can describe data transformations, scales, axes, legends, etc. Vega-Lite.js provides a higher-level grammar than Vega.js, which makes it possible to write more concise specifications, at the cost of some flexibility.</p><p>The example below shows an example. On the left, we see a Vega-Lite specification, written in JSON. On the right, we see the visual interpretation of this specification. Here are the key points of the specification:</p><ul><li>We <em>declare</em> that our dataset is made of 9 items with 3 attributes: “category”, “group”, and “value”.</li><li>We <em>declare</em> that every item in the dataset should be represented with a “bar” mark.</li><li>We <em>declare</em> that every bar is positioned on the horizontal and vertical axes, based on the “category/group”, respectively on the “value” attributes.</li><li>Finally, we <em>declare</em> that the color of every bar should be mapped onto the “group” attribute of the corresponding data item.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*zL8jQUoryNXGK5dkBZKW4w.png" /><figcaption>Vega-Lite.js is used to declare how data attributes should be mapped onto visual attributes</figcaption></figure><p>There is a learning curve to become familiar with this approach, but after that it becomes a very effective way to design new visualizations. The fact that specifications are written in JSON files, rather than in Javascript, makes them portable across tools.</p><h3>Building a Vega plugin for Backstage</h3><p>At Avalia Systems, we have been fans of Vega.js (and of the underlying D3.js library) for a long time. We have integrated it into different software analytics products, and we use it in most of our projects.</p><p>Over the years, we have built a catalog of data visualizations that we use to answer questions for our clients, and we wanted to be able to use them within Backstage portals. To achieve this goal, we have implemented a Backstage plugin. This plugin provides components, which can be used on any Backstage page. The plugin does not implement specific visualizations. It provides a way to connect a widget with a Vega or Vega-Lite specification, which is captured in a JSON file.</p><p>This enables a very effective development process. The visualizations can be designed by Vega experts, without the need to work in the Backstage codebase. Portal designers can then easily add widgets to their pages. In the example below, we have created a dashboard page with multiple widgets, but it is also possible to integrate a single widget on a page that presents other information (e.g. the page presenting information about an entity in the catalog).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KGeK796maL0V8eQ06p2CLQ.png" /><figcaption>DX Hub: our Developer Portal built on top of Backstage, with support for Vega.js</figcaption></figure><p>To bring software analytics into our developer portals, we can now follow this process:</p><ul><li><strong>Get a dataset</strong>. Vega can parse JSON, CSV, TSV, DSV, and TopoJSON files. In the screenshots above, we have used the git log command to generate a CSV file with one line per commit. Each line has the date and the timestamp of the commit. We have run it on the <a href="https://github.com/backstage/backstage">Backstage repo</a>, in GitHub.</li><li><strong>Develop the Vega or Vega-Lite specification</strong>. The specification references one or more datasets, using their URLs. We usually perform this task with a local installation of the <a href="https://github.com/vega/editor">Vega Editor</a>. This makes it easy to work with datasets available on the local machine. Note that Vega provides data transformation primitives. For example, it is possible to compute aggregations on the raw CSV data, and to map attributes of the aggregations onto graphical properties.</li><li><strong>Use our Vega plugin for Backstage</strong>. In the example below, we see that our&lt;Widget&gt; component references the Vega specification. Here, we have stored the JSON files in the Backstage server static asset folder, which is why we use a relative URL. But again, the Vega spec can be deployed anywhere, provided that they are accessible via a URL.</li></ul><pre>// Every widget has a title and a reference to a Vega Lite spec</pre><pre>const vegaLiteWidgets : VegaWidgetDefinition[] = [<br>    {<br>      title: &quot;Top contributors&quot;,<br>      spec: &quot;/metrics/top-contributors-by-commits.json&quot;,<br>    },<br>    {<br>      title: &quot;Activity&quot;,<br>      spec: &quot;/metrics/activity-matrix.json&quot;,<br>    },<br>    {<br>      title: &quot;Cumulative count of commits&quot;,<br>      spec: &quot;/metrics/commits-cumulative-count.json&quot;,<br>    },<br>  ];</pre><pre>// We return a horizontal grid with one widget per slot</pre><pre>return (<br>    &lt;div className=&quot;widgetGrid&quot;&gt;<br>      {vegaLiteWidgets.map((widget, index) =&gt; {<br>          return (&lt;Widget <br>            key={index} <br>            title={widget.title} <br>            library={VegaLibrary.VEGA_LITE} <br>            vegaSpecUrl={widget.spec} /&gt;)<br>        })}<br>    &lt;/div&gt;<br>);</pre><p>There are two aspects that are worth mentioning about our implementation of the plugin:</p><ul><li><strong>We have made the widget “responsive”</strong>. Vega specifications can specify a fixed width and height, and this approach is used in most examples. A more practical approach is to let Vega generate a chart that uses the area of its container in the DOM. This means that if the window is resized, the Vega chart should be re-rendered with new dimensions. With React, this can be done with a useEffect hook (see the code snippet below). Note that we also had to fix the CSS used by Vega for this to work well.</li></ul><pre>const updateDimensions = () =&gt; {<br>    setVegaWidth(vegaRef.current.clientWidth);<br>    setVegaHeight(vegaRef.current.clientHeight);<br>  }<br>  <br>  React.useEffect(() =&gt; { <br>    updateDimensions();<br>    window.addEventListener(&quot;resize&quot;, updateDimensions);<br>    return () =&gt; <br>      window.removeEventListener(&quot;resize&quot;, updateDimensions);<br>   }, []);</pre><ul><li><strong>We have provided a way to inject standard configurations (similar to themes)</strong>. When multiple charts are added to Backstage pages, it is important to have consistent styles. Colors, font sizes, axis styles, etc. All these elements are defined in Vega specifications. Instead of repeating them in every specification, we can inject them. In the snippet below, the elements are coded in the useEffect() hook. In practice, we load them from external files, which makes maintenance easier.</li></ul><pre>useEffect(() =&gt; {<br>    const fetchVegaSpec = async () =&gt; {<br>      const response = await fetch(props.vegaSpecUrl);<br>      const json = await response.json() as VisualizationSpec;<br>      json.autosize = {<br>        type: &quot;fit&quot;,<br>        resize: false,<br>        contains: &quot;padding&quot;,<br>      };<br>      json.padding = 10;</pre><pre>// configure other aspects: axes, fonts, etc<br>      // ...<br>      <br>      setVegaSpec(json);<br>    }<br>    fetchVegaSpec();<br>  }, [props.vegaSpecUrl]);</pre><h3>Backstage and Vega.js: a powerful combination</h3><p>We are still putting the final touches on the Vega Plugin for Backstage, but we are very happy with the results so far.</p><p>Backstage and Vega are two really powerful open source frameworks that we were using independently. Bringing them together made a lot of sense for us. It should appeal to any organization deploying Backstage.</p><p><strong>Indeed, a picture is worth a thousand words, and this is also true in the developer portals!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf8466f7ce1a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/avalia-systems-blog/backstage-meets-vega-js-for-a-visually-delightful-dx-bf8466f7ce1a">Backstage meets Vega.js for a visually delightful DX</a> was originally published in <a href="https://medium.com/avalia-systems-blog">Avalia Systems</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network programming: #RES prelude]]></title>
            <link>https://medium.com/software-engineering-heig-vd/network-programming-res-prelude-eab67078955a?source=rss-ade0aaa558e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/eab67078955a</guid>
            <category><![CDATA[teaching]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[res2019]]></category>
            <category><![CDATA[pull-request]]></category>
            <category><![CDATA[tdd]]></category>
            <dc:creator><![CDATA[Olivier Liechti]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 11:43:54 GMT</pubDate>
            <atom:updated>2020-02-18T17:42:11.147Z</atom:updated>
            <content:encoded><![CDATA[<p>Getting ready for a new journey towards modern network applications</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PVfm3vS8scdCzQ-djp-MzQ.png" /></figure><h3>Introduction</h3><p>“RES” is the short name for a bachelor course taught during the 4th semester at the University of Applied Sciences and Arts Western Switzerland. It stands for “Réseaux” (Networks in french), which is not the most appropriate name for it. The course is not really about computer networks. It is about network programming, application-level protocols and infrastructures for network services.</p><p>It is mandatory for all students across our four specializations: software engineering, network/systems engineering, security engineering and embedded systems engineering.</p><h3>Objectives of the first week</h3><p>The goal of the first week is to introduce</p><ul><li>What do we mean by “client” and “server”? How can I implement a simple example to demonstrate their interactions (without using the Socket API)</li><li>How should I setup my development environment?</li><li>What is apache maven and how do I use it to build and test my Java library?</li><li>What is project Lombok and why is it worth using it in this course?</li><li>What is the difference between git and services like GitHub, GitLab or Bitbucket? What is the difference between using git commands and using a git workflow?</li></ul><h3>The introductory example: bartender at your service</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fx2TskhWioh3tS%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fx2TskhWioh3tS%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fx2TskhWioh3tS%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/db487c9e0923f7fb59e861d45550b562/href">https://medium.com/media/db487c9e0923f7fb59e861d45550b562/href</a></iframe><ul><li><em>The bartender provides a service</em>. Customers can ask him to do things for them. They can ask him to serve beers, to offer some peanuts or simply to tell what time it is.</li><li><em>Customers are interested in this service</em>. They are thirsty and hungry and would like to ask the bartender to help them.</li><li><em>The bartender and the customers use a communication protocol, even if it is not specified in a technical standard</em>. Think about what happens at the bar: the conversation always follows the same pattern. The bartender is waiting. After making eye contact and exchanging greetings, the customer makes a request. The request is a message with a list of drinks. The bartender then processes the request, which may take some time. He hands over the drinks, and also indicates the amount of the bill. The customer makes a payment. The customer leaves and the bartender goes back to waiting mode.</li><li>It is a nice example, because over time we can add a lot of details and continue to make analogies with network protocols. Think of questions like: how do we ensure that only people over 18 years old can order beverages? How do we handle rush hours? How do we handle food orders that take very long time to prepare? We will come back to these questions during the semester, but this week we will keep things as simple as possible.</li></ul><h3>What do students have to do in the assignment?</h3><ul><li><em>They have to understand what it means to “fork” a repo on GitHub,</em> and how this is different from cloning. We give them a public repo, which contains the skeleton of the project.</li><li><em>They have to understand how to use maven.</em> We ask them to install maven and to validate that they can run it on the command line. Once maven is installed, they can build and test the project skeleton. This should already run a couple of tests.</li><li><em>They have to learn how to specify a behavior with a unit test, and to implement this behavior in a production class.</em> The code that we give them allows a bartender to serve 3 types of beer. We ask them to implement lots of other beverages. Every new beverage is a feature, for which they have to create a short-lived feature branch, and a corresponding pull request.</li><li><em>The goal of the assignment is really to train the workflow, not to write fancy code.</em> This why we ask them to create a different class for every type of beverage.</li><li><em>The code also uses project Lombok and reflection.</em> We briefly introduce their role in the webcasts.</li><li>When students submit their PR, they also see feedback from TravisCI.</li></ul><p>Here is an example of a unit test that students have to write:</p><pre>package ch.heigvd.res.chill.domain.wasadigi;<br><br>import ch.heigvd.res.chill.domain.Bartender;<br>import ch.heigvd.res.chill.protocol.OrderRequest;<br>import ch.heigvd.res.chill.protocol.OrderResponse;<br>import org.junit.jupiter.api.Test;<br><br>import java.math.BigDecimal;<br><br>import static org.junit.jupiter.api.Assertions.<em>assertEquals</em>;<br><br>class BoxerTest {<br><br>  @Test<br>  void thePriceAndNameForBoxerShouldBeCorrect() {<br>    Boxer beer = new Boxer();<br>    <em>assertEquals</em>(beer.getName(), Boxer.<em>NAME</em>);<br>    <em>assertEquals</em>(beer.getPrice(), Boxer.<em>PRICE</em>);<br>  }<br><br>  @Test<br>  void aBartenderShouldAcceptAnOrderForBoxer() {<br>    Bartender jane = new Bartender();<br>    String productName = &quot;ch.heigvd.res.chill.domain.wasadigi.Boxer&quot;;<br>    OrderRequest request = new OrderRequest(3, productName);<br>    OrderResponse response = jane.order(request);<br>    BigDecimal expectedTotalPrice = Boxer.<em>PRICE</em>.multiply(new BigDecimal(3));<br>    <em>assertEquals</em>(expectedTotalPrice, response.getTotalPrice());<br>  }<br><br>}</pre><p>Here is an example of the production class exercised by the test:</p><pre>package ch.heigvd.res.chill.domain.wasadigi;<br><br>import ch.heigvd.res.chill.domain.IProduct;<br><br>import java.math.BigDecimal;<br><br>public class Boxer implements IProduct {<br><br>  public final static String <em>NAME </em>= &quot;Boxer&quot;;<br>  public final static BigDecimal <em>PRICE </em>= new BigDecimal(2.0);<br><br>  @Override<br>  public String getName() {<br>    return <em>NAME</em>;<br>  }<br><br>  @Override<br>  public BigDecimal getPrice() {<br>    return <em>PRICE</em>;<br>  }<br>}</pre><h3>The “Baby Steps” workflow</h3><p>Here is a description of the workflow that students have to go through, as many times as necessary to master it. It takes about 10&#39; to go through the workflow.</p><ol><li>Fork the repo (<em>only the first time</em>)</li><li>Pick something small that you want to work on. Something really small, that you can complete in 20 minutes.</li><li>Express what you want to do by filing an issue on the upstream server (your intent becomes visible to everyone).</li><li>In your fork, create and checkout a feature branch.</li><li>Describe the expected behavior of your feature with unit tests. Implement this behaviour in production code.</li><li>Make sure that your code compiles and that your tests run.</li><li>Commit your changes. Push them to your fork.</li><li>Submit a Pull Request (PR), asking the owner of the origin repository to review and merge your changes. Check for feedback from tools (e.g. Travis CI) and humans (code reviews).</li><li>Repeat steps 2–8.</li></ol><h3>Cheat sheet</h3><pre>Question: How do I fork a repo?<br>Answer:   By clicking the button on the GitHub UI</pre><pre>Question: How do I create and checkout a feature branch?<br>Answer:   git checkout -b fb-my-feature-name</pre><pre>Question: How do I run maven from the command line?<br>Answer:   mvn clean test</pre><pre>Question: What is the difference between a &quot;fork&quot; and a &quot;clone&quot;<br>Answer:   You don&#39;t have access right to my repo. If you want to <br>          make contributions, you need your own copy. This is a fork <br>          (be aware: it is not automatically kept in sync with <br>          origin). Your fork lives in the GitHub cloud. To transfer<br>          files on your machine, you &quot;clone&quot; your fork</pre><pre>Question: How can I retrieve new contributions from upstream (the         <br>          teacher&#39;s repo), after the initial fork? You need to add<br>          a remote with &quot;git remote add upstream ...&quot;. Check out <br>          <a href="https://help.github.com/articles/adding-a-remote/">https://help.github.com/articles/adding-a-remote/</a></pre><h3>I am a RES 2019 student, how do I get started?</h3><ul><li>The repo for the assignment is located <a href="https://github.com/SoftEng-HEIGVD/Teaching-HEIGVD-RES-2019-Chill">here</a>.</li><li>If you speak french, there is a series of webcasts that go through the whole process <a href="https://www.youtube.com/playlist?list=PLfKkysTy70QaN-uez0K4UpSpVUbt8ETpk">here</a>.</li></ul><h3>References</h3><ul><li><a href="https://maven.apache.org/">Apache maven</a> (project page)</li><li><a href="https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html">Maven in 5 minutes</a> (tutorial)</li><li><a href="https://projectlombok.org/">Project Lombok</a> (project page)</li><li><a href="https://www.baeldung.com/intro-to-project-lombok">Introduction to Project Lombok</a> (tutorial)</li><li><a href="https://junit.org/junit5/">JUnit 5</a> (project page)</li><li><a href="https://www.petrikainulainen.net/junit-5-tutorial/">JUnit 5 blog posts</a> (tutorials)</li><li><a href="https://www.youtube.com/watch?v=EZ05e7EMOLM">Ian Cooper’s talk about TDD</a> (video)</li><li><a href="https://learngitbranching.js.org/?NODEMO">Learning git branching</a> (interactive simulator)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eab67078955a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/software-engineering-heig-vd/network-programming-res-prelude-eab67078955a">Network programming: #RES prelude</a> was originally published in <a href="https://medium.com/software-engineering-heig-vd">Software Engineering @ HEIG-VD</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to eat a [monolithic] elephant?]]></title>
            <link>https://medium.com/avalia-systems-blog/how-to-eat-a-monolithic-elephant-e87570e8603f?source=rss-ade0aaa558e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e87570e8603f</guid>
            <category><![CDATA[refactoring]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Olivier Liechti]]></dc:creator>
            <pubDate>Tue, 12 Feb 2019 03:29:15 GMT</pubDate>
            <atom:updated>2019-02-12T03:29:15.096Z</atom:updated>
            <content:encoded><![CDATA[<p>Steering the evolution of a “legacy” software system is a difficult problem to solve. The size of the codebase, the high degree of coupling between components and the <a href="http://wiki.c2.com/?WardExplainsDebtMetaphor">technical debt</a> accumulated over the years can be overwhelming. Often, the lack of automated tests makes every technical change risky and potentially disruptive to the business. Think about customers not being able to place orders because of a library update.</p><blockquote>How do teams approach this uncomfortable situation? When they are tasked with a major refactoring or migration exercise, how do they design a safe transition plan? How do they get started and measure progress?</blockquote><p>In this post, we present a case study to show that a data-driven process, based on the <a href="https://medium.com/avalia-systems-blog/connecting-the-dots-between-business-and-technology-the-promise-of-quantitative-approaches-part-3c9e9f9224b4">Goal-Question-Metric method</a>, can give clarity and confidence to the team. After introducing the approach, we describe some of the tools used to collect the data throughout the process (<em>before</em> and <em>during</em> the migration).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*KhhMVVr8ziFqCyZnDmlzaA.png" /></figure><h3>Case study</h3><p>We recently helped a team who develops a B2B product with a typical multi-tiered architecture. Several web apps interact with a REST API, connected with business and data access services. The software is about 7 years old. While we have worked on much larger, older and complex systems, this application already has a decent size, with tens of endpoints.</p><p>After an initial code review, we identified problems common for legacy systems: unmanaged and outdated dependencies, eroded package and file structure, lack of automated testing, lack of build automation.</p><blockquote>We were asked to propose a technical migration strategy and to work with the team to implement it. The main business drivers for the migration were the cost of maintenance and the security risks associated with outdated libraries and frameworks.</blockquote><p>Our recommendation was not to split a monolith application into a federation of micro-services. <em>Distributed</em> micro-services would have added complexity without any real benefit. Instead, we advised to refactor the legacy monolith into a more manageable and robust monolith. To implement this strategy, we designed an incremental process:</p><ul><li>Create the skeleton of the new monolith.</li><li>Identify <a href="https://martinfowler.com/bliki/BoundedContext.html">bounded contexts</a>, and extract them one by one.</li><li>During the migration, users interact with legacy and “fresh” services.</li><li>After the migration, deprecated endpoints and dead code have been eliminated.</li><li>To safely implement this process, write automated tests (applying BDD techniques) to describe the current behavior of each bounded context. These tests allow us to validate that the behavior of the old and new systems is the same.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*4SwUGxRT1G6km8qtWKf3XQ.png" /></figure><p>In the above diagram, we see:</p><ul><li><em>The legacy monolith (1)</em>. Some of the endpoints and of the code were not used anymore (but we didn’t know how many).</li><li><em>Different clients (2)</em> that interact with the backend system.</li><li><em>The new monolith (3)</em>, built on a clean structure, with managed dependencies. Initially, this new backend does not contain any endpoint. Over time, endpoints and supporting services are migrated over this fresh codebase.</li><li><em>The API Gateway (4)</em>, which we introduced to enable the incremental migration process. The gateway routes HTTP requests to the appropriate monolith. At the beginning of the migration, all requests are routed to the legacy system. At the end, all requests are sent to the new system.</li><li><em>The BDD test harness (5)</em>, which is a suite of automated tests that describe the intended behavior of the backend application. The tests are written at the beginning of the process to describe the behavior of the legacy monolith. During the migration, as the endpoints and the traffic are moved over the new system, the test harness is used to check that behavior of the system has not been altered.</li><li><em>A set of end-to-end tests (6)</em>, are also created to validate the system through the UI layer. Whereas the tests at the API layer need to be comprehensive, a smaller number of end-to-end tests are implemented (typically focusing on the “happy path”).</li></ul><h3>How do we get started?</h3><blockquote>Describing the migration process leaves a number of open questions. How much time will the team need to implement it? And during the process, how will the team be able to measure progress and review the expected completion time?</blockquote><p>Answering these questions is very important to provide visibility to management and clarity to the team. Without it, anyone would feel uncomfortable to start the exercise. This is something that we have observed many times: when teams don’t know the size of the elephant, it is very hard for them to start biting.</p><h3>Framing the problem with Goal-Question-Metric</h3><p>To help the team, we applied the Goal-Question-Metric method. In this particular case, we had two goals:</p><ul><li>When assessing the situation before the migration, our goal was to estimate the overall effort. We came up with 5 questions, and for each question we identified a list of metrics.</li></ul><pre><strong>Goal</strong>          Estimate the effort to do the major refactoring</pre><pre><strong>  Question</strong>    How &quot;big&quot; is the product?<br>    <strong>Metric</strong>    Number of end-to-end scenarios<br>    <strong>Metric</strong>    Number of UI components (apps, pages, components)<br>    <strong>Metric</strong>    Number of REST endpoints<br>    <strong>Metric</strong>    Number of persistent entities<br>    <strong>Metric</strong>    Number of DB queries<br>    <strong>Metric</strong>    Number of source files<br>    <strong>Metric</strong>    Number of commits in git history<br>    <strong>Metric</strong>    Age distribution of source files</pre><pre>  <strong>Question</strong>    What are the most important parts of the app?<br>    <strong>Metric</strong>    Ranking of REST endpoints by usage (from logs)<br>    <strong>Metric</strong>    Estimated business impact of scenarios</pre><pre><strong>  Question</strong>    How &quot;significant&quot; is the refactoring?<br>    <strong>Metric</strong>    Number of libraries / frameworks to replace<br>    <strong>Metric</strong>    Number of libraries to upgrade<br>    <strong>Metric</strong>    Delta between current and target versions of libs<br>    <strong>Metric</strong>    Number of source files that need to be modified</pre><pre><strong>  Question</strong>    How &quot;safely&quot; can we do the refactoring?<br>    <strong>Metric</strong>    % of end-to-end scenarios with automated tests<br>    <strong>Metric</strong>    % of REST endpoints with automated tests<br>    <strong>Metric</strong>    Code coverage<br>    <strong>Metric</strong>    Time required to manually test the application<br>    <strong>Metric</strong>    Developer sentiment</pre><pre><strong>  Question</strong>    How much of the code is still used?<br>    <strong>Metric</strong>    % of REST endpoints still used in usage scenarios<br>    <strong>Metric</strong>    % of code covered when going through scenarios<br>    <strong>Metric</strong>    Developer estimation</pre><ul><li>During the migration, our goal was to track the progress and update the remaining effort. We came up with 2 questions, once again linked to specific metrics.</li></ul><pre><strong>Goal</strong>          Track progress of the refactoring</pre><pre><strong>  Question</strong>    How much did we improve the &quot;safety&quot; net?<br>    <strong>Metric</strong>    % of end-to-end scenarios with automated tests + delta<br>    <strong>Metric</strong>    % of REST endpoints with automated tests + delta<br>    <strong>Metric    </strong>Code coverage + delta<br>    <strong>Metric    </strong>Developer sentiment</pre><pre>  <strong>Question</strong>    How many &quot;services&quot; did we extract and migrate?<br>    <strong>Metric</strong>    % of REST endpoints (with aggregates) migrated<br>    <strong>Metric</strong>    Number of source files removed from the version<br>    <strong>Metric</strong>    Time spent on every test automation<br>    <strong>Metric</strong>    Time spend on every extraction</pre><h3>Extracting metrics</h3><p>With the GQM structure in place, we had to find a way to collect the metrics, in an automated way. We have tools to extract code metrics, but we will not discuss them in this post. Rather, we will focus on the following 2 higher-level metrics, which are harder to collect:</p><ul><li>the percentage of REST endpoints still used in usage scenarios</li><li>the percentage of code covered when going through scenarios</li></ul><p>To collect the data, we designed a system for recording usage scenarios. The system generates log files that link every scenario to a list of endpoints, and to a list of executed methods. For instance, we can use the system to record the “Create invoice” scenario. The system generates metadata that links the scenario to 3 REST endpoints and 12 methods.</p><p>To build the system, we integrated 3 main components:</p><ul><li>We used an <a href="https://github.com/morvader/ExploratoryTestingChromeExtension">open source Chrome extension</a> designed to facilitate exploratory testing. It provides an easy way to record the “start” and “end” of a scenario. The product owner can do a complete walk-through of the application, and signal the start and end of each individual scenario. It can give them descriptive names. At the end of the recording session, the Chrome extension gives us a first event log, with the temporal demarcation between scenarios.</li><li>We used a simple API Gateway in front of the monolith to capture HTTP requests sent to the REST API. This proxy gives us a second event log, where we have a timestamp for every endpoint invocation.</li><li>Finally, <a href="https://openclover.org/">OpenClover</a> is used to instrument the application code and generate code coverage metrics. This produces a third output of timestamped metadata.</li></ul><p>Here is a simplified view of the three generated log files (OpenClover stores data in a database and the process to record sessions is a bit more involved):</p><pre>* Event log 1 (chrome extension)<br>12:02:00 start - invoice customer<br>12:03:12 end   - invoice customer<br>12:04:10 start - print monthly report<br>12:05:00 end   - print monthly report</pre><pre>* Event log 2 (API gateway)<br>12:02:04 POST /api/auth<br>12:02:30 GET  /api/customers/93<br>12:02:49 POST /api/tasks/sendInvoice</pre><pre>* Event log 3 (OpenClover)<br>12:02:04 method com.acme.controllers.AuthController.login<br>12:02:04 method com.acme.services.AuthService.authenticate<br>...</pre><p>It is then fairly easy to process these files. The first one is used to identify temporal boundaries between scenarios. The others are then used to extract the endpoints and method invocations that occur within these boundaries. One way to make this data easy to use is to generate a CSV file, and then to use a data visualization tool like Tableau.</p><h3>Conclusion</h3><p>Of course, setting up a system like that and recording every usage scenario (building the inventory of features) takes quite a bit of time.</p><blockquote>But when this is done, the team has something tangible and quantifiable to work with. The team has a concrete and quantitative way to track the progress of the migration. Moreover, developers quickly have a sense for the amount of deprecated endpoints and dead code.</blockquote><p>As we stated earlier, this is often what teams need to start working on a challenging and overwhelming task. Whether it is a complex refactoring, an initiative to pay back technical debt, or a campaign to introduce automated testing practices, the same high-level approach can be applied.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e87570e8603f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/avalia-systems-blog/how-to-eat-a-monolithic-elephant-e87570e8603f">How to eat a [monolithic] elephant?</a> was originally published in <a href="https://medium.com/avalia-systems-blog">Avalia Systems</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting the dots between business and technology: the promise of quantitative approaches (part…]]></title>
            <link>https://medium.com/avalia-systems-blog/connecting-the-dots-between-business-and-technology-the-promise-of-quantitative-approaches-part-3c9e9f9224b4?source=rss-ade0aaa558e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c9e9f9224b4</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[due-diligence]]></category>
            <dc:creator><![CDATA[Olivier Liechti]]></dc:creator>
            <pubDate>Tue, 05 Feb 2019 07:54:17 GMT</pubDate>
            <atom:updated>2019-02-05T08:04:25.573Z</atom:updated>
            <content:encoded><![CDATA[<h3>Mind the gap between business and technology: connect the dots with data</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uihuRvG_FSDI9Aez" /><figcaption>Photo by <a href="https://unsplash.com/@skmuse_?utm_source=medium&amp;utm_medium=referral">Suad Kamardeen</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>We often hear people talking about “<em>the gap between business and software development”</em>. But what does this actually mean? Can we better characterize this broad statement and make it more concrete with examples? And with this understanding, can we sketch out solutions to improve the situation?</p><blockquote>In this article, our goal is to discuss these questions, by looking at data-driven software engineering approaches. We examine the particular case of software assessments, where the goal is to understand the current state of a software organization (technology, processes and people). We share our experience with the Goal Question Metric method, which has proven to be very effective in these situations.</blockquote><p>Why is it so hard to bridge the gap between business and technical domains? One reason is that it is difficult to establish <em>measurable</em> causal relationships between the two domains. <em>Will we increase revenue if we do more automated testing? Why should we invest resources to reduce technical debt? Are we going to reduce costs if we move towards continuous delivery?</em> Even when business stakeholders understand this jargon, even when they understand the rationale of software engineering practices, they have a hard time quantifying their impact. As a result, investment decisions are not easy to make.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*a6MlCVJfgd8vclklGmoJjg.jpeg" /><figcaption>The challenge of connecting the dots between business and technology</figcaption></figure><h3>Models, conversations and shared understanding</h3><p>To improve the situation, we argue for data-driven approaches that make <em>explicit connections</em> between the technical and business domains. The general strategy is to capture relationships in a model, to feed data into the model and to collaboratively analyze the results. Often overlooked, the last step is fundamental: the conversations enabled by data-driven models produce rich insights, which are the most valuable outcome of the process.</p><p>We have applied this approach in different types of organizations (startups, large companies), across geographies and in various situations (M&amp;A due diligences, internal assessments). We have seen consistent benefits in every one of these projects. Data-driven software assessments are effective in triggering and framing conversations. They do a lot to improve mutual understanding and decision making.</p><h3>How does it improve a technical due diligence?</h3><p>The stakeholders who drive an overall due diligence process are familiar with formulating questions and identifying risks in the commercial, financial and legal domains. They are familiar with measurement models that are specific to these domains.</p><p>However, they usually have a hard time specifying what to assess in the technical domain. Yes, they know that “scalability”, “security”, “quality” and “the dev team” are dimensions that need to be evaluated. But how? And what is even more difficult for them is to grasp how the technical domain impacts the business domain.</p><blockquote>As an example, the links between 1) specific DevOps practices, 2) the frequency of software releases, 3) the ability to respond quickly to market changes and ultimately 4) an increase of the revenue is not obvious to make for non-technical stakeholders.</blockquote><p>When we deliver due diligence projects, we address this problem by applying the data-driven approach described:</p><ul><li>we first create a model that logically connects business concerns with technical practices,</li><li>we then collect data from different sources, feed the data into the model and create visual representations of the results,</li><li>we finally use this material to provide context for interviews and deep-dive sessions with various stakeholders (management, product owners, engineers, etc.).</li></ul><p>Compared to traditional methods, this allows us to get a deeper and more insightful understanding of the situation. We can look at it from various angles and better grasp the strengths of the company under evaluation, as well as the areas that needs improvement and where the acquirer or investor can bring value. This is a learning experience for everyone involved in the process and the feedback from both ends has always been very positive.</p><h3>Research in empirical software engineering</h3><p>Now that we have a sense for the general data-driven approach, we can look at some techniques that are helpful in guiding the process. There are numerous examples in the empirical software engineering literature, with much of this work already completed in the seventies. Research results are now making their way into commercial products and services at an increasing pace. The term <em>software analytics</em> is often used describe to this broad topic.</p><blockquote><em>Software analytics </em>is the analysis of heterogeneous software engineering data, with the goal to understand a situation and to make better decisions.</blockquote><p>The premise is that software engineering is an activity that generates huge amounts of data, and that analyzing this data can help make organizations more efficient. Think about what goes on in version control systems, bug trackers and collaboration spaces. The analysis of traces left by people in these systems can reveal insights about the code, the processes and even the culture of an organization. This feedback is most helpful for organizations who have a continuous improvement mindset, in line with core agile values.</p><p>The idea of analyzing software engineering data to understand a given context is not new. It was already many years ago that Meir Manny Lehman formulated the “<em>laws of software evolution</em>” based on quantitative studies of software data. Among other things, he looked at the frequency of releases and system complexity over time. He derived general principles that apply to the evolution of any large scale software system. Many of the observations he formalized at the time resonate with the rationale of agile approaches.</p><h3>The Goal Question Metric method</h3><p>One particular research outcome in literature is the Goal Question Metric (GQM) method. The result of pioneering work by Victor Basili, GQM is a structured approach that can be used to characterize a situation, to make predictions and to gear improvements. When applying the method, one starts by defining a set of high-level <em>goals</em>. Every goal is then split in a set of more concrete <em>questions</em>. Finally, one identified <em>metrics</em> that make it possible to give quantitative answers to the questions.</p><p>For instance, our goal might be to <em>understand how well we serve our customers</em>, which is fairly abstract. We might then come up with more concrete questions such as : <em>how quickly do we respond to their needs? How often do we cause issues that prevent them to work? Is the frequency of such situations decreasing or increasing? How happy are with our products and services? </em>To answer each of these questions, we might look at very precise metrics such as <em>average response time</em>, <em>lead time for bug fixes per severity</em>, <em>number of new critical bugs per week</em>, <em>Net Promoter Score, churn rate, </em>etc. For every question, one needs to define a formula that combines multiple metrics and produces a measure.</p><blockquote>The Goal Question Metric method is one way to build a model that connect high-level, qualitative outcomes with concrete, measurable elements. It enables informed conversations about business impact based on facts, some of which are measured in the technical domain.</blockquote><h3>Putting it in practice: data-driven due diligence</h3><p>We have seen that data-driven models spanning across business and technical boundaries provide valuable insights, especially when they are used in conversations and interviews. We have also seen that the GQM is one method to build these models and that it helps connect abstract outcomes (goals) with concrete outputs (metrics).</p><p>But what effort is required to apply this technique during a software assessment? What are the skills, time and resources required to get the job done?</p><p>First of all, the team leading the process must have deep expertise in both the business and technical domains. This is necessary to build sound models, but more importantly to moderate and facilitate the discussions between parties. The team must be able to deal with strategic questions, but also to drill down to a very concrete operational level. The team must have hands-on experience with software engineering practices, ideally lasting several decades (many assessments are done when transforming legacy systems into modern cloud-based systems).</p><p>Then, the use of tools can make the process time efficient. We have seen that the process involves 1) the collection of raw data in heterogenous systems, 2) the analysis of the raw data (this sometimes relies on advanced techniques, such as machine learning), 3) the creation of visual and interactive models, 4) the documentation of insights and 5) the review and presentation of findings. There is no shortage of tools that address one or the other of these steps. However, it is not trivial to build a cohesive platform that integrates some of these tools, augments them with advanced capabilities and provides a streamlined, end-to-end experience to the due diligence team.</p><h3>Key takeaways</h3><ul><li>Data-driven models can help bridge the gap between business and technical domains. These models should make explicit connections between technical outputs and business outcomes. They should strive to make this connections measurable.</li><li>The Goal Question Metric method comes from research in empirical software engineering. It is one method to build the data-driven models. It is well suited to the task because it helps link broad qualitative outcomes with concrete measurable elements.</li><li>Software assessments are one situation where the approach is effective, whether they are done as part of a due diligence or for internal purposes. Our experience is that these models are very useful to provide context in conversations and interviews. They have repeatedly helped us gain deeper insights and a complete picture of the situation.</li><li>Applying this approach is not trivial and requires both expertise and time. An integrated toolset can address the second concern, providing a seamless experience during the entire due diligence process.</li><li>Reach out at <a href="/service/mailto:info@avalia.systems"><em>info@avalia.systems</em></a><em> for feedback and more information about our data-driven due diligence method or visit </em><a href="http://www.avalia.io/"><em>www.avalia.io</em></a><em> for more information.</em></li></ul><h3>References</h3><ul><li><a href="https://avalia.io/red-hat-software-due-diligence/">Red Hat’s hidden treasure: The people that are worth billions to IBM</a>, Avalia Systems, 2018.</li><li>Basili, Victor R. <em>Software modeling and measurement: the Goal/Question/Metric paradigm</em>. 1992.</li><li>Lehman, Meir M. “Programs, life cycles, and laws of software evolution.” <em>Proceedings of the IEEE</em> 68.9 (1980): 1060–1076.</li><li>Liechti, Olivier, Jacques Pasquier, and Rodney Reis. “<a href="https://www.researchgate.net/publication/314840996_Beyond_Dashboards_On_the_Many_Facets_of_Metrics_and_Feedback_in_Agile_Organizations">Beyond dashboards: on the many facets of metrics and feedback in agile organizations.</a>” <em>Proceedings of the 10th International Workshop on Cooperative and Human Aspects of Software Engineering</em>. IEEE Press, 2017.</li><li>Menzies, Tim, and Thomas Zimmermann. “Software analytics: so what?.” <em>IEEE Software</em> 4 (2013): 31–37.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c9e9f9224b4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/avalia-systems-blog/connecting-the-dots-between-business-and-technology-the-promise-of-quantitative-approaches-part-3c9e9f9224b4">Connecting the dots between business and technology: the promise of quantitative approaches (part…</a> was originally published in <a href="https://medium.com/avalia-systems-blog">Avalia Systems</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>