Technology

Marlene Mhangami: Playwright for Functionality Testing

Marlene Mhangami from Microsoft and GitHub discusses leveraging Playwright and AI agents for effective functionality testing, emphasizing clean code and behavior-driven development.

StartupHub.ai Staff

By StartupHub.ai Staff, reviewed by Daniel Singer, Editor

3 min read

Marlene Mhangami presenting 'Beyond Code Coverage: Functionality Testing with Playwright'
Image credit: AI EngineerCredit: AI Engineer
Visual TL;DR
Code Volume SurgeDriver
From the articleShe highlighted the increasing volume of code being created, citing GitHub's Octoverse report which showed over a billion commits in 2020 and projected growth to 14 billion by 2025.
Code Coverage InsufficientDriver
From the article 3 mentionsMhangami began by setting the stage, emphasizing that while code coverage is a common metric, it doesn't guarantee that software functions as expected from a user's perspective.
Functionality Testing NeedContext
robust strategies are crucial given increasing development volume
From the article 3 mentionsThis surge in development underscores the need for robust testing strategies.
Playwright & AI AgentsCore
Marlene Mhangami's focus for effective testing
From the article 7 mentionsThe demo showcased how an AI agent could be used to interact with the Playwright CLI to generate and run tests based on feature requests.
Clean Code PracticesContext
emphasized for better testability and maintainability
From the articleMhangami presented a case study that illustrated how unchecked AI adoption, without a focus on clean code, could lead to increased entropy and a decrease in code quality, despite a rise in pull requests.
Behavior-Driven DevelopmentContext
integrated approach for aligning tests with user needs
From the article 5 mentionsA key theme of the presentation was the impact of engineering environments on AI-assisted development.
AI for ProductivityEffect
leveraging AI agents to enhance developer workflows
From the article 3 mentionsMhangami presented a slide that suggested a strong correlation between a clean engineering environment and increased AI productivity gains.
Effective Functionality TestingOutcome
achieved through Playwright and AI integration
From the article 2 mentionsThe presentation underscored the growing synergy between AI and software development, particularly in ensuring the quality and functionality of applications through effective testing strategies with tools like Playwright.
Contents(4)

Marlene Mhangami, a Senior Developer Advocate at both Microsoft and GitHub, recently delivered a presentation titled "Beyond Code Coverage: Functionality Testing with Playwright." Mhangami, who works within the Core AI group focusing on developer productivity, shared insights into how AI can be integrated into software development workflows, particularly in the realm of testing.

Marlene Mhangami: Playwright for Functionality Testing - AI Engineer
Marlene Mhangami: Playwright for Functionality Testing, AI Engineer

The Role of Functionality Testing

Mhangami began by setting the stage, emphasizing that while code coverage is a common metric, it doesn't guarantee that software functions as expected from a user's perspective. She highlighted the increasing volume of code being created, citing GitHub's Octoverse report which showed over a billion commits in 2020 and projected growth to 14 billion by 2025. This surge in development underscores the need for robust testing strategies.

A key theme of the presentation was the impact of engineering environments on AI-assisted development. Mhangami presented a slide that suggested a strong correlation between a clean engineering environment and increased AI productivity gains. She explained that AI thrives in environments with good test coverage, modularity, and well-written code, allowing it to more effectively assist developers in completing tasks and improving software quality.

AI's Impact on Developer Productivity

The presentation explored the question of whether AI truly makes developers more productive. Mhangami presented a case study that illustrated how unchecked AI adoption, without a focus on clean code, could lead to increased entropy and a decrease in code quality, despite a rise in pull requests. This highlighted the importance of a structured approach to integrating AI tools.

Conversely, she suggested that when AI is used effectively within a clean, well-maintained codebase, it can amplify productivity. This involves leveraging AI for tasks like generating tests, writing code, and even refactoring. Mhangami touched upon the concept of Test-Driven Development (TDD), explaining the typical Red-Green-Refactor loop and noting that AI can assist in each stage, from generating initial failing tests to refactoring code to meet requirements.

Playwright for Functionality Testing

Mhangami then introduced Playwright, an open-source testing framework developed by Microsoft. She described Playwright as a tool that automates end-to-end testing in the browser by simulating user interactions. Playwright supports multiple programming languages, including Python, TypeScript, and C#, and can run tests in both headed and headless modes. The demo showcased how an AI agent could be used to interact with the Playwright CLI to generate and run tests based on feature requests.

The demonstration involved a scenario where an AI agent, provided with a feature request email, was able to identify the necessary tests, write Playwright scripts to execute them, and report on their success. This illustrated the potential for AI to significantly speed up the test writing process and ensure that features function as intended.

Best Practices for AI-assisted testing

Mhangami concluded by offering best practices for developers looking to leverage AI in their testing workflows:

  • Add screenshots to Pull Requests (PRs): This provides visual context for code changes and test results.
  • Use headless mode for multi-tasking: Headless mode allows for running tests in the background without opening a browser window, enabling more efficient parallel execution.
  • Commit before running the 'Healer': This implies a workflow where code is committed before using AI tools to fix or refactor it, ensuring a stable baseline.
  • Generate tests one feature at a time: This approach helps maintain focus and manage complexity when working with AI-generated tests.

The presentation underscored the growing synergy between AI and software development, particularly in ensuring the quality and functionality of applications through effective testing strategies with tools like Playwright.

Mentioned in this story

Markets

MicrosoftNASDAQ:MSFT

Get the free daily brief every morning

Every morning the day's AI news, new AI startups and new funding rounds. Free and takes a few minutes to read, unsubscribe at any time.

Join 64,000 other subscribers.

TopicsMarlene MhangamiMicrosoftGitHubPlaywrightAISoftware TestingDeveloper ProductivityTest Driven Development

StartupHub.ai StaffDaniel SingerWritten by StartupHub.ai Staff, Editorial teamReviewed by Daniel Singer, EditorAbout

StartupHub.ai Staff, Editorial team

The staff writers of StartupHub.ai, ranging from investment analysts to avid AI tool users, early adopters and critical enthusiasts. Backgrounds span engineering, business and the arts. We hold every piece to rigorous standards of research and review.

Daniel Singer, Editor

Daniel Singer is an AI expert who has been writing about, covering and building AI technology since 2018.

More from Daniel Singer

Test your Agent Readiness now

Paste your website. How well ChatGPT, Claude and the other agents can read and use a site, in about a minute.

Watch

The videos behind the news, one flip at a time

The feed mixes the videos from our articles with startup demos and you flip through them like TV channels for free with no signup.