Skip to main content

How to automate website performance regression testing

  In another post I went over how to analyze website performance using Lighthouse, and specifically how we can automate performance monitoring with Foo’s Automated Lighthouse Check. In this post I’m going to demonstrate how we can step it up a notch by regression testing performance… automagically 🔮.


What is Regression Testing?


Regression Testing is a type of software testing to confirm that a recent program or code change has not adversely affected existing features. Adhering to best practice could include the below.



Maintain a Strict Testing Schedule: Always maintain a continual testing schedule throughout the entire software development life cycle. Not only will this quickly force the team to adapt to a frequent testing regimen, it will also ensure the finished product is as well-tested as possible.


Use Test Management Software: Unless your current software project is a simple self-developed side project, chances are you’ll have such an abundance of tests that tracking each will be well beyond the capabilities of a single individual or a spreadsheet. Thankfully, there are many different test management tools on the market designed to simplify the process of creating, managing, tracking, and reporting on all the tests in your entire testing suite.


Categorize Your Tests: Imagine a test suite of hundreds or thousands of tests that are merely identified by a single name or id field. How on Earth would anyone ever sort through that massive list in order to identify tests that are related? The solution is to categorize tests into smaller groups based on whatever criteria is appropriate for your team. Most test management tools will provide the means of categorizing or tagging tests, which will make it easier for everyone on the team to identify and reference a certain type of test.


Prioritize Tests Based on Customer Needs: One useful way to prioritize tests is to consider the needs of the customer or user. Consider how a given test case impacts the end user’s experience or the customer’s business requirements.


Check out this article for more info: “Regression Testing: What It Is and How to Use It”


What Does “Website Performance” Actually Mean?


Load times vary dramatically from user to user, depending on their device capabilities and network conditions. Traditional performance metrics like load time or DOMContentLoaded time are extremely unreliable since when they occur may or may not correspond to when the user thinks the app is loaded.


~ User-centric Performance Metrics | Web Fundamentals | Google Developers


Nowadays, life cycle of a web page load can be thought of more granularly. We can think of website performance metrics as being “user-centric”. When a user goes to a web page, they’re typically looking for visual feedback to reassure them everything is working as expected.


The metrics below represent important points of the page load life cycle. Each answers questions about the user experience.


First Contentful Paint: Is it happening? Did the navigation start successfully? Has the server responded?


First Meaningful Paint: Is it useful? Has enough content rendered that users can engage with it?


Time to Interactive: Is it usable? Can users interact with the page, or is it still busy loading?


Long Tasks (absence of): Is it delightful? Are the interactions smooth and natural, free of lag and jank?


We can run performance audits manually or programmatically using tools like Lighthouse to provide values to metrics similar to the above. We can use a Lighthouse integration like Foo’s Automated Lighthouse Check to monitor website performance over time. In the example below you can see Twitter’s performance degrade and correlate it to an exact day and time! What if we could pinpoint this to an exact release? In the next section I explain how to do this.


Twitter Performance Degradation


How Can we Regression Test Performance Automatically?


We can accomplish automatic performance tests integrated as a post deploy step in a continuous delivery pipeline. We can do this by creating a free account with Automated Lighthouse Check and utilizing its public REST API. Follow the steps from the documentation to create a free account and obtain API tokens.



Trigger a test run by requesting the endpoint as detailed in the docs linked above. A curl command would look something like curl -X POST "https://www.foo.software/api/v1/queue/items" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"pages\": \"pagetoken1,pagetoken2\", \"tag\": \"My Tag\" }".


Add the above command as a post deploy step in your CD pipeline. Below a circleci snippet that actually defines this step.


From the example linked above our pipeline steps run on every commit to our master branch.


Continuous Delivery Steps


And voilà we are now deploying a release on every commit to master and running a performance audit on it automatically ⭐!


Conclusion


Automated Lighthouse Check provides many features to monitor and analyze performance. In this post we took a look into how we can utilize it to run Lighthouse performance regression testing automatically. Below are other features — most of which are free!


Automatic performance audits, a timeline visualization and detailed views of results.


Slack notifications when performance has dropped, improved or become “back to normal”.


Automatic health check pings and notifications.


Update (12/28/2019)


Many enhancements have been added to Automated Lighthouse Check since the writing of this article. Not only does it provide website performance monitoring, but now also SEO, accessibility, best practice and web app progressiveness. We’ve also added custom support for specific DevOps flavors reflected in our documentation.


Comments

Popular posts from this blog

How to choose which validator to use: a comparison between Joi & express-validator

   Envision you have  a web based business site and you're permitting clients to make accounts utilizing their name and email. You need to ensure they join with genuine names, not something like cool_dud3. That is where we use approval to approve information sources and ensure input information keeps specific guidelines. On the lookout, we as of now have a lot of approval libraries, yet I will analyze two significant approval libraries: Joi and express-validator for express.js based applications. This examination is valuable when you have chosen to involve outer info approval library for your application based on expressjs and are to some degree not certain which one to utilize. Who is what? Joi Joi permits you to make plans or constructions for JavaScript objects (an article that stores data) to guarantee approval of key data. Express-validator express-validator is a bunch of express.js middlewares that wraps validator.js validator and sanitizer capabilities. So by definition, we

Body health All Natural Pure Vitamins Nutritional Vitamins & Supplements Dietary Supplements

  Find healthier more healthy ways  methods  to manage handle stress, and you'll and you will and you may enjoy take pleasure in get pleasure from double health well being and stress management administration benefits advantages. Find a form of type of exercise train that you that you simply that you just'd like to do love to do and then after which find a discover a time when you can make you can also also can can even make you may might could make it work with your together with your along with your schedule. Your digestive system takes in, breaks down, and absorbs nutrients vitamins from your out of your food meals, then excretes any waste. Most of your digestive organs are hollow hole and connected related linked to each every other to one another in a long an extended a protracted pathway. Food enters through via by way of the mouth, then moves strikes through via by way of the esophagus, stomach abdomen, small intestine gut, and large and enormous and huge intestine gut,

Online Courses On Information Technology

  Information technology is a rapidly evolving field, and keeping up with the latest technologies and techniques is essential for IT professionals. Online courses are a great way to learn new skills and stay up-to-date with the latest trends in IT. Here are some popular online courses on information technology: Coursera: Coursera offers a wide range of online courses on IT topics, including programming languages like Python and Java, data science, cybersecurity, and cloud computing. Many of the courses are taught by professors from top universities around the world. edX:  edX is another popular online learning platform that offers courses in IT and computer science. Courses range from beginner-level introductions to coding and programming to advanced topics like artificial intelligence and machine learning. Udacity:  Udacity is a platform that focuses on technology and IT courses, offering a range of courses from beginner-level programming to advanced topics like autonomous vehicles an