<?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: Percy</title>
    <description>The latest articles on DEV Community by Percy (@percy-io).</description>
    <link>https://dev.to/percy-io</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%2Forganization%2Fprofile_image%2F1192%2F03a33166-a616-45da-93f4-f06d9dc4e6b7.png</url>
      <title>DEV Community: Percy</title>
      <link>https://dev.to/percy-io</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/percy-io"/>
    <language>en</language>
    <item>
      <title>Introducing Percy's 2020 State of Visual Testing</title>
      <dc:creator>paytonealexis</dc:creator>
      <pubDate>Wed, 29 Jan 2020 18:24:01 +0000</pubDate>
      <link>https://dev.to/percy-io/introducing-percy-s-2020-state-of-visual-testing-29dh</link>
      <guid>https://dev.to/percy-io/introducing-percy-s-2020-state-of-visual-testing-29dh</guid>
      <description>&lt;h3&gt;
  
  
  We at &lt;a href="https://percy.io"&gt;Percy&lt;/a&gt; are thrilled to be sharing the first-ever State of Visual Testing!
&lt;/h3&gt;

&lt;p&gt;We decided to create &lt;a href="https://go.percy.io/state-of-visual-testing-report-2020"&gt;this report&lt;/a&gt; to share our experience and insights from being on the front lines of visual testing. Although thousands of developers are already utilizing visual testing, we noticed that there just wasn’t much data available to those looking for it.&lt;/p&gt;

&lt;p&gt;To shed light on how teams are leveraging visual testing, we decided to take a look at our data and share the results. In addition to looking at our own visual testing data, we wanted to learn more about how developers approach frontend testing in general.&lt;/p&gt;

&lt;p&gt;By combining data from our platform and data from our recent frontend testing survey, we were able to create a resource packed with guidance, benchmarks, and best practices, as well as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An educational overview of visual testing and how it works&lt;/li&gt;
&lt;li&gt;How visual testing fits into the software testing ecosystem&lt;/li&gt;
&lt;li&gt;The benefits of visual testing&lt;/li&gt;
&lt;li&gt;Best practices for implementing and running visual testing&lt;/li&gt;
&lt;li&gt;And lots more!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://go.percy.io/state-of-visual-testing-report-2020"&gt;See highlights from Percy’s State of Visual Testing or download the full report here&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;In 2020 and beyond, we hope this serves as an informative resource for developers learning more about visual testing and would love to hear from you! You can reach us at &lt;a href="//mailto:hello@percy.io"&gt;hello@percy.io&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Functional vs. visual testing: What’s the difference?</title>
      <dc:creator>paytonealexis</dc:creator>
      <pubDate>Thu, 12 Sep 2019 21:00:19 +0000</pubDate>
      <link>https://dev.to/percy-io/functional-vs-visual-testing-what-s-the-difference-4am5</link>
      <guid>https://dev.to/percy-io/functional-vs-visual-testing-what-s-the-difference-4am5</guid>
      <description>&lt;p&gt;If you don’t know what &lt;a href="https://percy.io/visual-testing"&gt;visual testing&lt;/a&gt; is, or you’ve heard of it but aren’t sure how it’s different from your existing test efforts, this post is for you.&lt;/p&gt;

&lt;p&gt;Read on to learn about the differences (and overlap) between functional and visual testing, what benefits and challenges come with visual testing, and how we approach it at &lt;a href="https://percy.io/"&gt;Percy&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How is visual testing different from functional testing?
&lt;/h2&gt;

&lt;p&gt;Functional testing — from unit and integration testing to acceptance and end-to-end testing — checks that software is &lt;em&gt;behaving&lt;/em&gt; as it should.&lt;/p&gt;

&lt;p&gt;These kinds of tests check assertions against desired outcomes. You build software to behave a specific way, and you write tests to assure that it continues to do so, even as your application grows.&lt;/p&gt;

&lt;p&gt;Automated testing has become a critical part of healthy software development practices within modern teams — but it has its limits.&lt;/p&gt;

&lt;p&gt;As software grows, many of us have tried to stretch our test suites past those limits to check not only for &lt;em&gt;behavioral&lt;/em&gt; outcomes but for &lt;em&gt;visual elements&lt;/em&gt; as well. After catching (or after an end-user caught) a visual bug, you may have tried to write functional tests to prevent it from happening again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VmlP_5Zz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/2294/0%2AXYyygPosMzTmy0P5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VmlP_5Zz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/2294/0%2AXYyygPosMzTmy0P5.png" alt="Functional tests designed to prevent visual regressions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’ve all written tests to check for classes or other purely visual elements&lt;/p&gt;

&lt;p&gt;Everyone wants to be confident that their code won’t break something. But writing functional tests to ensure visual stability or to catch visual regressions is not the answer, and falls into a lot of traps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pitfalls of using functional testing for visual elements
&lt;/h2&gt;

&lt;p&gt;Functional tests are great for checking known inputs against their desired outputs, but it’s nearly impossible to assert visual “correctness” with code.&lt;/p&gt;

&lt;p&gt;What are we supposed to assert?&lt;/p&gt;

&lt;p&gt;That a specific CSS class is applied? Or maybe a computed style exists on the button, or that the text is a particular color?&lt;/p&gt;

&lt;p&gt;Even with these kinds of assertions, you’re not actually testing anything visually, and there are so many things that can make your tests “pass” while resulting in a visual regression. Class attributes can change; other overriding classes can be applied, etc. It’s also hard to account for visual bugs caused by how elements get rendered by different browsers and devices.&lt;/p&gt;

&lt;p&gt;When browsers and devices are part of the equation, it becomes even harder to assert the desired outcomes in tests. Trying to assert all those edge cases only exacerbates the challenge above and doesn’t give you a way to test new visual elements that come along.&lt;/p&gt;

&lt;p&gt;This testing culture creates unruly and brittle test suites that constantly needs to be rewritten whenever you implement any kind of design or layout changes.&lt;/p&gt;

&lt;p&gt;Visual testing is designed to overcome these challenges.&lt;/p&gt;

&lt;p&gt;Much like functional testing, &lt;a href="https://percy.io/visual-testing"&gt;visual testing&lt;/a&gt; is intended to be part of code review processes. Whenever code changes are introduced, you can systemically monitor what your users &lt;em&gt;actually see and interact with&lt;/em&gt;, and keep your functional test focused on behaviors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits and challenges of visual testing
&lt;/h2&gt;

&lt;p&gt;When you’re truly testing the visual outcome of your code — your user interface — it doesn’t matter what has changed underneath. The inputs are the same, but instead of checking specific outputs with test assertions, it checks if what has changed is perceptible to the human eye.&lt;/p&gt;

&lt;p&gt;Visual testing works by analyzing browser renderings of software for visual changes. Then, by comparing rendered snapshots against previously determined baselines, visual testing detects visual changes between the two. Those differences are called &lt;a href="https://docs.percy.io/docs/visual-testing-basics#section-visual-diffs-101"&gt;visual diffs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At Percy, we pioneered the use of &lt;a href="https://docs.percy.io/docs/percy-platform-basics#section-snapshot-rendering-and-asset-discovery"&gt;&lt;em&gt;DOM snapshots&lt;/em&gt;&lt;/a&gt; to get the most deterministic version of your web app, static site, or components.&lt;/p&gt;

&lt;p&gt;Their object-oriented representation allows us to manipulate the documents’ structure, style, and content to reconstruct pages across browsers and screen widths in our own environment. We don’t have to replay any of the network requests, do any test setup, insert mock data, or get your UI to the right state. DOM snapshots give us the power to better control the output for predictability.&lt;/p&gt;

&lt;p&gt;Visual testing also comes with its own challenges. Visual snapshotting and diffing is inherently static, which means the things that make websites interesting — like animations — can also make visual testing very difficult.&lt;/p&gt;

&lt;p&gt;In designing Percy, we’ve built in several core features to make visual testing as useful as possible. &lt;a href="https://docs.percy.io/docs/animations"&gt;Freezing CSS animations and GIFs&lt;/a&gt;, helping stabilize &lt;a href="https://docs.percy.io/docs/freezing-dynamic-data"&gt;dynamic data&lt;/a&gt;, or simply &lt;a href="https://docs.percy.io/docs/percy-specific-css"&gt;hiding or changing UI elements&lt;/a&gt; helps minimize false positives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Non-judgemental testing with visual reviews
&lt;/h2&gt;

&lt;p&gt;Our visual testing workflow is designed to run alongside your functional test suite and code reviews.&lt;/p&gt;

&lt;p&gt;We pull in code changes from feature branches and compare the resulting snapshots to what your app looked like before — usually whatever is on your master branch. Deterministic rendering, coupled with precise baseline picking, helps us accurately detect and highlight visual changes to be reviewed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mormz_nM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/5756/1%2AJBNNyKf79fIRwCloFmmcgQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mormz_nM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/5756/1%2AJBNNyKf79fIRwCloFmmcgQ.png" alt="Percy’s UI showing a side-by-side comparison of baseline and new snapshots with visual changes highlighted."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This leads us to the most ideological difference between visual and functional testing. Functional tests are written to pass or fail, whereas visual testing is non-judgemental—they don’t “pass” or “fail.”&lt;/p&gt;

&lt;p&gt;Discerning between visual regressions and intentional visual changes and will always require human judgment. That’s why Percy is called a “visual testing and review platform.” We both facilitate the detection of visual changes and make reviewing those changes collaborative, efficient, and fast.&lt;/p&gt;

&lt;p&gt;It’s great to be alerted when something changed unexpectedly — what you might say is a “failing” test. But getting continuous insight into intended visual changes is also incredibly valuable. (We wrote all about it &lt;a href="https://blog.percy.io/why-visual-testing-is-more-than-catching-bugs-db0e817b84ed"&gt;in a recent post&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;The end goal is to provide teams with confidence in every code change by knowing the full impact they have visually. Today, visual testing is the best solution to that challenge.&lt;/p&gt;




&lt;p&gt;Although visual “correctness” frequently correlates with functionality, at the end of the day, functional testing isn’t designed to check visual elements. Visual testing is also not suited to replace all of your functional tests. It can, however, replace “visual” regression tests and help you write smaller, more focused tests.&lt;/p&gt;

&lt;p&gt;To learn more about visual testing with Percy, check out these resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.percy.io/docs/visual-testing-basics"&gt;Visual testing basics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.percy.io/docs/percy-platform-basics"&gt;Percy basics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.percy.io/docs/sdks"&gt;Percy SDKs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://percy.io/signup"&gt;Sign up for Percy for free&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>testing</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
