Testing for Fragmentation: Why do you need cross-browser testing for compatibility?
Tags: crossbrowsertesting, compatibilitytesting, softwaretesting
Published: 2020-01-06 06:33:54

<section class="post-full-content">
                <div class="post-content">

<img src="https://www.browserstack.com/blog/content/images/2019/12/fragmentation_5@2x--1-.png" class="kg-image" alt="Cross-browser testing for compatibility">                    

It takes a look at the market data on devices, platforms, browsers, etc. in use today, how this diversity comes into play during software development and testing—and what 2 million+ developers on BrowserStack do to account for it.</strong></p>
<p><strong>In this post, we look at browser internals, the differences among browsers, and the need for cross-browser testing.</strong></p>
<!--kg-card-end: markdown--><hr><blockquote><em>“Has anyone spent several hours to get the UI of their application render correctly in all browsers? How do you tackle the frustration when simple styles tend to work in one browser but not others… and by the end of the day you invent a hack to handle it (in some cases that too does not happen), only after wasting your time?”</em></blockquote><!--kg-card-begin: markdown--><p>That was posted on Stack Overflow <a rel="nofollow" href="https://stackoverflow.com/questions/320575/silly-and-frustrating-cross-browser-ui-issues" title="Post in Stack Overflow" target="_blank">11 years ago</a>. And it hasn't become less tedious with time. Cross-browser testing still is the bane of every front-end developer and QA engineer on the planet.</p>
<!--kg-card-end: markdown--><p> <br>The reason is <em>browser fragmentation, and the only way to cope is by testing for <strong>cross-browser compatibility. </strong></em><br></p><h2 id="why-is-browser-compatibility-an-issue-in-2020-">Why is browser compatibility an issue in 2020...</h2><p>...despite W3C’s homogenizing open standards? Or despite the fact that most of the browsers have adopted Chromium/Blink as their go-to browser engine? <br></p><p>The answer is in the question itself: those standards are <em>open </em>to interpretation<em>. </em><br></p><p>Browsers with the largest market shares are developed by different vendors. Each of these vendors have different design and development philosophies. This influences how they go about adding features, implementing support for new web technologies, and ultimately, the end-user experience of browsers. <br></p><p>Consider this: Despite the same underlying (and open-source) browser engine, the end-user experience turns out to be very different on Chrome and UC Browser. This is because Chrome focuses on delivering performance and integrating with Google’s ecosystem. On the other hand, UC Browser focuses on efficiency through page compression and lower data consumption.<br><br></p><p>Even the open-source browser projects are not afraid to “<em>break things</em> <em>to make things.” </em><br></p><p><em>“Chromium’s mission is to advance the web, and in some cases, we find it beneficial to make a breaking change in order to do that.”</em></p><p>—Blink principles of web compatibility<br></p><p>For the average web developer, that one ‘breaking change’ could mean hours of debugging. You may decide not to use a new, radical browser tech in your website UI, but you will have to account for those changes while developing anyway. <br></p><p>For there are layers to a browser, and each of them affects the Quality of Experience (QoE) you deliver to the end-user. Let’s take a look:<br></p><ol><li><strong>Browser engine</strong>: Not to be confused with <em>JavaScript engine </em>(which is another core component), the browser engine takes in HTML, reads and renders it. Blink, Gecko, and WebKit are examples of browser engines. <br><br>While open-source, these engines are different in their operation—even the operating systems they support. iOS, for instance, will only run WebKit browsers. So Chrome on Android and Chrome on iOS are going to be different <em>at the very core. </em><br><br></li><li><strong>Features</strong>: Vendors often add unique features to their browsers. <br><br>Consider Apple’s Safari, which has <em>Intelligent Tracking Prevention. </em>It’s<em> </em>a machine-learning algorithm that understands the difference between first-and-third party cookies. Based on the cookies’ purpose [for instance, saving session details vs cross-site tracking for ad targeting purposes], ITP deletes them at various intervals from users’ devices. <br><br>Even today, ITP continues to trouble online publishers who monetise their site content through behaviourally-targeted ads.<br></li><li><strong>Support for popular web technology: </strong>Which web technology to support + when and how best to implement it—these decisions are made by popular opinion within the browser’s contributor community.<br></li><li><strong>Update frequency: </strong>The speed with which contributing engineers release new features or security patches <a href="https://www.computerworld.com/article/3284365/browser-updates-heres-how-often-chrome-firefox-edge-and-safari-get-refreshed.html"><em>is different for each browser</em></a>. <br><br>Chrome gets updated every 6-8 weeks; Safari, once or twice a year. So if two or more browsers <em>were </em>to pick up ‘adding support for resolution feature’, it may take a while to be universally available.</li></ol><p><br></p><h2 id="okay-browsers-are-different-why-should-i-care">Okay. Browsers are different. Why should I care?</h2><p>Now, individually, the differences are minuscule and unlikely to affect a large percentage of your site’s traffic. But your site experience depends on how well you accounted for all the differences in browser layers. The probability of an unexpected UI bug is <em>high.</em><br></p><p>The more you scale/expand your reach to new markets, the larger will be the impact of unexpected UI breaks in production. And this affects not just the bottom line, but the audience sentiment as well. <br></p><p>A website/web app has to <em>work flawlessly for its audience</em> regardless of the browser they are on. Lack of browser compatibility can have serious consequences, as was the case with:</p><!--kg-card-begin: markdown--><ol>
<li>
<p>Safari ITP impacted the retention of the <a rel="nofollow" href="https://helpx.adobe.com/analytics/kb/adobe-analytics-anditp.html#Fallbackandimplications" title="Adobe Analytics and Safari ITP" target="_blank">Adobe Experience Cloud’s opt-out cookie</a>. Apple automatically deleted the cookie that was set to prevent reporting on data, effectively opting the user back into tracking.</p>
</li>
<li>
<p>Bootstrap, a ground-breaking front-end development framework that saves countless hours of developers’ time, had to create a whole <a rel="nofollow" href="https://getbootstrap.com/docs/4.1/browser-bugs/" title="Wall of browser bugs" target="_blank">wall of outstanding browser bugs</a>; in the hopes that browser vendors will pick up and resolve these issues in the near future.</p>
</li>
<li>
<p>A simple <a rel="nofollow" href="https://www.express.co.uk/life-style/science-technology/1205254/Google-Chrome-Update-Break-Stop-Working-White-Screen" title="Chrome update affects users" target="_blank">November 2019 Chrome update</a>, supposed to make the browser become more resource-efficient, ended up wreaking havoc—especially for those running Chrome on a Windows Server (in an enterprise network setup).</p>
</li>
</ol>
<!--kg-card-end: markdown--><blockquote>“<em>Employees are being left gawping at blank screens as Chrome suspends their browser throughout the day. According to system administrators speaking to ZDNet, hundreds and thousands of employees couldn't use Chrome to access the internet following the update</em>.” </blockquote><p></p><!--kg-card-begin: markdown--><p>Outside of your dev environment, not everyone has caught on to the latest versions of Chrome and macOS. Plenty of users are on browsers other than Chrome—or versions of popular browsers older than the latest releases. You can chalk it up to familiarity and/or resistance to change (along with <a rel="nofollow" href="https://teamtreehouse.com/community/why-do-people-stay-with-old-browsers" title="Why do people stick with old Browsers? " target="_blank">other reasons</a>).</p>
<!--kg-card-end: markdown--><p>There’s only one way to minimize browser errors: by testing continuously for cross-browser compatibility.</p><h2 id="continuous-testing-for-cross-browser-compatibility">Continuous testing for cross-browser compatibility</h2><p>It’s definitely not enough to test on whichever browser you’re developing on and release it into the wild. To deliver quality at speed, you have to<em> test smarter</em>. And to do this, you’ll need:</p><!--kg-card-begin: markdown--><ol>
<li>
<p>A list of relevant browsers which will give you over 80% coverage in the market(s) of your choice—updated at regular intervals.</p>
</li>
<li>
<p>Thorough risk analysis to figure out the features most likely to break, and on which browsers and devices. <a rel="nofollow" href="https://browserstack.com/blog/risk-based-testing/" title="Risk based testing" target="_blank">This post</a> by Hylke de Jong, an Automation Testing Engineer at Wehkamp.nl, details why you should be testing on devices with high risk—even if they aren’t used by a significant percentage of your traffic.</p>
</li>
<li>
<p>A solid delivery pipeline that lets your engineers continuously test and debug every unit, build, and end-to-end user-flow across each relevant browser/device.</p>
</li>
</ol>
<!--kg-card-end: markdown--><p>Remember this: Cross-browser compatibility isn’t about how many people can enjoy the entire site/app experience. <em>It’s about minimizing the number of people who can’t. </em>For those who have a reputation to maintain, the stakes are even higher. For them, cross-browser compatibility becomes a matter of delivering <em>quality, consistently. </em><br></p><p>One of them is Nicolás Bevacqua, a JS consultant and Blink contributor. He states that he cares about cross-browser compatibility because: <br></p><p><em>“..the fact that people were seldom using anything other than Chrome (to access my blog) gave me a good cover story for not pouring any effort into resolving long-standing (albeit minor) CSS rendering issues in Firefox and Safari. However, <strong>20% of visitors were getting a less than ideal experience, which ultimately wasn’t something I could scoff at.</strong> </em><br></p><p><em>It didn’t speak well of me to have these blatant rendering bugs lying around in my blog when visited through popular non-Chrome browsers. It wasn’t tidy.”</em><br></p><p></p><hr><!--kg-card-begin: markdown--><p><strong>Recommended reading</strong>:</p>
<p><a href="https://browserstack.com/blog/cross-browser-testing-for-compatibility/?utm_source=referral&utm_medium=dev.to&utm_campaign=fragmentation"</a><img src="https://www.browserstack.com/blog/content/images/2020/02/Blog-Banner@2x.png"></a></p>

<!--kg-card-end: markdown-->
                </div>
            </section>