<?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 Sam Bird on Medium]]></title>
        <description><![CDATA[Stories by Sam Bird on Medium]]></description>
        <link>https://medium.com/@sam.bird?source=rss-868a5aad768c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*8uda5AITPd6tLUPx.</url>
            <title>Stories by Sam Bird on Medium</title>
            <link>https://medium.com/@sam.bird?source=rss-868a5aad768c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 23:04:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sam.bird/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[3 reasons why Gatling is the perfect tool for performance testing your API’s]]></title>
            <link>https://medium.com/john-lewis-software-engineering/3-reasons-why-gatling-is-the-perfect-tool-for-performance-testing-your-apis-847b52bbeb60?source=rss-868a5aad768c------2</link>
            <guid isPermaLink="false">https://medium.com/p/847b52bbeb60</guid>
            <category><![CDATA[gatling]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Sam Bird]]></dc:creator>
            <pubDate>Mon, 05 Feb 2018 16:01:29 GMT</pubDate>
            <atom:updated>2018-02-07T12:45:10.624Z</atom:updated>
            <content:encoded><![CDATA[<p>My current assignment resides in the world of software testing, specifically performance load testing John Lewis’ e-commerce engine API. This API handles a range of functionalities across all Online channels (i.e., desktop website, mobile apps…) so monitoring levels of performance and ensuring optimal response rates is fundamental to our customers.</p><p>But with an API that has to be capable of supporting channels 24/7 and at peak times see’s <a href="https://news.sky.com/story/black-friday-breaks-john-lewis-trading-record-11147867">over 700 orders a minute</a>, how can such load be simulated to analyse performance?</p><p>Testers are being challenged to automate, utilising many technologies from the open source community (<a href="https://www.engadget.com/2018/02/03/20-years-of-open-source-software/">which recently turned 20</a>). There are many tools available depending on the type of testing required, but for load testing specifically and for this assignment, I’ve been using <a href="https://gatling.io/">Gatling</a> and I wanted to share a few reasons why.</p><p><strong>1. Test scenarios are maintainable and easy-to-read</strong></p><p>Gatling’s Domain-Specific Language (DSL) makes code highly readable, even to those with limited programming background, which is an advantage to many who are used to more manual forms of testing.</p><p>Let’s build a scripted scenario, showing how a HTTP request can be constructed to add an item to an e-commerce basket along with test data:</p><pre><strong>private val </strong><em>sessionFeeder </em>= csv(&quot;sessionIds.csv&quot;).random<br><strong>private val </strong>item<em>Feeder </em>= separatedValues(&quot;itemIds.txt&quot;, &#39;;&#39;).random</pre><pre><strong>val </strong><em>postBasket </em>= exec(feed(<em>sessionFeeder</em>)).exec(feed(item<em>Feeder</em>))<br>  .exec(http(&quot;POST Item to Basket&quot;).post(baseURL + &quot;/api/basket&quot;)<br>  .header(&quot;Cookie&quot;, &quot;${sessionId}&quot;)<br>  .header(&quot;Accept&quot;, &quot;application/json&quot;)<br>  .header(&quot;Content-Type&quot;, &quot;application/json&quot;)<br>  .body(StringBody(<br>    &quot;&quot;&quot;{<br>      |    &quot;item&quot;:<br>      |    {<br>      |      &quot;skuId&quot;: &quot;${itemId}&quot;,<br>      |      &quot;quantity&quot;: 1,<br>      |    }<br>      |}&quot;&quot;&quot;.stripMargin<br>  )))</pre><p>To begin with, I’ve used Gatling’s Feeder to inject test data from source files. This data is then fed into the Cookie and body of the request using the ${value} notation to better replicate a live environment, as you would want to change these variables; so the same item is not added to the same basket in every request by a user during the simulation.</p><p>Using .post() configures it for a POST request type, with the endpoint URL passed in as a parameter. Headers have been added to the request, along with a body, conforming to the API.</p><p><strong>2. Virtual users can be injected with automatic connection management</strong></p><p>With the request now built, virtual users are ready to be injected. This can be done in a number of ways (i.e., throughput) depending on your test, but for this example we’ll ramp up to 250 users in 10 seconds and maintain this level for the next 50 seconds as so:</p><pre>val httpProtocol = http.baseURL(&quot;<a href="http://www.johnlewis.com/">http://www.yourEcommerceSite.com</a>&quot;)<strong>.shareConnections</strong></pre><pre>postBasket.inject(<br>   rampUsersPerSec(1) to <strong>250</strong> during (<strong>10 seconds</strong>),<br>   constantUsersPerSec(<strong>250</strong>) during (<strong>50 seconds</strong>)<br>).protocols(httpProtocol)</pre><p>When many connections are generated in a short time to create this level of load, ports on the host operating system can become saturated. Unlike some other load testing tools, Gatling ensures that once a connection has been released by a user, it can be reused by another thread, reducing the number of connection errors thrown. To achieve this, simply call the .shareConnections() function on your protocol.</p><p><strong>3. Easy integration with CI/CD with performance reporting</strong></p><p>Despite Gatling’s DSL, under the hood it’s written in the Scala programming language and ultimately runs on a Java Virtual Machine (JVM). This is no desktop application and as such using build automation tools such as <a href="https://gradle.org/">Gradle</a> allows a simple task in your build.gradle file to seamlessly run all tests with a one-line command. This can then be embedded into a CD pipeline with the likes of Jenkins using an available plug-in straight out of the box.</p><p>But to understand if performance has degraded since the last run, we need to collate and aggregate performance related metrics to benchmark against.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tYhl4YuN_DyVLZepZ3S8WA.png" /><figcaption>* Results are not based on above request constructed, simply to show example stats collated</figcaption></figure><p>Thankfully, Gatling generates a complete report of your simulation in HTML format to analyse this data. Gatling calculates the means, averages and percentiles of your response times’ distribution. Not only can you drill down into each request in detail to check response times for passed and failed tests, but to make your analysis even more visual, graphs are created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0DhnFKqM6-4xlpalgS4KEA.png" /><figcaption>Graph: Ramping to 250 users in 10 seconds and holding constant for 50 seconds</figcaption></figure><p>I hope you find this blog useful and and that you’ll utilise Gatling to help you identify ways to make better and faster improvements to your web application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=847b52bbeb60" width="1" height="1" alt=""><hr><p><a href="https://medium.com/john-lewis-software-engineering/3-reasons-why-gatling-is-the-perfect-tool-for-performance-testing-your-apis-847b52bbeb60">3 reasons why Gatling is the perfect tool for performance testing your API’s</a> was originally published in <a href="https://medium.com/john-lewis-software-engineering">John Lewis Partnership Software Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An ‘AI-first’ world is challenging ethics and society]]></title>
            <link>https://medium.com/room-y/an-ai-first-world-is-challenging-ethics-and-society-f41d81e3be79?source=rss-868a5aad768c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f41d81e3be79</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[society]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ethics]]></category>
            <category><![CDATA[robotics]]></category>
            <dc:creator><![CDATA[Sam Bird]]></dc:creator>
            <pubDate>Wed, 04 Oct 2017 07:01:02 GMT</pubDate>
            <atom:updated>2017-10-04T13:31:34.016Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m3vlxneAo50hBQYOZbT_ug.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/2EJCSULRwC8?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Alex Knight</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>As an active enthusiast in the field of Artificial Intelligence (AI) I, like Google am always thinking with my ‘AI-first’ hat on. ‘Can we streamline that manual process using advanced decision making systems?’ or ‘How could we use an AI powered natural language processing chat-bot to solve that customer query?’.</p><p>These are questions I often ask myself and pose to my fellow Partners.</p><p>My biggest take-away from Room Y is how important empathising with the end user is, putting our Partners or customers at the heart of the design process.</p><p>Many John Lewis and Waitrose customers and indeed our Partners value the way we as a Partnership operate, maintaining our high corporate social responsibility standards. With that in mind, when designing AI there are several considerations to be made.</p><p>First let’s take a step back and take a look at some real-life applications highlighted below:</p><ul><li><strong>Robots —</strong> Japanese industrial firms have been competing to build humanoid robots acting as domestic helpers for the elderly and physically handicapped for some years.</li><li><strong>AI Software — </strong>This is now responsible for majority of the activity on Wall Street, transforming the financial industry’s ability to crunch numbers and make decisions at a rate in which no human could ever achieve.</li><li><strong>Autonomous Vehicles — </strong>Many vehicle manufacturers are testing the waters with this, with Elon Musk stating his new Tesla Model S will be driving from a car park in L.A. to New York by the end of the year with no human intervention required.</li></ul><p>Ethical and social issues could arise from any of the above, though this is entirely dependent on the nature of the system and its functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*JgyfHw-h4Fqq0mVLWDywfw.png" /></figure><h3>Ethical Issues</h3><p><strong>Robot Rights<br></strong>Similar to human rights, a robot with a level of autonomy should have rights so that the moral obligations of society are considered. With the right to life, equality before the law and freedom of thoughts, contextual ethical issues are bound to arise.</p><p>With relation to Japanese domestic helpers, it can be argued that the use of robots here are to make human life easier, though from an ethical point of view, using human-like machines to carry out menial tasks could be seen as a form of slavery.</p><p><strong>Human Dignity<br></strong>To avoid breaching human dignity ethics, AI should perhaps not be used to replace those in positions that require both care and respect; such as customer services, nursing and the police force. However, based on recent developments it is evident that in the future there is potential for robots to take up such responsibilities.</p><p><strong>Machine Ethics<br></strong>Though it can be perceived as being implausible, Nick Bostrom, a philosopher at the University of Oxford, claims that <a href="https://www.simulation-argument.com/simulation.pdf">AI has the capability to make humans entirely extinct</a>. There is no direct evolutionary motivation for AI machines to be friendly to humans and AI machines may have their own evolutionary pressures as they compete with other similar machines.</p><p>There is no way of determining the extent of the capabilities a machine is able to acquire and what level of threat this might cause. So I suggest keeping a close eye on it…</p><h3>Social Issues</h3><p>An advantage to society is the creation of new jobs in relation to the profession. <a href="https://www.recode.net/2017/4/3/15123006/robots-sold-america-growth-300-percent-jobs-automation">ABI Research recently found there was a correlation between the increase in robotics shipments with U.S. job growth</a>. Another advantage AI creates is their ability to increase job satisfaction, by assisting with aspects of the role. For example, improved accuracy can be achieved which is vital within the financial services industry.</p><p>Although there are advantages related to a workforce with AI capabilities, many tasks that were once only performed by humans are likely to become redundant. Job losses and ultimately unemployment would increase, leading to a multitude of other issues impacting the economy and wider society.</p><p>Any further investments the Partnership makes into AI must prioritise the considerations of the highlighted impacts, but most importantly the John Lewis Partnership must remember to link back to Principle 1 of our constitution. Our ultimate purpose is the happiness of all our members (Partners), through worthwhile and satisfying employment in a successful business.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f41d81e3be79" width="1" height="1" alt=""><hr><p><a href="https://medium.com/room-y/an-ai-first-world-is-challenging-ethics-and-society-f41d81e3be79">An ‘AI-first’ world is challenging ethics and society</a> was originally published in <a href="https://medium.com/room-y">Room Y</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>