{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "Joe Smith&#39;s Blog",
  "language": "en",
  "home_page_url": "https://bjoli.com/",
  "feed_url": "https://bjoli.com/feed/feed.json",
  "description": "I&#39;m a software engineer stoked about Open Source Software &amp; scalable infrastructure.",
  "authors": [
    {
      "name": "Joe Smith",
      "url": "mailto:yasumoto7@gmail.com"
    }
  ],
  "items": [
    {
      "id": "https://bjoli.com/posts/pathfinder/",
      "url": "https://bjoli.com/posts/pathfinder/",
      "title": "Pathfinder Society",
      "content_html": "<div id=\"content\">\n<p>I love to step away from the computer to play the tabletop roleplaying game,\n   <a href=\"http://paizo.com/pathfinder\">Pathfinder</a>.</p>\n<h2 id=\"bay-area-pathfinder-society\">Bay Area Pathfinder Society</h2>\n<p>I'm a <a href=\"http://paizo.com/people/Yasumoto\">Venture Lieutenant for San Francisco</a>,\n   which means I help organize events and conventions, in addition to\n   <a href=\"https://www.facebook.com/BayAreaPathfinderSociety\">running our Facebook page</a>.\n   If you're in the San Francisco Bay Area, there are a lot of great games hosted by the\n   <a href=\"https://bayareapathfinder.com\">Bay Area Pathfinder Society</a>! In particular,\n   <a href=\"https://warhorn.net/events/endgame\">Endgame in Oakland</a> hosts events on Monday\n   evenings, and <a href=\"https://warhorn.net/events/gamescape-sf-pfs\">Gamescape in San Francisco</a>\n   hosts a Saturday game day each month.</p>\n<h2 id=\"publications\">Publications</h2>\n<p>Zenith Games recently published\n   <a href=\"http://zenithgames.blogspot.com/2016/10/the-colossal-creatures-bestiary.html\">The Colossal Creatures Bestiary</a>\n   which contains a massive Raccoon-like creature I designed called a <i>Procyon</i>! It was a great\n   experience to work with that group, and it's available\n   <a href=\"http://paizo.com/products/btpy9p9l/discuss?The-Colossal-Creatures-Bestiary\">on the Paizo webstore</a>\n   if you'd like to take a look!</p>\n<p>The fine folks behind <a href=\"http://paizo.com/products/btpy9e73?Wayfinder-13\">Wayfinder #13</a>\n   also published my description of two characters based in the city of Caliphas! Spanning two\n   pages and 1500 words, you can read about both <a href=\"https://bjoli.com/images/wayfinder_13_almira.jpg\">Captain Almira Perine</a>\n   and <a href=\"https://bjoli.com/images/wayfinder_13_liald.jpg\">Captain Liald Gaspair</a>! The character art is by the\n   <a href=\"http://bobgreyvenstein.deviantart.com\">amazing Bob Greyvenstein</a>.\n</p>\n</div>\n",
      "date_published": "2016-10-24T00:00:00Z"
    }
    ,
    {
      "id": "https://bjoli.com/posts/axes_of_testing/",
      "url": "https://bjoli.com/posts/axes_of_testing/",
      "title": "Axes of Testing",
      "content_html": "<div id=\"content\">\n<h1 style=\"color: grey;\" id=\"axes-of-testing\">Axes of Testing</h1>\n  <p>I've tried many different tacks when explaining the benefits of unit testing to other\n     developers (and proving to myself that they are worth it). Tests are not a silver bullet,\n     they are just another tool in your war chest, and certainly have their limitations. What\n     follows is the best breakdown I've come up with to describe the various types of tests and\n     when to lean on them. I presented this at a Twitter-internal Python tech talk, and many\n     teammates nudged me to publish it externally. I hope it will allow others to understand how\n     to approach adding different types of tests for your codebase.</p>\n<h2 id=\"the-spectrum-of-testing\">The Spectrum of Testing</h2>\n  <p><i>Big and Small, Real and Fake</i></p>\n  <p>Initially, I started using a single axis to try to delineate between \"small\" unit tests and\n     \"widely-scoped\" integration tests. This wasn't effective, as I got lost when trying to figure\n     out how to deal with moving away from real dependencies (sending prod traffic to other\n     services) vs. making sure I replaced those interactions with mocks or fakes so I could still\n     run my tests on an airplane.</p>\n  <p>This helped me realize that I was actually staring at (at least) a two dimensional spectrum,\n     and thus the axes were born.</p>\n  <h2 id=\"axes\">Axes</h2>\n  <p><img alt=\"bare axes\" style=\"max-width: 100%; height: auto; width: auto;\" src=\"https://bjoli.com/images/01_axes.png\" width=\"512\" height=\"384\"></p>\n  <h3 id=\"horizontal\">Horizontal</h3>\n    <p>The first, horizontal axis covers whether or not you're sending traffic to live\n       production, or just mocked out services. If you run <code>curl http://twitter.com</code>,\n       then you're hitting Twitter's website. However, if you change\n       your <code>/etc/hosts</code> file to instead point that hostname to your localhost where\n       you're running a web server, then you've taken a step away from \"production\" and toward a\n       faked out <a href=\"http://twitter.com\">twitter.com</a>.\n  </p><h3 id=\"vertical\">Vertical</h3>\n    <p>The second, vertical axis is used to show the \"size\" of a test— how much of the system is\n       exercised when executed? Using that <code>curl</code> example above, that is a test that\n       sweeps the gamut of infrastructure. It ensures that the <code>curl</code> binary is\n       installed on your system, your machine is connected to the Internet (with DNS, etc.), but\n       also that Twitter's front-end infrastructure is serving correctly. This requires all of\n       those pieces to work, and an error in one component will cause a failure for the entire\n       test.</p>\n    <p>At the low end, you have a test which is akin to a shell script called <code>./curl</code>\n       which just ensures you pass in <code>http://twitter.com</code> as the only argument. This\n       isolates your execution from all other variables than just the way you're calling\n       <code>curl</code>, but the downside is you're not really ensuring that you are using things\n       correctly. If, for instance, <code>curl</code> gets updated to change the way it takes a\n       URI for an argument, then you won't notice by running your test script, since it's not\n       actually invoking <code>curl</code> at all. Also, if (heaven forbid..)\n       <a href=\"http://twitter.com\">twitter.com</a> goes down or moves locations, you won't notice\n       that either.</p>\n  <h2 id=\"extremes\">Extremes</h2>\n  <p>Let's take a look at what would happen if we just followed some of these options to the max</p>\n  <p><img alt=\"extremes\" style=\"max-width: 100%; height: auto; width: auto;\" src=\"https://bjoli.com/images/02_the_extremes.png\" width=\"512\" height=\"384\"></p>\n  <h3 id=\"brittle\">Brittle</h3>\n    <p>If you are testing the whole end-to-end pipeline of a task, then a small break in any piece\n       will grind your entire test to breakage. Large, broken test suites are tough to debug\n       because you won't be able to tell which component is causing your failure without looking\n       at the error message in detail.</p>\n  <h3 id=\"dependent-services\">Dependent Services</h3>\n    <p>If you have a service which has zero mocks, and fully depends on all of production\n       responding and working at all times, then it will break <i>anytime</i> there is an issue\n       with any small piece. Many downstreams in a test can be difficult to keep running\n       frequently and reliably without a ton of work to ensure they are all stable.</p>\n  <h3 id=\"interaction-validation\">Interaction Validation</h3>\n    <p>If you have very small-scoped tests, then you may miss huge interaction problems, and may\n       not realize that you are sending the wrong format of data between various services, or\n       perhaps are not rate-limiting the total number of requests (or any of an infinite number)\n       of interactions.</p>\n  <h3 id=\"no-confidence\">No Confidence</h3>\n    <p>If everything is mocked out, then you're spending all your effort on re-building\n       infrastructure and pieces, without gaining any benefits of testing the actual systems you\n       care about!</p>\n  <h2 id=\"worst-of-all-worlds\">Worst of All Worlds</h2>\n  <p>We can get even worse by blindly combining some of these ideas as well!</p>\n  <p><img alt=\"bad ideas\" style=\"max-width: 100%; height: auto; width: auto;\" src=\"https://bjoli.com/images/03_worst_of_all_worlds.png\" width=\"512\" height=\"384\"></p>\n  <h3 id=\"testing-in-production\">Testing In Production</h3>\n    <p>If you want to ensure you're causing problems for your users, throw some additional monkey\n       wrenches into the works. This isn't the same as Netflix's Chaos Monkey; I'm talking about\n       throwing brand-new, un-vetted code into production so your customers detect the issues at\n       the same time you do. Do not send huge request loads onto your brand new systems without\n       even validating they pass health checks first!</p>\n  <h3 id=\"submit-queue\">Submit Queue</h3>\n    <p>If you have many small tests that all hit various portions of live infrastructure, you will\n       assuredly find lots of broken pieces over time. This will be a constant drag on\n       productivity, as engineers will never quite know if the production service is having an\n       issue or the code they just wrote is broken without investigation.</p>\n  <h3 id=\"api-changes\">API Changes</h3>\n    <p>If you have many, small tests and mock everything out, then you won't actually see what\n       big interface changes happen between modules or services. This will lead you to writing a\n       lot of tests that don't verify anything, and not prevent you from changing the wrong thing\n       which breaks a big service and takes the site down.</p>\n  <h3 id=\"maintaining-mock-services\">Maintaining Mock Services</h3>\n    <p>If you want to have an equally-staffed Testing Team who shadows your \"primary\" team of\n       developers, then you can likely manage to build a \"stack in a box\" and build the massive\n       fleet required to mock out all of your services and keep up with changes. Otherwise,\n       probably not worth the time investment.</p>\n  <h2 id=\"unit-tests-and-integration-tests\">Unit Tests and Integration Tests</h2>\n  <p>I believe that by taking a middle path between these extremes, we can come up with two groups\n     of tests that will make developers lives much better.</p>\n  <p><img alt=\"compromises\" style=\"max-width: 100%; height: auto; width: auto;\" src=\"https://bjoli.com/images/04_unit_integration_tests.png\" width=\"512\" height=\"384\"></p>\n  <h3 id=\"terminology\">Terminology</h3>\n  <h3 id=\"unit-tests\">Unit Tests</h3>\n    <p>These are tests that should be scoped relatively small, and rely on mocking any external\n       service that makes a network call or IO of any kind. This allows these tests to be run\n       after every commit (or after every change!) and ensure that the feedback loop is very\n       tight. Even running a linter would be a small start, but code you write to validate your\n       production code does what it should would be best.</p>\n  <h3 id=\"integration-tests\">Integration Tests</h3>\n    <p>These are the larger, less frequently run tests. This would be part of a frequent release\n       process, something that wasn't so frequent that it was expected to be run by developers\n       multiple times per day, but not so infrequently that things change out from underneath it\n       too frequently. This is something that could actually spin up dev instances of whatever\n       services are necessary, and run through a battery of expected user behavior.</p>\n  <h2 id=\"conclusion\">Conclusion</h2>\n     <p>Between small and fast \"unit tests\" and larger, more comprehensive \"integration tests\"\n        I have found that it enables teams to move more quickly and with confidence, even if those\n        engineers are just dropping in with a quick bug fix. Comments and suggestions appreciated-\n        feel free to <a href=\"https://twitter.com/Yasumoto\">mention me on Twitter!</a>\n</p></div>\n",
      "date_published": "2016-07-21T00:00:00Z"
    }
    
  ]
}