Performance Testing Is Hard. Can AI Help?

Rate this content
Bookmark

The top-selling Android phone in 2023 is 8x less powerful than high-end devices like the Pixel 8. This gap highlights a common blind spot among Android devs: we often use powerful devices and don't necessarily spot performance issues in our apps.

However, traditional performance testing is often seen as a cumbersome and time-consuming task, leading many to skip it in favor of pushing out new features.
But what if there was a way to simplify this process, making performance testing as straightforward as running a single command?

This talk presents how we can make this dream a reality: by using AI to automatically explore our app and combine it with the proper performance measuring tools, we can essentially get automated quality audits of our apps!

This talk has been presented at React Advanced 2024, check out the latest edition of this React Conference.

FAQ

Lighthouse is a tool within Google Chrome that provides performance reports for web pages. It is used to measure the performance of web apps by generating a score based on various criteria.

Flashlight is a tool developed to measure the performance of mobile apps, similar to how Lighthouse measures web apps. It allows users to upload an Android app to get a performance score, aiming to be a "mobile Lighthouse."

AI may loop or miss tasks, requiring an "AI manager" to oversee and correct its actions. The technology is still experimental and not fully reliable for all scenarios.

AI can automate the exploration of apps, potentially reducing the effort needed to write and maintain end-to-end tests. It can adapt to elements like ads or pop-ups and continue testing without human intervention.

End-to-end testing can be challenging due to issues like ads or cookie banners disrupting tests. Tests can be difficult to maintain and write, requiring time and effort.

AI can automate the exploration of mobile apps for performance testing, reducing the manual effort required. It can perform tasks like logging in and navigating the app, while tools like Flashlight measure performance during the exploration.

The non-AI aspects of Flashlight are reliable and can be integrated into a CI pipeline for performance testing. The AI features are still experimental and being developed for future inclusion.

Future developments include improving AI reliability for automated app exploration and expanding capabilities to test other aspects like accessibility, making performance testing more comprehensive and automated.

Alexandre Moureaux
Alexandre Moureaux
30 min
25 Oct, 2024

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Hi everyone, I want to share a story about my experience as a junior developer working with a client who had strict technical standards. They required high performance for web and mobile apps, but lacked a measurable way to determine performance. To address this, I created a tool called Flashlight, similar to Lighthouse, that measures mobile app performance. Flashlight provides performance scores and can run end-to-end tests to explore the app. The speaker's dream is to have an easy way to determine app performance without extensive testing. Using AI to automate the tedious task of exploring an app is the speaker's proposal. The speaker explains that the repository for the app exploration tool is open source and will be shared later. The tool requires commands to be run, such as logging in and performing a search. The AI tool helps identify performance issues, suggests using React DevTools for debugging, and recommends using FlashList instead of FlatList in React Native. The AI can continue after errors occur, and controlling the AI's completion of goals can be achieved by adding a human or another AI agent manager into the loop. AI in end-to-end testing is gaining popularity, with companies launching AI-based testing tools. The goal is to automate app exploration using AI and ensure quality checks for performance, accessibility, and security. AI can help QA engineers by automating repetitive tasks and allowing them to focus on more important aspects. The cost of performing one test case using the 4.0 Mini model is usually less than one cent. AI testing with Flashlight is still experimental, but the non-AI part is reliable. Future improvements include running on CI and easy iteration on multiple projects.

1. Introduction to Flashlight Tool

Short description:

Hi everyone, I want to share a story about my experience as a junior developer working with a client who had strict technical standards. They required high performance for web and mobile apps, but lacked a measurable way to determine performance. To address this, I created a tool called Flashlight, similar to Lighthouse, that measures mobile app performance. Flashlight provides performance scores and can run end-to-end tests to explore the app. Although we have made significant progress in mobile performance testing, there is still room for improvement, especially in the niche area of end-to-end testing.

Hi everyone, just want to quickly point out that if you're not a React Native developer, actually a lot of ideas in this talk will still apply to you, so please don't leave the room yet.

But, all right, I thought I would start with a short story. So several years ago, actually, when I was a junior developer myself with, well, probably more hair on my head, lol, I worked with a client and they had a really strong technical expertise. I thought, you know, I'm going to learn so much from that client. And they had technical standards for everything, technical requirement, quality standards, for everything on the project. And on the subject of performance, for example, so we were building a web app and a mobile app for them.

And so on web, they asked us to have 90 plus Lighthouse core on desktop for every web page. So I'm sure you're probably familiar with Lighthouse, but just in case, Lighthouse, of course, is a tool inside Google Chrome. You can go on any web page, just a few clicks and you get a performance report for any web page you want. And I think, you know, it's pretty cool. So being a young mobile app developer myself and kind of, you know, already interested about performance, I was like, I'm really curious what they're going to say about what their standard is for mobile performance. And so they gave us the requirement and they just said like, oh, the app should not lag, which, well, you know, was a bit disappointing. And I thought, OK, we don't actually have a good measurable scientific way to know if my app, if our apps have good performance or not.

And so I'm Alex, and this is how I became the app performance expert at Theodore Apps, previously known as BAM. And I built a tool called Flashlight, which intends to be a mobile Lighthouse. The joke is that Flashlight is kind of Lighthouse, a mobile Lighthouse. And you can measure performance locally or you can also go to the website, flashlight.dev, upload an Android app and you get a performance score out of it. All right. So I thought that was already pretty cool and getting really close to the Lighthouse for mobile apps dream. But there was one major caveat. By default, you would only get the performance score of your app start, which is, you know, if the first page in your app is a login page, you get the performance score for the login page and well, you know, that's not fantastic.

So I thought, OK, we can enhance that with end-to-end test. So there is a way on the website or even have a CLI to just pass an end-to-end test and Flashlight in the cloud. It actually runs on real low-end Android device. It would run those tests several times and just explore the app thanks to the end-to-end test that you wrote. And so we went as far as actually building performance regression dashboards for some of our projects, being able to detect performance regressions and everything. And so that's, well, that's a major break here. We still have lots of improvement and it feels like we've made end-to-end mobile performance testing as easy as possible. So what's the problem then? Why am I speaking to you now? What's the catch? And I think, well, the problem is probably with end-to-end, because end-to-end is still kind of niche. You talk about pyramid of tests.

2. Challenges of End-to-End Testing

Short description:

End-to-end mobile performance testing is a niche area. Although writing the tests can be simple, there are several issues. Tests can easily break, especially when dealing with elements like ads or cookie banners. Maintaining the tests and investing time in writing them can be a challenge. The speaker's dream is to have an easy way to determine app performance without extensive testing.

It's usually kind of, you know, the stuff that you don't do a lot. And so end-to-end mobile performance testing, this is really niche. And writing a test, writing a test, end-to-end test for mobile can actually be as simple as this nowadays. This is an example of a maestro test. Just in a few minutes you can really easily wrap up an end-to-end test. It's really cool. We've made a lot of progress. And yet there's several issues with that. For example, the end-to-end test can actually break easily. For example, I've worked with some projects, they had ads popping up on the home feed, for example, just randomly. And so if you have an end-to-end test for that, you need to account for the ad potentially popping up and need to close the ad. Or if you have a cookie banner or whatever. And that ends up being kind of annoying. And that ends up being kind of tricky to maintain. And also, to be honest, like my whole dream in the first place was to be like, I want to upload my app and having something telling me my app has good performance or my app doesn't have good performance. And so I'm, even if it's really simple to write the end-to-end test, you still need time to write them. So you know, it fits a few minutes, it kind of adds up, and you need to maintain them and everything. And so I'm still not really happy with where we are.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Building a Voice-Enabled AI Assistant With Javascript
JSNation 2023JSNation 2023
21 min
Building a Voice-Enabled AI Assistant With Javascript
Top Content
This Talk discusses building a voice-activated AI assistant using web APIs and JavaScript. It covers using the Web Speech API for speech recognition and the speech synthesis API for text to speech. The speaker demonstrates how to communicate with the Open AI API and handle the response. The Talk also explores enabling speech recognition and addressing the user. The speaker concludes by mentioning the possibility of creating a product out of the project and using Tauri for native desktop-like experiences.
AI and Web Development: Hype or Reality
JSNation 2023JSNation 2023
24 min
AI and Web Development: Hype or Reality
Top Content
This talk explores the use of AI in web development, including tools like GitHub Copilot and Fig for CLI commands. AI can generate boilerplate code, provide context-aware solutions, and generate dummy data. It can also assist with CSS selectors and regexes, and be integrated into applications. AI is used to enhance the podcast experience by transcribing episodes and providing JSON data. The talk also discusses formatting AI output, crafting requests, and analyzing embeddings for similarity.
The Rise of the AI Engineer
React Summit US 2023React Summit US 2023
30 min
The Rise of the AI Engineer
Watch video: The Rise of the AI Engineer
The rise of AI engineers is driven by the demand for AI and the emergence of ML research and engineering organizations. Start-ups are leveraging AI through APIs, resulting in a time-to-market advantage. The future of AI engineering holds promising results, with a focus on AI UX and the role of AI agents. Equity in AI and the central problems of AI engineering require collective efforts to address. The day-to-day life of an AI engineer involves working on products or infrastructure and dealing with specialties and tools specific to the field.
The Ai-Assisted Developer Workflow: Build Faster and Smarter Today
JSNation US 2024JSNation US 2024
31 min
The Ai-Assisted Developer Workflow: Build Faster and Smarter Today
AI is transforming software engineering by using agents to help with coding. Agents can autonomously complete tasks and make decisions based on data. Collaborative AI and automation are opening new possibilities in code generation. Bolt is a powerful tool for troubleshooting, bug fixing, and authentication. Code generation tools like Copilot and Cursor provide support for selecting models and codebase awareness. Cline is a useful extension for website inspection and testing. Guidelines for coding with agents include defining requirements, choosing the right model, and frequent testing. Clear and concise instructions are crucial in AI-generated code. Experienced engineers are still necessary in understanding architecture and problem-solving. Energy consumption insights and sustainability are discussed in the Talk.
Web Apps of the Future With Web AI
JSNation 2024JSNation 2024
32 min
Web Apps of the Future With Web AI
Web AI in JavaScript allows for running machine learning models client-side in a web browser, offering advantages such as privacy, offline capabilities, low latency, and cost savings. Various AI models can be used for tasks like background blur, text toxicity detection, 3D data extraction, face mesh recognition, hand tracking, pose detection, and body segmentation. JavaScript libraries like MediaPipe LLM inference API and Visual Blocks facilitate the use of AI models. Web AI is in its early stages but has the potential to revolutionize web experiences and improve accessibility.
Code coverage with AI
TestJS Summit 2023TestJS Summit 2023
8 min
Code coverage with AI
Codium is a generative AI assistant for software development that offers code explanation, test generation, and collaboration features. It can generate tests for a GraphQL API in VS Code, improve code coverage, and even document tests. Codium allows analyzing specific code lines, generating tests based on existing ones, and answering code-related questions. It can also provide suggestions for code improvement, help with code refactoring, and assist with writing commit messages.

Workshops on related topic

AI on Demand: Serverless AI
DevOps.js Conf 2024DevOps.js Conf 2024
163 min
AI on Demand: Serverless AI
Top Content
Featured WorkshopFree
Nathan Disidore
Nathan Disidore
In this workshop, we discuss the merits of serverless architecture and how it can be applied to the AI space. We'll explore options around building serverless RAG applications for a more lambda-esque approach to AI. Next, we'll get hands on and build a sample CRUD app that allows you to store information and query it using an LLM with Workers AI, Vectorize, D1, and Cloudflare Workers.
AI for React Developers
React Advanced 2024React Advanced 2024
142 min
AI for React Developers
Featured Workshop
Eve Porcello
Eve Porcello
Knowledge of AI tooling is critical for future-proofing the careers of React developers, and the Vercel suite of AI tools is an approachable on-ramp. In this course, we’ll take a closer look at the Vercel AI SDK and how this can help React developers build streaming interfaces with JavaScript and Next.js. We’ll also incorporate additional 3rd party APIs to build and deploy a music visualization app.
Topics:- Creating a React Project with Next.js- Choosing a LLM- Customizing Streaming Interfaces- Building Routes- Creating and Generating Components - Using Hooks (useChat, useCompletion, useActions, etc)
Leveraging LLMs to Build Intuitive AI Experiences With JavaScript
JSNation 2024JSNation 2024
108 min
Leveraging LLMs to Build Intuitive AI Experiences With JavaScript
Featured Workshop
Roy Derks
Shivay Lamba
2 authors
Today every developer is using LLMs in different forms and shapes, from ChatGPT to code assistants like GitHub CoPilot. Following this, lots of products have introduced embedded AI capabilities, and in this workshop we will make LLMs understandable for web developers. And we'll get into coding your own AI-driven application. No prior experience in working with LLMs or machine learning is needed. Instead, we'll use web technologies such as JavaScript, React which you already know and love while also learning about some new libraries like OpenAI, Transformers.js
Llms Workshop: What They Are and How to Leverage Them
React Summit 2024React Summit 2024
66 min
Llms Workshop: What They Are and How to Leverage Them
Featured Workshop
Nathan Marrs
Haris Rozajac
2 authors
Join Nathan in this hands-on session where you will first learn at a high level what large language models (LLMs) are and how they work. Then dive into an interactive coding exercise where you will implement LLM functionality into a basic example application. During this exercise you will get a feel for key skills for working with LLMs in your own applications such as prompt engineering and exposure to OpenAI's API.
After this session you will have insights around what LLMs are and how they can practically be used to improve your own applications.
Table of contents: - Interactive demo implementing basic LLM powered features in a demo app- Discuss how to decide where to leverage LLMs in a product- Lessons learned around integrating with OpenAI / overview of OpenAI API- Best practices for prompt engineering- Common challenges specific to React (state management :D / good UX practices)
Working With OpenAI and Prompt Engineering for React Developers
React Advanced 2023React Advanced 2023
98 min
Working With OpenAI and Prompt Engineering for React Developers
Top Content
Workshop
Richard Moss
Richard Moss
In this workshop we'll take a tour of applied AI from the perspective of front end developers, zooming in on the emerging best practices when it comes to working with LLMs to build great products. This workshop is based on learnings from working with the OpenAI API from its debut last November to build out a working MVP which became PowerModeAI (A customer facing ideation and slide creation tool).
In the workshop they'll be a mix of presentation and hands on exercises to cover topics including:
- GPT fundamentals- Pitfalls of LLMs- Prompt engineering best practices and techniques- Using the playground effectively- Installing and configuring the OpenAI SDK- Approaches to working with the API and prompt management- Implementing the API to build an AI powered customer facing application- Fine tuning and embeddings- Emerging best practice on LLMOps
Building AI Applications for the Web
React Day Berlin 2023React Day Berlin 2023
98 min
Building AI Applications for the Web
Workshop
Roy Derks
Roy Derks
Today every developer is using LLMs in different forms and shapes. Lots of products have introduced embedded AI capabilities, and in this workshop you’ll learn how to build your own AI application. No experience in building LLMs or machine learning is needed. Instead, we’ll use web technologies such as JavaScript, React and GraphQL which you already know and love.