<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kirk Snyder on Medium]]></title>
        <description><![CDATA[Stories by Kirk Snyder on Medium]]></description>
        <link>https://medium.com/@krsnyder?source=rss-f3456c0a7d36------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*l7naTjQXenmBpUAIDKCLgg.jpeg</url>
            <title>Stories by Kirk Snyder on Medium</title>
            <link>https://medium.com/@krsnyder?source=rss-f3456c0a7d36------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 22:17:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@krsnyder/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Testing, Testing…]]></title>
            <link>https://krsnyder.medium.com/testing-testing-9a534a0489bb?source=rss-f3456c0a7d36------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a534a0489bb</guid>
            <category><![CDATA[jest]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[pink-floyd]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[lambda-school]]></category>
            <dc:creator><![CDATA[Kirk Snyder]]></dc:creator>
            <pubDate>Thu, 24 Jun 2021 19:35:14 GMT</pubDate>
            <atom:updated>2021-06-24T19:35:14.861Z</atom:updated>
            <content:encoded><![CDATA[<p>The culmination of my web developer education here at Lambda School was my participation in Labs. Labs is an entire month dedicated to a real world project, giving us invaluable experience delivering a working product to a stakeholder in a professional setting.</p><p>Our client was Human Rights First, and the project our team was assigned to was called Blue Witness. Human Rights First is an independent advocacy and action organization that challenges America to live up to its ideals. Blue Witness is a project that aims to increase visibility of police use of force incidents through crowdsourcing initiatives. An interesting detail about our work with Blue Witness was the application was almost fully functional. Our team was the 4th team taking the reigns. That sounds like a great deal, right? Most of the work is already done! Unfortunately building a project from the ground up is a lot easier than jumping in to someone else’s messy code base and trying to fix issues. That particular aspect is what made this month feel like a professional environment.</p><h3>How can you have any pudding if you don’t eat your meat?</h3><p>With a team of 18 software engineers and data scientists, we had <strong>a lot</strong> of manpower to address the different features and bugs on our list. This was great because I was able to think about what specifically interested me and go after that.</p><p>Testing code is something we learned sporadically at Lambda. Every few weeks we would have a day focused on testing. All of our instructors emphasized the importance of it, but we never spent an entire week or more hammering it into our heads until it became second nature. Testing is not exciting or glamorous. It’s not something the end user ever knows about. But it’s necessary to maintain dependable code. Just like eating your veggies, if you want your application to grow into a robust code that’s built like a tank, you have to test.</p><p>The difficulty with testing this application arose from the size and complexity of the components. Every file we looked at was hundreds of lines long, and the application utilized a powerful CSS precompiler named Ant Design for a lot of the functionality. Ant Design made a lot of tasks/features easy. Testing is not one of them. We found ourselves blankly staring at code we didn’t understand, trying to figure out how and what should be tested. But as with most things in life, a quick google search will usually point you in the right direction.</p><h3>As a user, I don’t care about your tests.</h3><p>My biggest takeaway from my research is to avoid testing implementation details. That essentially means, don’t test details about the code that the end user would never know about or be interested in. Migrating the applications state management system from API Context over to Redux should not affect your tests. Refactoring a component into a few smaller, easier to manage components should not affect your tests.</p><p>This becomes a bit counterintuitive, because when you begin to test your code you don’t want to look at your code… This philosophy forces you to think like the end user. But it really is pretty simple. For example, take a list of news articles with some filters and a search bar. My first instinct was to change one of the filters and then test if the state of the application changed. But I needed to change my frame of reference. Enter the User Story.</p><p>As a user, I can change the filters so that I can see only the stories that I’m interested in. As a user, I do not care about how the global application state is changing when I click on a component. It’s nothing personal, I just have no idea what any of that means or why it’s relevant to me. This is the mentality I took to testing. Of course, at some point it all has to be brought back to the code. But when you start designing your tests, you have to test how the user will actually interact with the application. That’s why the testing libraries are written the way they are. Start with a motivation, what action would the user take? Given that action, what results should you expect to see?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*mC9LRZBEsQOfeUXMfb2RmQ.gif" /><figcaption>A demonstration of how a user would interact with a filter component</figcaption></figure><p>Here the user is selecting a filter and expecting an outcome based on the actions taken. So that is exactly how we’ll test the component in question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*DAB5XbVjtUzLrMSX-tG2eQ.png" /><figcaption>Arrange-Act-Assert is a popular pattern for testing code</figcaption></figure><p>With the previous user story in mind, first we click on the filter to see our options. Then we select the option we want. Finally, we assert that we see the results we’re expecting. In this test, I also asserted that I <em>did not</em> see any unwanted results (e.g., incidents with rank 1).</p><h3>No Flying Colors Yet</h3><p>While we did make a lot of improvements (increasing overall testing coverage from 15% to over 50%), we did not manage to test any of the back end code like we may have wanted to. Working with database migrations in testing is not as simple as some of the other tests I have written thus far, but that just makes it one more skill for me to add to the toolbox in the future. I am confident however that the testing skills I developed in Labs will greatly benefit me in my job search and my career as a whole. I’m very appreciative of the support I received from my whole team and all of the hard work they put in over the last month and their entire time in Lambda School.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a534a0489bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>