Feature: View Sales Trends
Scenario: User views the sales trend for a product category
Given the user can view product sales information
When they view the sales trend for "Electronics"
Then they should see the sales trend plot for "Electronics"
Scenario: User views the sales trend for a specific product
Given the user can view product sales information
When they view the sales trend for "Smartphone"
Then they should see the sales trend plot for "Smartphone"
Write tests in plain language that stakeholders and users can understand, review, and validate.
Enable collaboration between developers, testers, and business analysts by using a common language.
Your tests become executable documentation that always stays up-to-date with your code.
Focus on the behavior of your software rather than its implementation details.
Create a library of reusable test steps that can be combined to create complex scenarios.
plan <- muttest::plan(
mutators = list(
muttest::operator("+", "-"),
muttest::operator("-", "+"),
muttest::operator("*", "/"),
muttest::operator("/", "*"),
muttest::operator("==", "!="),
muttest::operator("!=", "==")
)
)
muttest::muttest(plan)
Discover weak spots in your test suite by introducing small changes to your code and checking if tests catch them.
Focus on test effectiveness rather than just coverage percentages. Muttest reveals if your tests actually validate behavior.
Systematically introduce mutations to your code and run tests to measure how well they detect changes.
Build more robust test suites that actually catch bugs and regressions in your R code.
Refactor code with confidence knowing your tests will catch any breaking changes.
# tests/acceptance/test-budget.R
test_that("Scenario: I can inspect my net balance", {
# Given
dsl$record_income(2000)
dsl$record_expense(500)
# When
dsl$inspect_finances()
# Then
dsl$verify_total_income(2000)
dsl$verify_total_expenses(500)
dsl$verify_net_balance(1500)
dsl$teardown()
})
Transform vague requirements into clear, testable user stories that define what users want to accomplish.
Turn user scenarios into working code that validates your application behaves as expected.
Create a testing vocabulary that bridges technical implementation with business language.
Focus on behavior, not implementation details, allowing your UI to evolve without breaking tests.
Learn practical techniques for building more maintainable, testable Shiny applications.
Learn different testing strategies and when to apply them for maximum effectiveness in Shiny apps.
Convert business requirements into automated tests that validate your application meets user needs.
Test each Shiny module independently to ensure they function correctly before integration.
Use dependency injection to replace external services with test doubles for faster, more reliable tests.
Apply a systematic testing methodology that improves code quality and development speed.
I’m a software engineer specializing in R with 5+ years of experience.
I believe automated testing is the key to building quality software.
My journey into R testing began with a project where to develop code, you had to be connected to the production environment. Turns out, it was a terrible developer experience.
I'm particularly passionate about knowledge sharing, which is why I maintain an active blog and R Tests Gallery. I believe that when we share our testing experiences—both successes and failures—we all become better developers.
I approach testing with a practical mindset: tests should make development faster and more confident, not slower and more burdensome. My goal is to help teams find testing strategies that actually enhance their workflow.