Posts and resources by Karan Gathani#
Old Apps, New Tricks: How AI can write Automated Tests for your Shiny Apps (Karan Gathani, Posit)
Old Apps, New Tricks: How AI can write Automated Tests for your Shiny Apps
Speaker(s): Karan Gathani
Abstract:
As Shiny applications grow in complexity, comprehensive testing becomes crucial yet often overlooked. Many developers struggle to implement proper testing due to time constraints and technical barriers. To address this challenge, we’re introducing an innovative solution that automatically generates regression tests for existing Shiny apps. By leveraging AI models trained on testing best practices, the Shiny package will streamline the testing process, making it more accessible and efficient for developers of all skill levels.
Materials - https://docs.google.com/presentation/d/130bJNGp3XIlKPaouA8K0Lv0O3P7OFesW/edit?usp=sharing&ouid=105060716153365836674&rtpof=true&sd=true posit::conf(2025) Subscribe to posit::conf updates: https://posit.co/about/subscription-management/

Using controllers to write robust Shiny for Python app tests | Karan Gathani | Posit
With the Shiny for Python v1.0 release, controllers were exposed to provide a structured and consistent way for users to interact with and test UI components in Shiny applications. They offer an abstraction layer that encapsulates the complexity of interacting with specific UI elements, making it easier for developers to write robust tests and automate interactions with their Shiny apps.
Reference documentation - https://shiny.posit.co/py/api/testing/ https://shiny.posit.co/py/docs/playwright-testing.html

Creating tests for Shiny for Python apps | Karan Gathani | Posit
With the Shiny for Python v1.0 release, Shiny provides a simple way to create a test file for your Shiny app. The shiny add test command is a helpful CLI tool for Shiny app developers. It simplifies the process of creating test files for their applications.
When you run this command, it prompts you to input two pieces of information: the path to your Shiny app file and the desired location for the new test file.
Once you provide these details, the command automatically generates a test file at the specified location. This new file includes a pre-made test template, giving you a solid starting point for writing your app’s tests.
Reference documentation - https://shiny.posit.co/py/docs/unit-testing.html https://shiny.posit.co/py/docs/playwright-testing.html
