<?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[Software testing - Medium]]></title>
        <description><![CDATA[We test software - Medium]]></description>
        <link>https://medium.com/software-testing?source=rss----239a7749558a---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Software testing - Medium</title>
            <link>https://medium.com/software-testing?source=rss----239a7749558a---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 22:39:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/software-testing" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[On TDD]]></title>
            <link>https://medium.com/@royalgoombah/on-tdd-d2427d06cf7b?source=rss----239a7749558a---4</link>
            <guid isPermaLink="false">https://medium.com/p/d2427d06cf7b</guid>
            <dc:creator><![CDATA[Aditya Raghuwanshi]]></dc:creator>
            <pubDate>Wed, 30 Apr 2014 18:36:46 GMT</pubDate>
            <atom:updated>2014-04-30T18:36:46.678Z</atom:updated>
            <content:encoded><![CDATA[<h4>not dead yet</h4><p>DHH’s <a href="http://david.heinemeierhansson.com/2014/tdd-is-dead-long-live-testing.html">rant</a> has been one of the most polarizing articles published in the recent months (even though there are 100’s of ‘X is dead’ articles on HN everyday). If this article was something new from DHH, I would’ve given it more thought, but recently his crusades against people trying to implement SRP in the increasingly complex world of skinny controllers, fat models &amp; concerns have made me incline towards his advice less so. His advice in this article is definitely good once you get past the anger issues (essentially focusing on model tests, controller tests and then feature tests), but as his recent comments on concepts of <a href="http://eng.joingrouper.com/blog/2014/03/20/rails-the-missing-parts-policies/">Policies</a> &amp;<a href="http://eng.joingrouper.com/blog/2014/03/03/rails-the-missing-parts-interactors">Interactors</a> in Rails show, he’s coming from a view that testing is not essential for a coder who’s as good as him.</p><p>Personally, I find the value of unit tests not as much is in building robust code, but more in building clean code. A unit test forces me to think about decoupling which helps down the line when requirements change and you have to throw coupled code out the window, essentially Repeating Yourself. If your module is not testable, that’s just another word for ‘tangled up with dependancies’ and probably violates SRP. I’m not saying that it’s something one should be ashamed of (which somehow DHH feels, is a given), but it’s something that only Unit testing can help sort out. TDD is never a wholesale substitute for thinking about the design of your software, so it’s misleading to argue against that idea as if it’s representative. TDD will only lead to better design and discipline (it’s the same thing that can be inferred from <a href="http://blog.8thlight.com/uncle-bob/2014/04/25/MonogamousTDD.html">Uncle Bob’s article</a>.</p><p>My point can be summarized in a single sentence which I read <a href="http://codon.com/how-testability-can-help">elsewhere</a>:</p><blockquote><em>“Being testable doesn’t make an architecture good, but good architectures tend to be easier to test”.</em></blockquote><p>Lastly, DHH’s article violates the most important tenet of ruby programming:</p><blockquote><em>‘Matz is nice, so we are nice’</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2427d06cf7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RSpec and the power of a puzzle]]></title>
            <link>https://medium.com/@corydiamand/rspec-and-the-power-of-a-puzzle-b219dfdb7ad9?source=rss----239a7749558a---4</link>
            <guid isPermaLink="false">https://medium.com/p/b219dfdb7ad9</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[rspec]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Cory Diamand]]></dc:creator>
            <pubDate>Sat, 19 Apr 2014 13:05:28 GMT</pubDate>
            <atom:updated>2015-04-16T03:09:49.817Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*bNKIBxlAuo45VeL3EZ9tVw.png" /></figure><h4>How fixing scaffold generated RSpec tests can be a powerful exercise for the novice Rails dev.</h4><h4><strong>The Power of a Puzzle</strong></h4><p>I am a junior Rails developer. When I started learning to program I did a lot of programming puzzles to help me build my chops. Puzzles are an effective learning tool because you feel excitement in trying to solve them, and you get this amazing satisfying feeling upon completion. I find that I generally learn more by working on a puzzle than by following an example in a book or off a blog.</p><h4>The Red Challenge</h4><p>I’ve started writing basic RSpec tests for the apps I’m building.</p><p>I’ve found that as I go back and work through the tests that have been generated for me by scaffolding, what I’ve really been presented with are <strong>many small puzzles</strong>.</p><p>Some are pre-generated and require input to work:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*OfHHy3RoT7q9etruTsDnfA.png" /><figcaption>What the eff do I put in here?</figcaption></figure><p>Other times you need to update the test to match how your app works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*5F4_tCYqDfcr_7aHgogWkg.png" /><figcaption>Does my app even redirect here anymore?</figcaption></figure><p>Thanks to RSpec’s red and green fail/pass system, I feel a nice mix of <strong>motivation </strong>and <strong>satisfaction </strong>while working on each test. As a kid who grew up playing videogames, this kind of feedback really works for me:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*bNKIBxlAuo45VeL3EZ9tVw.png" /><figcaption>Still have some work to do….</figcaption></figure><h4>The Green Satisfaction</h4><p>So if you’re new to Rails, or just hesitant about testing, I recommend you give this a try. Let Rails do the work and generate your first set of tests for you, and then just try to fix them. I think you’ll find you’re learning alot and having fun at the same time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b219dfdb7ad9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Testing Hapi Services with Lab]]></title>
            <link>https://medium.com/@sigkell/testing-hapi-services-with-lab-96ac463c490a?source=rss----239a7749558a---4</link>
            <guid isPermaLink="false">https://medium.com/p/96ac463c490a</guid>
            <dc:creator><![CDATA[Fionn Kelleher]]></dc:creator>
            <pubDate>Sun, 30 Mar 2014 21:33:41 GMT</pubDate>
            <atom:updated>2015-08-19T23:48:17.168Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7VtrnRJjEXSiAtqzJI7Ufw.jpeg" /></figure><h4>A primer on Lab</h4><p><strong>UPDATE: This guide is extremely outdated!</strong></p><p><strong>I’m currently writing a book on hapi for O’Reilly called <em>Getting Started with hapi.js</em>. The book covers all of hapi’s main aspects, and promotes testing throughout using lab. I’ll be keeping it up to date with new versions of hapi, so if you’re looking to master the framework, this book could be for you. It’ll be available on </strong><a href="http://shop.oreilly.com/product/0636920040224.do"><strong>O’Reilly’s website</strong></a><strong> as well as </strong><a href="http://www.amazon.co.uk/Getting-Started-hapi-js-Building-Functional/dp/1491926902/ref=sr_1_2?ie=UTF8&amp;qid=1440027932&amp;sr=8-2&amp;keywords=hapi.js"><strong>Amazon</strong></a><strong> in the near future.</strong></p><p><strong>hapi core developers have also written </strong><a href="http://www.amazon.co.uk/Developing-hapi-Edge-Framework-Services-ebook/dp/B013CWI3MY/ref=sr_1_1?ie=UTF8&amp;qid=1440027932&amp;sr=8-1&amp;keywords=hapi.js"><strong>Developing a hapi Edge</strong></a><strong> — if you’re looking to get started now, it’s worth taking a look at too!</strong></p><p>It’s important to test software thoroughly to uncover bugs and potential edge cases. The same goes for HTTP servers, though it’s something that isn’t done as much as it should be. Testing HTTP servers and APIs can be a time consuming task, and making sure every little nook and cranny is tested to work as it should, so you don’t end up having things break when moving into the production stage. Fortunately, testing Hapi servers is an easy task.</p><p>In this tutorial, we’ll start by writing tests for our API endpoints and subsequently implementing them using Hapi. We’ll be testing the “users” endpoints of a mock “social network” API.</p><h3>A Clean Slate</h3><p>Create a new directory for our API, and execute the following commands to create a package and install both Hapi and the Lab testing library. When prompted for a test command, set it to “./node_modules/lab/bin/lab -c”.</p><pre>npm init<br>npm install hapi lab joi --save-dev</pre><p>The only implementation code we’ll write for now is a server with no endpoints. Create index.js with the following code:</p><pre>var Hapi = require(&quot;hapi&quot;);</pre><pre>var server = new Hapi.Server(8080);</pre><pre>if (!module.parent) {<br>    server.start(function() {<br>        console.log(&quot;Server started&quot;, server.info.uri);<br>    });<br>}</pre><pre>module.exports = server;</pre><p>The <em>if (!module.parent) {…}</em> conditional makes sure that if the script is being required as a module by another script, we don’t start the server. This is done to prevent the server from starting when we’re testing it; with Hapi, we don’t need to have the server listening to test it. We’ll explain how this works later on.</p><h3>Time To Experiment</h3><p>Create a directory named <em>test</em>, for — you guessed it — our tests. Now, we can get start to scaffold our API and write tests for it.</p><h4>Testing Our Main Endpoint</h4><p>Let’s create a test suite for the “users” aspect of our network. In the <em>test</em> directory, create <em>users.js</em> containing the following:</p><pre>var Lab = require(&quot;lab&quot;),<br>    server = require(&quot;../&quot;);</pre><pre>Lab.experiment(&quot;Users&quot;, function() {<br>    // tests<br>});</pre><p>We require the Lab testing library as well as our server — which won’t be started automatically for us. The <em>Lab.experiment(…);</em> call sets up our “experiment”. This is equivalent to the <em>describe</em> pattern in other unit test libraries such as mocha; if you want to use this behaviour, assign Lab.experiment to a variable named <em>describe</em>.</p><p>Inside the closure passed to our “Users” experiment, we can place our tests, or other sub-experiments.</p><p>Within the “Users” experiment, lets add our first test to assess route “/users”.</p><pre>Lab.test(&quot;main endpoint lists usernames on the network&quot;, function(done) {<br>    var options = {<br>        method: &quot;GET&quot;,<br>        url: &quot;/users&quot;<br>    };<br> <br>    server.inject(options, function(response) {<br>        var result = response.result;<br> <br>        Lab.expect(response.statusCode).to.equal(200);<br>        Lab.expect(result).to.be.instanceof(Array);<br>        Lab.expect(result).to.have.length(5);<br> <br>        done();<br>    });<br>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*gl9auFqEfEvYWyfHYKX2Dw.png" /></figure><p>Execute <em>npm test</em> and we can instantly see the tests have failed.</p><p>As well as telling us what test failed, as well as a diff between the actual value and the expected value of the assertion. Lab will bail out and halt any remaining tests at this point, allowing us to fix our server to pass the test.</p><p>Notice also how we never called server.start() — Hapi includes a request injection framework to simulate requests on the server without it actually having to be bound to an interface. This is not only useful because we no longer have to worry about what port the server binds to, but also because when a request is injected, we don’t get any overhead from creating a socket connection.</p><p>Switch back to index.js and add a route as follows, and run the tests again:</p><pre>server.route({<br>    path: &quot;/users&quot;,<br>    method: &quot;GET&quot;,<br>    handler: function(request, reply) {<br>        reply({});<br>    }<br>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*Cqx9SVzte8oqSGSb63WGjA.png" /></figure><p>Our first assertion has passed this time, however, since our route returned an object, our second assertion failed expecting the reply to be an Array.</p><p>Let’s change our reply to be an Array rather than an object, since that’s what our test expects.</p><pre>reply([]);</pre><p>Running the tests again, we’re faced with one more problem:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*ACaIOWPSCPVa1mFukn0OBQ.png" /></figure><p>We’re expecting to have five users in the Array, so lets add our container to store our users and fill it up with some details.</p><p>Grab the JSON object <a href="https://gist.github.com/expr/dd8cc175ef3436a3112e/download">over here</a> and save it as database.json. Require it in index.js as so:</p><pre>var database = require(&quot;./database.json&quot;);</pre><p>Our users route will return a list of usernames, so modify our handler to the following:</p><pre>reply(Object.keys(database));</pre><p>Re-run the tests, and low and behold…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*IRwT3bTL_nAMO7Nz4z9Ofg.png" /></figure><p>Lab.expect() is a reference to the chai assertion module; you can find a list of possible assertions in <a href="http://chaijs.com/api/bdd/">chai’s documentation</a>.</p><p>Now, we’re sure that requesting our main endpoint gives us the correct results. But this API is pretty useless this way, so lets flesh it out some more. Grab the rest of our routes <a href="https://gist.github.com/expr/04e0cd866e81a7a32462">over here</a> and add them to index.js. All of these routes are working perfectly; there aren’t any nasty surprises (I tested them myself!).</p><h4>Testing Valid User Creation</h4><p>We now have a PUT route for /users/{username} that we can use to add a new user. It accepts a payload with the following values:</p><ul><li>full_name (string)</li><li>age (integer)</li><li>image (string)</li></ul><p>Let’s add a new test case for this route.</p><pre>Lab.test(&quot;creating valid user&quot;, function(done) {<br>    var options = {<br>        method: &quot;PUT&quot;,<br>        url: &quot;/users/testuser&quot;,<br>        payload: {<br>            full_name: &quot;Test User&quot;,<br>            age: 19,<br>            image: &quot;dhown783hhdwinx.png&quot;<br>        }<br>    };<br> <br>    server.inject(options, function(response) {<br>        var result = response.result,<br>        payload = options.payload;<br> <br>        Lab.expect(response.statusCode).to.equal(200);   Lab.expect(result.full_name).to.equal(payload.full_name);<br>        Lab.expect(result.age).to.equal(payload.age);<br>        Lab.expect(result.image).to.equal(payload.image);<br>        Lab.expect(result.count).to.equal(0);<br> <br>        done();<br>    });<br>});</pre><p>Running the tests, we’ll see that they executed successfully.</p><p>Not everything is tested so far, so I’m going to leave it up to you to test the rest of our endpoints. Here are some things you’ll want to test:</p><ul><li>User is actually added after PUT /users/{username}</li><li>PUT /users/{username} when user already exists returns error object.</li><li>GET /users/{username} on existing user returns user object.</li><li>GET /users/{username} on non-existing user returns error object.</li><li>DELETE /users/{username} returns an object containing a key, “success”, set to true.</li><li>User is non existent after DELETE /users/{username}</li><li>DELETE /users/{username} on non-existing user returns error object.</li></ul><h3>Testing Plugins</h3><p>If your Hapi server utilises plugins, it may be useful to create a test case to make sure they can be required successfully, to test if options are honoured, or behavioural tests in the case of the plugin exposing properties or functions.</p><p>I recommend testing plugins individually rather than testing the server with the plugins loaded. A typical test case for a plugin could look like the following:</p><pre>var Lab = require(“lab”),<br>    Hapi = require(“hapi”);</pre><pre>Lab.experiment(&quot;Lout plugin&quot;, function() {<br>    var server = new Hapi.Server();</pre><pre>    Lab.test(&quot;Plugin successfully loads&quot;, function(done) {<br>        server.pack.require(&quot;lout&quot;, function(err) {<br>            Lab.expect(err).to.equal(null);<br> <br>            done();<br>        });<br>    });<br> <br>    Lab.test(&quot;Plugin registers routes&quot;, function(done) {<br>        var table = server.table();<br> <br>        Lab.expect(table).to.have.length(2);<br>        Lab.expect(table[0].path).to.equal(&quot;/docs&quot;);<br>        Lab.expect(table[1].path).to.equal(&quot;/docs/css/{path*}&quot;);<br> <br>        done();<br>    });<br>});</pre><h3>Code Coverage</h3><p>Our test script outlined in package.json passes the “-c” flag to Lab, enabling code coverage checks. Code coverage gives you an insight as to how broadly your code is actually tested by using the <a href="http://esprima.org/">Esprima ECMAScript parser</a> to compile every possible execution path of your code, then tracking execution to ensure that your tests have covered every possible scenario.</p><p>Code coverage is something that people tend to leave out, and isn’t included in many test libraries by default. I highly recommend using Lab’s code coverage functionality, as keeping a high percentage of coverage will result in better tested code and fewer bugs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96ac463c490a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I AM NOT QA]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@jimmyeisenhauer/i-am-not-qa-8d25fd306973?source=rss----239a7749558a---4"><img src="https://cdn-images-1.medium.com/max/1422/desat/multiply/blue/60/overlay/blue/1*W2W2OuVsnka_HbxvZ5D7hA.png" width="1422"></a></p><p class="medium-feed-snippet">a software quality engineer rant</p><p class="medium-feed-link"><a href="https://medium.com/@jimmyeisenhauer/i-am-not-qa-8d25fd306973?source=rss----239a7749558a---4">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@jimmyeisenhauer/i-am-not-qa-8d25fd306973?source=rss----239a7749558a---4</link>
            <guid isPermaLink="false">https://medium.com/p/8d25fd306973</guid>
            <dc:creator><![CDATA[jimmy eisenhauer]]></dc:creator>
            <pubDate>Wed, 26 Mar 2014 01:58:39 GMT</pubDate>
            <atom:updated>2017-06-09T14:05:22.880Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Feynman and TDD]]></title>
            <link>https://medium.com/@_devbob/feynman-and-tdd-8407d5701aa6?source=rss----239a7749558a---4</link>
            <guid isPermaLink="false">https://medium.com/p/8407d5701aa6</guid>
            <dc:creator><![CDATA[Bobby Grayson]]></dc:creator>
            <pubDate>Tue, 11 Mar 2014 18:27:39 GMT</pubDate>
            <atom:updated>2014-03-13T12:52:22.945Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*apcPBhkpcZ5Rm9ShHOKI6g.jpeg" /></figure><h4>Richard Feynman is smarter than you. And he wrote tests</h4><h3><strong>A setup</strong></h3><p>I have always been helplessly intrigued by the man known as Richard Feynman. My initial foray into this curious character’s work, like many, was one I will never forget. It was 8th grade, I was just getting into tech culture, my first attempts at running Linux were recently successful having gotten Ubuntu 6.06 to run on my home desktop (I requested the free discs online, which to this day is one of the best favors anyone has done me. But that’s another story.), and TechTV had not yet been ruined by Comcast. It was a wonderful time for me, fantasizing about WarSpying, WarDriving, hacking Windows Components into a Mac Mini after Kevin Rose did the same, and other projects of the hacker ethos that took over my rebellious minds capabilities and lack of stimuli from other sources. On a program known as the Screen Savers, for a reason I can’t remember, they referenced a problem of physics:</p><blockquote>A fisherman rowing his boat on a very small lake throws his anchor into the water. Does the water level of the lake rise, fall, or stay the same?</blockquote><p>This is a classical example of a problem from <em>Feynman’s Lectures on Physics </em>and, as many of you know, to a teen just getting into science, technology, and the surrounding world, the answer to this problem is quite fascinating, and at first glance, unintuitive. The water level falls.</p><p>Once this introduction came, I was a fiend to find out anything I could from this guy’s lectures. I began to read every single one. Now what does Feynman have to do with TDD, programming, or anything relevant to these tangentially?</p><blockquote>His Approach.</blockquote><h3><strong>Big problems, simple solutions</strong></h3><p>Feynman was largely known for his prominent method of primarily trusting 19th century calculus as his tool to deduce what was happening in a physical system or to describe some phenomenon. However, his lectures and methodologies, especially the legendary Feynman Diagram, all are extremely intuitive, simple to grasp, and easily explained. People are often surprised to see the amount of complex mathematics that goes into those squiggly lines, straight ones with half arrows, and more. But what let him make this so simple to grasp? Was he a genius? Of course. But he was a genius with a method.</p><p>In Danny Hillis’s essay about working with Feynman over a Summer at his company Thinking Machines, he described this as the approach he would take:</p><blockquote>“For Richard, figuring out these problems was a kind of a game. He always started by asking very basic questions like, ‘What is the simplest example?’ or ‘How can you tell if the answer is right?’ He asked questions until he reduced the problem to some essential puzzle that he thought he would be able to solve.”</blockquote><p>This method is clearly effective. The man is a Nobel Laureate, has solved some of the hardest problems that quantum physics presented the world at the time, and contributed to countless other industries, projects, and fields of science using it. There is something to be said for simplicity. Breaking a large problem into a simple one is exactly what any programmer does when approaching it from the beginning. After all, a computer lacks the context our lovely network of neurons globbed together inside our skulls provide us.</p><h3><strong>Sometimes it isn’t fun</strong></h3><p>Sometimes TDD is a pain. You’ve got an idea. It’s sparked. You want to get in the console and experiment, play in IDLE, whatever. You get distracted and soon a class has been authored in it’s entirety. Oops. Many developers now go back and write the tests, some don’t. But there is a piece that comes to be missing at times when this approach is taken. You may have broken down many of the finer points to their simplest piece, but by actually breaking it down and going piece by piece, in a series of failing tests, almost every time had this route been taken there would be more exceptions, possibilities for failure, or gross oversights caught.</p><p>Feynman dealt with this too. Taking the complex calculus that powers something as simple as a basic Feynman Diagram of an electron and positron colliding to emit a photon would take several hours of lessons at a bare minimum to teach someone with an understanding of calculus even a remote idea of what is going on. Were talking about going from this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hiQFvQlRoLLcGqDU5-lD8g.gif" /><figcaption>Some math actually written and scratched out by Dr. Feynman himself</figcaption></figure><p>To this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*H0lzO37mNmvL4L6OWCu-4Q.png" /><figcaption>An electron positron collision decaying into a photon, and then back to an electron positron pair</figcaption></figure><p>However, by breaking it into these “simplest ways something works or happens” throughout the entire process, once he completes this he was able to create what is debatably the most intuitive methods of illustrating complex physics in the modern day, making it accessible to any elementary school child with a pencil, paper, and a teacher who understands the diagrams principles as well.</p><h3><strong>TDD: Do something somewhat annoying to create something beautiful</strong></h3><p>Well tested code speaks. A new developer knows what will happen, where it will happen, and what he is getting into. Customers do not see these tests, but their services generally are quite reliable and things won’t implode near as often. Everyone wins.</p><p>I guess my overarching point here is this: Some moments I would rather fight a reasonably large pack of wolves than write another unit test. However, for the greater good I find myself defeating this distaste and just doing it. Correlation may not imply causation, but I have found that I have become a much better developer the more I do this. It has forced me to learn to fully understand what every move and change I make is doing, and what it impacts. Unforeseen side effects are caught, exceptions handled, and I have far fewer “dear lord, how will I debug this” moments.</p><p>So, anyways, keep on testing guys. It’s chicken soup for the coder’s soul.</p><p><em>If you enjoyed this follow me on </em><a href="http://www.twitter.com/_devbob"><em>Twitter</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8407d5701aa6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unit Test Native Code for Mobile]]></title>
            <link>https://medium.com/@clibbz0r/unit-test-native-libraries-with-xcode-5-cd85132c1b1?source=rss----239a7749558a---4</link>
            <guid isPermaLink="false">https://medium.com/p/cd85132c1b1</guid>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Cliff Hawkins]]></dc:creator>
            <pubDate>Sun, 16 Feb 2014 22:29:00 GMT</pubDate>
            <atom:updated>2015-10-08T19:51:22.281Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*xWVonyBSrW6NC1zLbsPDKg.png" /></figure><h4>How to set up XCode to unit test your static c++ libraries</h4><p>Recently I had the task of porting an existing serial communications library from .NET to iOS &amp; Android—utilising the bluetooth serial port profile and Apple’s MFi program—to pull efficacy data from medical devices to a companion app.</p><p>I felt really excited about this project, but I had some reservations about forking this business logic into separate implementations.</p><h4><strong>Faced with the thought of having to maintain multiple versions of this library for c#, objective-c <em>and </em>java—I cringed.</strong></h4><p>I cringed because of the high degree of risk in having multiple copies of essentially the same code. When changes to the business logic are inevitably made you incur technical debt: the changes must be synchronised across all three code-bases. Each repayment must be made <em>without </em>introducing bugs or your debt only continues to grow. I cringed because I knew that testing effort would also grow significantly as, of course, all the test cases need to be duplicated and maintained for each code-base. If that sounds costly—think about the time it would take to do manual UAT for each platform. This is the sort of scenario that should evoke that prickly feeling on the back of your neck.</p><blockquote>Never ignore your developer spidey-sense.</blockquote><p>So with big dreams of steering the architecture for the project in such a way as to have one code-base for the coms library that could be shared by .NET, iOS and Android; I was naturally drawn to Xamarin. You may have heard of Xamarin by its former names: CocoaTouch &amp; MonoDroid. Essentially this software promises to compile your existing c# codebase straight to iOS &amp; Android. It <em>almost </em>worked if not for bugs in mono—the open-source .NET framework implementation that Xamarin depends on—but that is another story.</p><p>So I turned to friends and colleagues for alternative options. First I explained what I was trying to achieve and why it was so valuable:</p><blockquote>A single code-base with multiple build targets is a low risk, high return investment.</blockquote><p>A single code-base allows you to focus on what matters: your business logic. It enables to you to refactor your code without fear of introducing unwanted side affects &amp; bugs. It ensures your test suite is always relevant. It frees you from expanding <em>n </em>test cases by <em>m </em>implementations in the name of quality assurance.</p><p>If your library is covered by meaningful unit &amp; functional tests; you can get away with simple integration testing for each build target. Proving that each integrator is able to load the library marshal the types exposed via the public API to the equivalent platform types is good enough.</p><p>From this discussion, the boost libraries became the prime candidate to get the job done on the platforms we needed. Boost is a collection of c++ headers and libraries written with the goal of being as portable as possible—and it is incredibly fast. My new plan was to port the original c# code to c++ and use boost to take care of any platform-specific intricacies of connecting &amp; writing data to the serial port. This one-off investment would pay for itself in its reuse for iOS, Android and even in .NET. All that is required is a way to bind a native library to these target platforms.</p><p>To this end, in .NET there is p-invoke; cocoa has toll-free bridging, using the objective-c++ compiler; and finally, android has the NDK.</p><h4>So I began the task of porting my library to c++.</h4><p>After a quick refresher course on c++ and a glance at the boost documentation I banged out a simple class to send &amp; receive data over a serial port. I also figured since I would inevitably be consuming the library from an iOS app I may as well write my c++ using XCode and get more familiar with the Apple toolchain. I added a freshly downloaded boost installation to my include &amp; library search paths before hitting <em>cmd+b</em> to set the compiler to work. The linker, on the other hand, clearly had other ideas.</p><blockquote>Undefined symbols for architecture x86_64: “boost::system::system_category()”</blockquote><p>It turns out that the <em>boost::system</em> symbols live inside <em>libboost_system.dylib</em> which, coincidently, isn’t pre-built out of the box.<strong> </strong>No problem—there are excellent instructions detailing the build steps on the boost website. I followed them to the letter but soon found more problems when running b2.</p><blockquote><strong>libtool:</strong> unrecognized option ‘-static’</blockquote><p>This one really stumped me. How could boost.build let me down by executing the toolchain with invalid options? A couple of hours spent trawling google yielded some clues…</p><ol><li>There is a GNU toolchain</li><li>There is an XCode toolchain</li><li>There are subtle differences between the two… especially in libtool</li><li>Depending on what you’ve been using your dev machine for in the past, either version of libtool could be present in /usr/bin</li></ol><p>I had been using the GNU toolchain to build mono in my earlier attempts at using Xamarin to bring the coms library to iOS. So, in my case, <em>/usr/bin/libtool </em>was the GNU version. Luckily the workaround here is pretty straightforward—once you understand what is going on.</p><blockquote>Overwrite the GNU libtool with XCode’s own bundled version of libtool</blockquote><p><strong>Pro tip:</strong> make a backup of your existing libtool version. Other projects may be relying on the GNU toolchain to build your stuff!</p><p>With that little gem of ridiculousness out of the way I could now build the boost libraries and get back to building my demo app. I hit <em>cmd+b</em> again and this time the linker didn’t complain.</p><h3>Bridging the gap between XCode &amp; Boost</h3><p>Coming from Visual Studio 2013 with all it’s bells &amp; whistles, I can really appreciate that XCode now has a test runner built into the IDE. I figured there would be more to it than just linking my library and writing the classic boilerplate of <em>arrange, act </em>and<em> assert</em>. The following facts confirmed that I was going to have to go a little further out of my comfort zone:</p><ol><li>XCode test classes must inherit from XCTestCase</li><li>XCTestCase is an objective-c object</li><li>You cannot derive a c++ object from an objective-c object</li></ol><p>You probably already guessed it: <strong>the test cases will have to be written in Objective-c and use toll free bridging to c++ for the items under test. </strong>At the end of the day, this is what any iOS app is going to have to do in order to use my library—so it is highly appropriate to write tests that use the library in the same manner in which it will be used in the real world.</p><blockquote>Test like you fly.</blockquote><p>So as it turns out, this is really easy to do from a coding point of view. You just rename your test class extension from ‘.m’ to ‘.mm’. This convention tells the compiler to use the Objective-c++ compiler for the file in question. Now that the compiler knows what to do, you simply new up c++ classes inside your test method as if you were writing in c++ and everything should be great. But—dang it—the test class wouldn’t compile.</p><p>Every time I hit <em>cmd+u</em> to run my unit test it would fail before hitting a single breakpoint and didn’t write anything to the event log. Eventually I found that you can bring up the debug area and view the target output. It had the clue I needed: It was loading boost as dynamic libraries and iOS only supports static libraries.</p><p>When you build boost on a mac, you end up with <em>.dylib</em> and <em>.a </em>versions of each library all mixed together in the same location. If XCode finds a dynamic <em>and</em> a static version of the same libary in the search path—it always uses the dynamic version.</p><p>So I separated the dynamic libraries from their static counterparts and made sure my project library search path was set to the static path.</p><h4>But it still didn’t work</h4><p>And the target output still showed errors trying to load boost as a dynamic library, even though there weren’t any .dylib files in the library search path. I had a hunch that something funny was going on inside XCode—perhaps that developer spidey sense again. It seemed like a cached dlib file was in play — so I needed to learn some more about XCode to completely hose the build directory. I figured out that XCode stores all build-related metadata, intermediaries and output files in <em>~/Library/Developer/Xcode/DerivedData </em>so I just emptied the contents of this folder.</p><p>I hit <em>cmd+u</em> again…</p><h3>Bingo!</h3><p>I now had an XCode test case, written in Objective-c, linked to my c++ library and able to test any objects and functions exposed in the public API. Now I have a first class unit-testing experience in the XCode just like I do in Visual Studio.</p><p><strong>More importantly, my project can now start where all good projects should: with a failing unit test</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd85132c1b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[To Test a Website, You Have To Rebuild Its Interface]]></title>
            <link>https://medium.com/@thephilwells/to-test-a-website-you-have-to-rebuild-its-interface-94aae45183c2?source=rss----239a7749558a---4</link>
            <guid isPermaLink="false">https://medium.com/p/94aae45183c2</guid>
            <dc:creator><![CDATA[Phil Wells]]></dc:creator>
            <pubDate>Thu, 30 Jan 2014 13:32:23 GMT</pubDate>
            <atom:updated>2014-01-31T12:44:46.558Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/desat/multiply/purple/60/overlay/purple/1*whFkyq3A_-mKctS0KM9ZGQ.jpeg" /></figure><h4>And test against the interface you built</h4><p>If you’re automating tests, then you’re a programmer. What you’re programming is an interface to the application under test.</p><p>Lots of people start software test automation the same way — write a test that runs and stands on its own and lets you know whether X thing on a website, given an input of Y, yields Z. Robot type ‘hello’ into Google, robot click button, robot verify results. It’s all right there: the input data, the paths to the site’s elements, the test assertions, all in one script, and life is good for that test case. It’s a tidy little monolith.</p><p>If your company desperately needed to know at all times that clicking the ‘Go’ button on Google.com returned search results, you’d be sitting pretty. More likely your company has tasked someone (maybe you) with authoring a mountain of test cases, organized into test suites, to verify all the features of whatever application they’re launching or maintaining. If you start like I started, you automate a handful of these cases in the same way — tiny, monolithic scripts that work — and set each aside, but it starts catching up with you.</p><p>You start wrestling with inefficiencies that “real programmers” have been ironing out for years. You’re copying and pasting code for common functions within the application under test. Your UX guy changes the CSS a little and half your scripts can’t find the login text field the following morning. You’re in maintenance hell with your little stable of scripts and you haven’t even automated the smoke test suite yet. What is a test engineer to do?</p><p>Don’t panic. What you need is a dose of <strong>abstraction</strong>.</p><p>Consider that any test script you write should be able to be executed on its own, apart from all the other scripts you&#39;ve written. If your robot needs to sign in to test some protected capability, then signing in should be a component of the test script for that capability. This is important because you may end up realizing that 98.8% of your test cases require the user to be signed in, or to have uploaded a file, or to have accomplished any one of a thousand simple primary actions. Here’s the thing: when the developers of the application wrote that sign-in function, they wrote it once and they put it somewhere where other components of the application could access it. Signing in was such a common use case that to repeat it everywhere that it was needed in the code would have been folly. You should follow suit.</p><p>You’re a programmer, and you need to learn how to set up functions in your language of choice. It should happen in such a way that wherever your monolithic test scripts have the four or five lines that you&#39;ve pasted everywhere that tell your robot to sign in with username “foo” and password “bar” they can instead have one line that sends these values to the function and gets back the access it needs:</p><pre>sign_in(“foo”, “bar”);</pre><pre>verify(robot.is_signed_in);</pre><p>…and elsewhere:</p><pre>sub sign_in(string username, string password) {</pre><pre>    robot.send_keys_to_login_field(username);</pre><pre>    robot.send_keys_to_password_field(password);</pre><pre>    return “success”;</pre><pre>}</pre><p>This is an evolution. This is your code getting mature.</p><p>This is the beginning of a design pattern called <a href="https://code.google.com/p/selenium/wiki/PageObjects">Page Objects</a>. In a nutshell, all the capabilities that can be performed by the application you’re testing should be in functions abstracted away from your test scripts. Any part of your test scripts that return actual pass/fail values should be kept out of those functions. And the easiest way to organize your functions is by grouping them so that capabilities accomplished on the same page (or frequently used component) in the application under test are packaged together in your functional interface. So our friend <em>sub sign_in()</em> up there might be in a whole other file called <em>Login_Page.xx</em>, saved in a place where your test scripts can find it.</p><p>It can seem overwhelming. How will you know which capabilities to program into your interface? The application you’re testing has so many capabilities that it seems you could write interfaces for them all year and never write a single actual test against any of them. The secret is to write the test first.</p><p>This is the beginning of a concept called <a href="http://en.wikipedia.org/wiki/Test-driven_development">Test-Driven Development</a>, or TDD. To wade backward into the generation of our <em>sign_in</em> test above, you would have written the test script, that first chunk, first. You would have then noticed that <em>sub sign_in()</em> doesn’t exist anywhere in the interface you’re building, and so you would go build that second chunk. And you will do the same for every other function needed by your test scripts to interact with the application under test. The advantage is you’ve already got your test cases written. You know what needs to be accomplished. You can write these as test scripts and fill in the blanks in your interface as you go. At any given time your interface will have exactly as much functionality as it needs to take on what your test scripts throw at it and interact with the application you’re testing.</p><p>If any of your tests need you to sign in, you will have a function that does it. And if your UX guy changes the name of the login text field, you will only have to change your code in one place. You’re a programmer — spend less time maintaining your code and more time writing programs that will help your team deliver a quality application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94aae45183c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Higher or Lower?]]></title>
            <link>https://medium.com/@CallaghanDesign/higher-or-lower-32be0a299d32?source=rss----239a7749558a---4</link>
            <guid isPermaLink="false">https://medium.com/p/32be0a299d32</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[user-research]]></category>
            <category><![CDATA[usability]]></category>
            <dc:creator><![CDATA[Chris Callaghan]]></dc:creator>
            <pubDate>Wed, 30 Oct 2013 00:17:41 GMT</pubDate>
            <atom:updated>2016-11-08T21:52:52.961Z</atom:updated>
            <content:encoded><![CDATA[<h4>Making sense of usability findings with criteria based severity ratings</h4><p>Having completed a number of broad usability labs over the last couple of months, I&#39;ve had the opportunity to refine many of my processes, one of which is the logging and analysis of <strong>lots</strong> of usability issues.</p><p>Back in the day when I first started out usability testing, it quickly dawned on me that simply spotting a user having difficulty, logging it as an issue, and then later rating it as <em>high</em>, <em>medium</em> or <em>low</em> just wasn&#39;t good enough.</p><p>From the outset, the rating mechanism was completely subjective, and while the difference between <em>high</em> and <em>low</em> wasn&#39;t that debatable, why an issue was classed as <em>medium</em> and not <em>high</em> or <em>low</em> was.</p><p>As I received my usability lab training from the Nielsen Norman Group, I turned to Nielsen for his approach to <a href="http://www.nngroup.com/articles/how-to-rate-the-severity-of-usability-problems/">severity ratings for usability problems</a>.</p><h4>Nielsen’s severity rating scale</h4><p>“In order to facilitate prioritizing and decision making”, Nielsen suggests the following rating scale to classify usability findings:</p><ol><li>Not a usability issue</li><li><strong>Cosmetic issue:</strong> <em>the fix being</em> a <em>nice to have</em></li><li><strong>Minor usability issue:</strong><em> low priority fix</em></li><li><strong>Major usability issue:</strong> <em>high priority fix</em></li><li><strong>Usability catastrophe:</strong><em> imperative to fix before system release</em></li></ol><p>On reflection, this scale didn&#39;t offer anything beyond the original <em>high</em>, <em>medium</em> and <em>low</em> scale I was trying to replace. Points 1 and 2 were essentially a don’t bother option, <em>catastrophe</em> became my new <em>high</em> and <em>major </em>became my new <em>medium</em>.</p><p>I wanted to confidently report why I had classified an issue as <em>medium</em> and not as <em>high</em> or <em>low</em>, so I dug a little deeper.</p><h4>Nielsen’s definition of a usability issue</h4><p>Turning back to Nielsen, I knew that he defined a usability issue as being a combination of three factors.</p><ol><li>The frequency with which the problem occurs</li><li>The impact of the problem if it occurs</li><li>The persistence of the problem</li></ol><p>I was already recording frequency and impact in my Heuristic Evaluations, so adding a persistence column and updating my final score formula wasn&#39;t going to be any trouble.</p><p>The problem was, I was still going to use a <em>low</em>, <em>medium </em>and <em>high</em> rating for each of the three components. I was still facing the same problem, but making it more complicated.</p><h4>Discovering a criteria based approach</h4><p>After some further research I discovered an article by <a href="https://twitter.com/baekdal">@baekdal</a> who shared the same concerns, but proposed an alternative method to <a href="http://www.baekdal.com/insights/usability-severity-rating">usability severity rating</a> developed on the back of software testers’ rating scales.</p><p>What I liked about Baekdal’s severity rating scale was that it had a clear criteria based approach which significantly reduced the amount of subjectivity (and time) involved in rating an issue. A third party could essentially review the usability log and understand why an issue was rated in a particular way.</p><ol><li>Not an issue</li><li><strong>Minor: </strong><em>Cosmetic issues, spelling issues, non-critical workflow issues</em></li><li><strong>Serious:</strong> <em>Normal status for an issue</em></li><li><strong>Major:</strong> <em>Loss of functionality, problematic impact on a person’s workflow</em></li><li><strong>Critical:</strong> <em>System crashes, workflow breakdown, complete loss of focus for a specific task, loss of information</em></li><li><strong>Fatal:</strong> <em>Blocker, issue prevents further use</em></li></ol><h3>My approach to severity rating</h3><p>Whilst I can’t take any credit for Baekdal’s approach which I did adopt, I can add a number of enhancements that I&#39;ve implemented based on years of using it in the field.</p><h4>Customise the criteria to your system</h4><p>Firstly, ensure you build on the criteria, personalising it to the domain in which the system in question operates.</p><p>For example, when testing a medical software application, it would make sense to add the criterion “incorrect information is presented” to the <em>fatal </em>rating if it has the possibility to impact human life. However, incorrect information for a financial application might be <em>critical</em>, and for hobbyist supplier website might only be <em>major</em>.</p><p>In some instances, you may want to further remove subjectivity. For example, if the system crashes and prevents further use, is that <em>critical </em>or <em>fatal</em>?</p><p>If you’re testing a website which crashes, yet the user can recover by reloading the site, will you <em>ever </em>be able to reach a fatal classification?</p><p>However, for a kiosk software application where the user is unable to perform a software or hardware reboot, fatal is pretty much fatal.</p><p>You may even want to tie in moderator assistance to some of the criteria to help with your classification. <em>Major </em>might include “requires some assistance from the moderator” and <em>critical </em>might include “cannot continue without assistance from the moderator.”</p><p>The key is to define and agree your criteria before starting the severity rating process and make it work for you.</p><blockquote>Aim to arrive at a clear checklist where there’s no debate… “if <strong>this</strong><em> </em>happened, then the issue has to be classed as <strong>that</strong>.”</blockquote><h4>Be client friendly</h4><p>If you decide to agree and define criteria without your client, it would be advisable to consider the terminology used for the five shortcuts (<em>minor</em>, <em>serious</em>, <em>major</em>, <em>critical </em>and <em>fatal</em>) and whether they are suitable.</p><p>For example, reporting back that you encountered two “fatal” issues could be alarming for some clients or a bit melodramatic for others.</p><h4>Make everything serious first</h4><p>One micro-process I have is to first classify everything as <em>serious;</em> this being the normal status for an issue. I then check against the criteria, finding reasons to classify it as something else.</p><h4>Record frequency</h4><p>When recording the severity rating, ensure you record the frequency with which issues occur across the lab.</p><p>For example, if I’m analysing a lab of say five participants, I will create a spreadsheet for each participant and chronologically line item the individual issues. I time-stamp when they occurred in the session and assign the issue a severity rating based on my domain specific criteria.</p><p>When done, I create a master spreadsheet which pulls in all the findings from the individual participant spreadsheets. I remove duplicates, each time adding a +1 to the frequency column.</p><p>This way, I arrive at a single log of all usability issues from the day, with visibility of their frequency, and an appropriate severity rating for each.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*e4qWBgZCRB-kiIKfMvnWIw.jpeg" /><figcaption>Master log combining issues from multiple participant sessions</figcaption></figure><h4>Quick analysis</h4><p>Finally, from the master spreadsheet, I order the data by the frequency column from highest to lowest. I then secondary sort the data by the severity rating, again, highest to lowest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*rTIYBh0Lrr-uH-d3HXvZEw.jpeg" /><figcaption>Master log ordered by frequency of most severe issues. The top half of the list shows recurring issues, while the bottom half shows edge cases by severity</figcaption></figure><p>At this point you will be presented with line items in the order of the most frequently occurring highest rated issues —<strong> these are the guys you’ll want to have a look at first. </strong>The single instance, but high severity issues may be your edge cases and should be investigated further.</p><h4>That’s all folks</h4><p>This concludes my tips and experiences of severity rating in a bid to stop playing “higher or lower” — a guessing game which shouldn&#39;t really have a place in usability test analysis.</p><p>If there’s one take-away…</p><blockquote><em>Define specific and mutually exclusive domain-related criteria to arrive at an unambiguous and quick to use rating system</em>.</blockquote><p>Found this useful?</p><p>Please ❤ <strong>Recommend</strong> for others to see.</p><p>Thank you : )</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32be0a299d32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[why is software effort estimation so difficult?]]></title>
            <link>https://medium.com/@faridtejani/why-is-software-effort-estimation-so-difficult-70a6948d58d7?source=rss----239a7749558a---4</link>
            <guid isPermaLink="false">https://medium.com/p/70a6948d58d7</guid>
            <dc:creator><![CDATA[farid tejani]]></dc:creator>
            <pubDate>Wed, 09 Jan 2019 10:01:14 GMT</pubDate>
            <atom:updated>2019-01-09T10:01:22.915Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r4JZn0AU0XFNjAgfqqI6yA.jpeg" /></figure><p>If you ask a software business sponsor today what their biggest challenge is when dealing with IT, many would respond that software engineers cannot reliably deliver working software to an agreed deadline within known existing parameters (team size, days in the week). In the main, <strong>IT is often perceived as an unreliable partner to its sponsors.</strong></p><p>Certainly there is no shortage of both anecdotal and evidential examples of “failed” software projects: delivered late, under quality, without necessary features, and/or over budget. And if these metrics are baselined against the estimate, we either have a serious problem with competency or with estimation. So are we quite as bad at estimating effort to create software as it seems?</p><p><strong>In the 1990&#39;s I worked with a client who was running a “two year” project which, one year in, was almost three years behind schedule.</strong></p><p>Lest we forget, “modern” computing (from the 1940&#39;s “turing-complete” machines such as Colossus and ENIAC onwards) were funded and developed not to solve the problem of conducting calculations that a human could not do, but to execute these calculations at a speed which were impossible, or at least inefficient to be carried out by humans. Functions such as creating ballistic trajectory tables during the second world war <em>could</em> be done by human operatives but would take over a month each to produce. What we now call “time to market”, <strong>the</strong> <strong>speed of delivery of the outcome of software has always been a feature of software engineering</strong>.</p><p>Granted, software engineering is not like other engineering disciplines; there are far more opportunities for unexpected outcomes caused by unplanned-for interaction between components, and the behavioural attributes of software components are far less well understood than say, in structural engineering. An increase in scale of components means that there are many more permutations to “break the plan”. Unknowns caused by novelty (of language, architecture, business scenario), <a href="http://en.wikipedia.org/wiki/Optimistic_bias">optimism bias</a> and inexperience <em>are</em> factors that indeterminately and (to users) <strong>opaquely</strong> affect the accuracy of estimates. Estimating something that’s never been done before is hard; where exactly do you go for guidance?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*XAEiCanapZ-Y4RMGS9EmYg.jpeg" /><figcaption>source: <a href="https://agiledigest.com/">https://agiledigest.com</a></figcaption></figure><p>IT’s historical response to such complexity is to lock down the requirements. NO changes permitted, or the “plan” (that which we all bow down to) must be redrafted. This approach has historically broken the trust-relationship between business sponsors and technology. Often users became frustrated and increasingly assertive with this bizarre constraint; needs are neither fixed nor fully expressed at the beginning of a project. Technology responded by holding users to ransom: “we will not start the project until the needs are fully understood”. And any software engineer who attempted to put forward an effort estimate in this culture was forever anchored by downward pressure on their estimates.</p><p>Insufficient time and resources are often invested to understanding the problem, let alone the solution. And one thing we know is that software design is full of undiscovered rabbit holes waiting for us to fall in to; <em>Der Teufel steckt im Detail.</em></p><p>Adoption of both behaviour driven and agile engineering has started to solve some of the fundamental dysfunctions within software teams but are often still challenged by the question: <strong>“how long will it take to get this value?”</strong></p><p>The <a href="https://twitter.com/search?q=%23noestimates">#noestimates</a> movement seeks to sidestep the question insofar as <em>“software is essentially a “creative, variable pursuit, [where] solutions are often revealed as we go along” </em>and imposition of estimates <em>“does not allow for (or, at least, does not embrace) emergent design, requirements, change and innovation”</em> (via @neil_killick) so <strong>fixing scope</strong> is essentially broken thinking. <strong>All true</strong>. It’s also true that (from the perspective of development and test at least) estimates are fundamentally irrelevant to shipping working code (which after all, is the point, right?) And worse, estimation potentially threatens the holy grail of software engineering: <strong>estimates have the potential to disrupt flow</strong>. So #noestimates is a pretty enticing concept, especially for a developer.</p><p>But is that it? Are estimates really conceptually indistinguishable from a fixed scope? Should estimates be avoided because they contribute nothing to the code, are essentially difficult and disruptive?</p><p>#noestimates is <a href="http://neilkillick.com/2013/01/31/noestimates-part-1-doing-scrum-without-estimates/">on the money</a> when it seeks for <em>“teams to commit at the outset to building and delivering the best possible product by a given date and/or for a given amount of money”</em>. And yes, <em>“release planning using velocity is contrary to an iterative approach (holistic, evolutionary improvement of the product) and is more in line with a purely incremental approach (delivering a pre-defined Product Backlog feature by feature)”</em>.</p><p>But perhaps this somewhat misses the point. technology is a service industry; IT exists to meet the needs of users, often by creating working software. Iterative software development to improve features, yes of course, but <strong>unmet need is unmet need, whether that is for code or for estimates</strong>.</p><p>Software engineers expect their users to give them direction in BDD / story writing and fund software development activity. Software engineers seek commitment, guidance and a partnership (of sorts) from business users, and <em>vice versa</em>. <strong>This is not a transaction that takes place at code delivery</strong>; it happens before, during and after the sprint. It happens continuously, across projects, products and suites. And the estimation game is a joint activity not exclusively an IT task. By refusing to engage in estimation, IT is failing to fulfil its commitment to developing the trust-relationship with its business stakeholders.</p><p><strong>The most dangerous strategy is to jump a chasm in two leaps.” ~Benjamin Disraeli</strong></p><p>From a business sponsor’s perspective, software engineers asking for a degree of trust where estimates are not required straight off the bat is a non-starter. How do you decide if you want to invest in something unless you have a qualified estimate as to how much it’ll cost or when you’ll get it? Moreover, in banking, just as for the first modern computers, <strong>value is often a direct function of the delivery date. </strong>Being able to go long on turkeys doesn’t have much value if the system ain’t working by thanksgiving. And being able to get a missile to hit its target is no good if the war is over and lost, which, after all, is what drove the creation of the modern computing industry (vs. human processors) in the first place. <strong>Software engineers must go to their users to establish their users’ needs; a qualified, accurate estimate is a need.</strong></p><p>Without a doubt, estimation is an over-valued activity in many organisations. Every organisation has ‘clipboard project managers’ whose sole purpose is to maintain a gantt chart as if they were in some kind of wilful purgatory. Yet, perhaps the great difference between a coder and a professional software engineer is that professionals code against constraints. One of the major constraints is the reality of time being finite. So whilst (in its purest form) estimation is somewhat irrelevant to making working code, <strong>in the real world, time is a real constraint that professionals have to learn to work within</strong>.</p><p>In highly regulated environments, <em>“the best possible product by a given date and/or for a given amount of money”</em> may not realise any business value at all if that “best possible product” is insufficient to meet regulatory requirements. There is a mandatory fixed scope and it is unavoidable. If then there is a fixed scope to be met and perhaps the date is fixed, then (assuming quality and skills are constant) the only remaining variable is money. Any investment must return value by increasing the ability of the team to execute.</p><p>Perhaps estimates are less important for start-ups building an MVP? But wait. By definition, there are a minimum set of features required to realise value. And usually a fixed runway of funding. Without estimates to guide such decision making how do we know that the product vision is in any way realistic? Without this knowledge, do we know if we shouldn’t consider pivoting now? <strong>Good quality estimates are necessary to fail fast</strong>.</p><p>What about environments where any minimum scope has been reached and value has been baselined? Perhaps estimates are less valuable here, but we rarely (but not always) find ourselves in this space after technology and business stakeholders have reached a mature, stable and trust-based relationship.</p><p>BDD / SBE / ATDD does enable a team to scale by front-loading the effort (more on this in the next blog post), but it’s neither a linear, perfectly scalable investment (“nine-women, one-month”), nor have we ever seen investment made without some estimate of the work to be completed.</p><p>Estimation is also a value path. In order to estimate, development (a coder and tester) needs to review, consider, and produce a high level plan of execution for the feature. So in many ways the discipline of “forcing” estimation is very important: it ensures communication within the team, and that both the developer, tester and user have a common understanding of what is to be done, how it will be done (to a degree), the universe this solution exists in, what the risks and unknowns are.</p><p>Management. Somewhere in any organisation, there’s a person who decides whether we hire that extra developer, or tester, or splits the teams. This person has needs too. Usually to act to avoid the crisis, not after. For projects (yes, we used the “P” word), <strong>qualified estimates enable management to help avoid failure and sponsors to gain confidence that the team understands it’s WIP</strong>.</p><p>We have to square the circle here. Yes it’s absolutely necessary to educate all parties involved about what an estimate actually is. Estimates are not guarantees of delivery. And estimates without confidence intervals are near-valueless. But if software engineers refuse to offer such qualified estimates at all they shouldn’t expect to be given the opportunity to start most software activities.</p><p>Technology and business stakeholders look to each other to build a mutual partnership, trust-based relationship of equals. Estimates are part of that equation; without high-quality estimates (that are jointly understood as being no more than estimates), business stakeholders can (and will) avoid starting most development initiatives, and impose six-sigma on to the rest.</p><p>Farid Tejani is a Partner at <a href="https://amplab.co/">Ampersand</a>, a boutique strategy and management consultancy specialising in sustainability, emerging technology and product innovation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70a6948d58d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Testing with TDD]]></title>
            <link>https://medium.com/@paulydiesel1/testing-with-tdd-507239526060?source=rss----239a7749558a---4</link>
            <guid isPermaLink="false">https://medium.com/p/507239526060</guid>
            <dc:creator><![CDATA[Paul Dornfeld]]></dc:creator>
            <pubDate>Mon, 09 Dec 2013 04:51:56 GMT</pubDate>
            <atom:updated>2013-12-09T04:51:56.153Z</atom:updated>
            <content:encoded><![CDATA[<h4>deploying with with test driven deployment</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*iweTWesW2LWOJ30qr4Z65Q.png" /><figcaption>Rules to follow for proper TDD implementation</figcaption></figure><p>This past week at Launch Academy we explored and continued our quest towards mastering Agile Development by introducing Test Driven Development (TDD). TDD is difficult and an added layer of complexity on top of already complicated code writing. However, there are many pros to mastering TDD when writing applications.</p><p>By incorporating TDD into your workflow you over time grow a test suite of spec files where all your tests reside for your Classes. As your application grows and interdependency can occur, having a test suite can protect you from chaos from changing something in one class, and not necessarily knowing the wide ranging effects it might have. If you have implemented with TDD however, you will have instant feedback to the impact of your change across the application.</p><p>Implementing TDD is difficult however and requires patience and resolve. TDD can be hard because sometimes what seems the easiest is to just start writing code and if it fails keep refactoring until it works. TDD is also hard because of the syntax. Finding a way to express exactly what you want to test can be a challenge for many things, and if you dont write your tests properly, your code will never pass. Another challenge is not overtesting. Knowing what to test for and what to not test for is another piece of TDD that is challenging. I am trying to test only outputs to my methods, ensuring the return values I am looking for are in fact those return values. Another difficult testing attribute is testing for Border Conditions, which are the values that are not what are unexpected inputs into your program. For example, an alphabetical character when your program expects a number — these types of inputs can reak havok on your program if border conditions are not addressed.</p><p>TDD has many pros and I keep reminding myself that they outweigh the cons. TDD is supposed to drive your development and I believe the more I work at it, the more efficient my programming outputs will be and the more refined by programs will become.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=507239526060" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>