<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jan</title>
    <description>The latest articles on DEV Community by Jan (@jan).</description>
    <link>https://dev.to/jan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F26714%2F4b90da1a-39a7-4a42-8f7c-7ccd523c93fc.png</url>
      <title>DEV Community: Jan</title>
      <link>https://dev.to/jan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jan"/>
    <language>en</language>
    <item>
      <title>Checked example testing</title>
      <dc:creator>Jan</dc:creator>
      <pubDate>Sun, 08 Mar 2020 16:10:18 +0000</pubDate>
      <link>https://dev.to/jan/checked-example-testing-34ep</link>
      <guid>https://dev.to/jan/checked-example-testing-34ep</guid>
      <description>&lt;p&gt;I've come to realize how much developers hate writing unit tests. I read &lt;a href="https://www.hackernoon.com/software-development-is-not-about-unit-tests-r77132y7"&gt;Software Development is Not About Unit Tests&lt;/a&gt; a few months ago, a lot of which has really resonated with me through several re-readings to today. I get it. I've written a lot of unit tests; they can be tedious and often harder to maintain than the code itself. It is seemingly a waste of time and the backlash is somewhat justified. Writing tests sucks...&lt;/p&gt;

&lt;p&gt;Recently, however, I have begun challenging my team to think about writing tests differently. I propose that there is much more value in a test &lt;em&gt;describing&lt;/em&gt; the behavior of the system rather than &lt;em&gt;testing&lt;/em&gt; it. It seems pedantic and I don't expect it to be a huge revelation to anyone, but I think this perspective simplifies the answer to the "what do I test?" question.&lt;/p&gt;

&lt;p&gt;The problem with the "I know this works, how can I verify that it does?" mindset is that you're missing an important piece to answering the question: how &lt;em&gt;does&lt;/em&gt; it work? I would challenge any of you "code is self-documenting" evangelists to look at any of the crap that your colleagues write or that you wrote three weeks ago and tell me exactly what it does and how it was meant to be implemented. I can't either.&lt;/p&gt;

&lt;p&gt;If you've never seen the &lt;a href="https://lisacrispin.com/2011/11/08/using-the-agile-testing-quadrants/"&gt;Agile Testing Quadrants&lt;/a&gt;, I encourage you to take a look at the chart. The bottom quadrants (1 and 4) are labeled "Technology Facing" and the top "Business Facing"; that means something. Testing is really about understanding the product you have and the users that use it. If you're able to describe and demonstrate how the product solves the needs of your user, then your "test" was successful. You can scale that same concept up (to end-to-end and user-experience testing, whole product-level and organization-level tests where the users are your customers) or down (to unit and integration tests on smaller slices of your product or it's code where the users are the developers).&lt;/p&gt;

&lt;p&gt;In this way, the test becomes less of a "test" and more of a "checked example". I stumbled across this label in &lt;a href="http://www.exampler.com/old-blog/2003/08/22/#agile-testing-project-2"&gt;Exploration by Example&lt;/a&gt;, which is linked in the testing quadrants article above. I thought it accurately summarized the idea.&lt;/p&gt;

&lt;p&gt;The checked example method makes the tests serve more as documentation of the code and a document for the shared understanding of the system. I think going beyond that to document every behavior of the system is a little silly, so I tend to stick to functions and workflows that need to be documented and understood in some fashion. For unit tests, that could be because it because they include some business logic or because it has cascading effects throughout the application. For end-to-end tests, tests would be for user-facing functionality that describes how the user uses the product to achieve a result.&lt;/p&gt;

&lt;p&gt;You can't really verify that a product works without describing how it does. Chances are that your product is not very complicated, so your tests shouldn't be either; keep it simple and describe how the core functionality of your organization and product work. You can incorporate other techniques (user personas come to mind) to help you do that, but keep the barrier to entry low.&lt;/p&gt;




&lt;p&gt;This idea is probably more-or-less encapsulated in Behavior Driven Development, but is how I made testing "click" for me. I didn't include any examples because it's more conceptual than that; it's more of a way to think about writing tests than a method for actually writing them.&lt;/p&gt;

</description>
      <category>unit</category>
      <category>automated</category>
      <category>software</category>
      <category>testing</category>
    </item>
    <item>
      <title>Breaking Down User Stories: Vertical Slicing</title>
      <dc:creator>Jan</dc:creator>
      <pubDate>Sun, 05 May 2019 04:12:21 +0000</pubDate>
      <link>https://dev.to/jan/user-stories-and-vertical-slicing-1dpo</link>
      <guid>https://dev.to/jan/user-stories-and-vertical-slicing-1dpo</guid>
      <description>&lt;p&gt;This is a concept my team has been working on implementing in our refinement sessions. Talking through some of the general ideas with my friend, I feel like I was able to conceptualize the problems and solutions pretty well and wanted to expand on the approach here.&lt;/p&gt;

&lt;p&gt;Everything I'm talking about here is very heavily influenced by the book &lt;a href="https://www.amazon.com/User-Story-Mapping-Discover-Product/dp/1491904909/ref=as_sl_pc_qf_sp_asin_til?tag=jefpatass-20&amp;amp;linkCode=w00&amp;amp;linkId=NX2UXYQEFAANOFPO&amp;amp;creativeASIN=1491904909"&gt;User Story Mapping by Jeff Patton&lt;/a&gt;. My team has read this book together, focusing on a couple chapters a week and meeting to discuss the ideas and how we think we can work them into our processes. This book and approach have been super valuable, definitely give it a shot!&lt;/p&gt;

&lt;h1&gt;
  
  
  User stories
&lt;/h1&gt;

&lt;p&gt;Anybody that's heard of or practices Agile will be pretty familiar with the concept of a user story. Simply, a user story describes a software feature from the &lt;strong&gt;end-user perspective&lt;/strong&gt;, hence the name! In a user story, you try to describe &lt;em&gt;who&lt;/em&gt; the story is for, &lt;em&gt;what&lt;/em&gt; is going to be delivered, and &lt;em&gt;why&lt;/em&gt; it matters in the first place. It's all about conveying the value of what's going to be created. A user story has acceptance criteria, which are basically a set of requirements that need to be met in order to consider the story complete.&lt;/p&gt;

&lt;p&gt;User stories can be broad, that's okay! They can and should be broken down into workable chunks by the development team when it makes sense.&lt;/p&gt;

&lt;h1&gt;
  
  
  Splitting user stories, current practice
&lt;/h1&gt;

&lt;p&gt;Developers generally approach problems by thinking about how they should be implemented. Consider a story involving a multi-tiered system; you may have a presentation layer, a business logic or backend layer, a persistence layer, and maybe a couple more! Naturally, this leads to slicing the user story &lt;strong&gt;horizontally&lt;/strong&gt; across these layers: a story for frontend, a story for backend, and a story for the database work.&lt;/p&gt;

&lt;p&gt;The major problem with this approach is that dependencies are inherent in the way the stories are constructed and, as a result, it takes a long time for any actual value to be realized. You don't have anything releasable to show customers, stakeholders, or users for potentially several sprints. &lt;em&gt;You can't deliver a half-baked cake&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Additionally, you'll be introducing technical debt in terms of toggles for features that aren't production-ready and workarounds needed for part of the feature to work while others are still being worked on. Estimating the size and deliverability of the story hasn't been made any easier and by working the &lt;em&gt;whole&lt;/em&gt; story across each horizontal slice, you haven't allowed for any iteration based on user feedback or left room for reprioritization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9NwQRQQT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgflip.com/306vzf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9NwQRQQT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgflip.com/306vzf.jpg" alt="It just sounds like waterfall with extra steps"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Enter, vertical slices!
&lt;/h1&gt;

&lt;p&gt;First and foremost, we want to quickly add value for the users and stakeholders. We can do this by looking at which independent pieces, implemented end-to-end (&lt;strong&gt;vertically&lt;/strong&gt;) across all of the layers mentioned before, compose the larger user story. Identify the value and risk of each piece and prioritize accordingly.&lt;/p&gt;

&lt;p&gt;This approach will let you iterate more quickly as features will reach end users and allow them to provide feedback. Unknowns and dependencies don't block progress on the larger feature as pieces can still be worked on and deployed. Your team will be able to respond better to changes in priorities, making you more agile as a result. But, most importantly, you'll be delivering measurable value to your stakeholders and end-users more quickly.&lt;/p&gt;

&lt;p&gt;This is pretty abstract and a huge change in perception! Let's practice with a real-world example.&lt;/p&gt;

&lt;h1&gt;
  
  
  How to vertically slice a story
&lt;/h1&gt;

&lt;p&gt;I work on a mobile team. Ahead of our previous sprint, we were given a story resembling the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a user, I want to know when updates are available so that I can get the latest features and fixes&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The acceptance criteria included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A banner to be displayed on the home page indicating that a new update was available&lt;/li&gt;
&lt;li&gt;Cosmetic changes to the existing update link in the user profile to make it stand out more&lt;/li&gt;
&lt;li&gt;Both the banner and existing link should navigate to a release notes screen showing the latest changes and links to download the updates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This story isn't terribly large, but couldn't be delivered in a sprint considering there were other items we wanted to work on. It did turn out to be pretty good practice for slicing stories vertically, though!&lt;/p&gt;

&lt;p&gt;As a team, we identified that we could add value quickly without delivering the whole story. Taking into account the current state of the app, where the existing update link leads directly to the download, we decided the update banner added the most value to the user. By making the new banner behave the same as the current link, the banner and release notes screen are independent, and can be separate stories. Likewise, the change to the current link adds value independently, and therefore becomes a separate story. This "big" story just became a three small ones that we can prioritize separately!&lt;/p&gt;

&lt;p&gt;Admittedly, we did get carried away. We created a fourth story, originally, for updating the navigation from the banner and link to the new release notes screen. Navigation itself wasn't really independent of the release notes screen, so it made sense to add that story back into the story covering the release notes.&lt;/p&gt;

&lt;p&gt;The release notes screen was reprioritized (and has yet to be pulled into a sprint). From a development perspective, we have small, easily testable, and easily reviewable chunks of code. From a stakeholder perspective, we've made progress toward delivering the full feature and arguably have carried out the goal set out in the user story.&lt;/p&gt;

&lt;p&gt;We were able to deliver measurable value to the end-user without implementing the full story.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You can't deliver a half-baked cake, but you can deliver half a baked cake&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Overall, our team is very happy with the outcome. We'll continue to practice and refine the process, and hopefully bring it to other teams as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PoZRn0Er--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.pinimg.com/originals/74/cd/18/74cd18c5816111dc59339358bed44ec3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PoZRn0Er--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.pinimg.com/originals/74/cd/18/74cd18c5816111dc59339358bed44ec3.jpg" alt="the world must learn of our peaceful ways... by force!"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agile</category>
      <category>userstories</category>
    </item>
  </channel>
</rss>
