Jakub Sobolewski
@jakub-sobolewski.bsky.social
29 followers 12 following 84 posts
I help R developers improve their testing skills. https://jakubsobolewski.com Staff Engineer @ Appsilon.
Posts Media Videos Starter Packs
jakub-sobolewski.bsky.social
Have lots of tests but still do heavy manual testing?

That’s a red flag your tests don’t build confidence. Tests should help you ship faster, not add overhead. Rethink your test strategy to reduce manual effort.
jakub-sobolewski.bsky.social
Flaky tests? They waste energy and slow development.

Look for external dependencies like timers, APIs, or asynchronous events. If you own the code, inject and substitute those dependencies. If not, stub them. In Shiny apps, wait properly before asserting.
jakub-sobolewski.bsky.social
If you update tests with every code change, you’re wasting time.

Test public interfaces, the ways your code is actually used. This keeps tests stable, meaningful, and cuts down on brittle failures. Focus on testing behavior, not implementation details.
jakub-sobolewski.bsky.social
What's worse than no automated tests? Bad tests.

Automated tests should save time and catch bugs early. But bad tests slow you down, cause frustration, and reduce confidence. Let’s unpack three common testing traps and how to avoid them. 🧵
jakub-sobolewski.bsky.social
Users get value. You save time and money.

Don’t get lost in code no one asked for. Take control of what gets built.

Ready to change your workflow?
jakub-sobolewski.bsky.social
I break down how to start with Behavior-Driven Development and build features your users actually want.

How it works:
→ Start every feature as a user story, not a wish list.
→ Write specs from your users’ words.
→ Write only the code users need.
→ Automate checks along the way.
jakub-sobolewski.bsky.social
Building code gets easier every day with AI. Building code that truly matters to users remains the real challenge.

At @user-conf.bsky.social virtual, I’m sharing how to ship only what matters.

See it here: youtu.be/e4H28G2J05U?...

#rstats #opensource
Don’t Write Code Your Users Haven’t Asked For - Jakub Sobolewski
YouTube video by useR! Conference
youtu.be
jakub-sobolewski.bsky.social
Great point.

1. APIs are versioned: you track the API version (or version of a package that wraps an API). Your contracts should be safe until you upgrade to new version.
2. Schedule a test run that checks if real APIs still return the shapes you expect. Run it periodically for extra safety.
jakub-sobolewski.bsky.social
🔁 Result:

Fast tests ✅
Reliable tests ✅
Cheap tests ✅
Better dev experience ✅
jakub-sobolewski.bsky.social
Here's the approach:

1. Abstract the dependency with an interface
2. Use fakes or mocks in tests
3. Test your code's behavior *against* the fake
4. Plug in the real dependency only in production
jakub-sobolewski.bsky.social
✅ Test only the code you own.

How? Simulate the external system in tests. You don’t need the real thing.
jakub-sobolewski.bsky.social
🚫 Why you shouldn't test external dependencies directly:

🐢 Slow (waiting for responses)
🎲 Flaky (unreliable availability/results)
💸 Expensive (API costs add up)

Or worse, tests don’t get written at all.
jakub-sobolewski.bsky.social
🧪 New pattern in the R Tests Gallery: Testing code that uses LLMs, APIs, or databases

External systems power our code, LLMs, APIs, DBs, libraries, but they don’t need to be in our tests.

Check it out 👉 jakubsobolewski.com/r-tests-gall...

#rstats #opensource
R Tests Gallery
Learn how to effectively test in R and use tests to drive your development process.
jakubsobolewski.com
jakub-sobolewski.bsky.social
Ask AI to draft specs, review them, then refine.
Repeat in minutes what might take days by hand.

Your specs become abstract, clear, and future-proof—no matter how the app evolves.

Give it a go. Cut through legacy fog with AI-powered BDD.
jakub-sobolewski.bsky.social
Imagine this workflow:

👉 Start on a “Data” page with steps: Upload → Filtering → Mapping → Preview
👉 User uploads or picks a default dataset, then moves through steps
👉 Submit variable mappings → data preview appears
👉 “Visualization” unlocks to view plots
jakub-sobolewski.bsky.social
𝗪𝗮𝗻𝘁 𝘁𝗼 𝘄𝗿𝗶𝘁𝗲 𝘀𝗽𝗲𝗰𝘀 𝗳𝗼𝗿 𝗮𝗻 𝗲𝘅𝗶𝘀𝘁𝗶𝗻𝗴 𝗮𝗽𝗽? 𝗟𝗲𝘁 𝗔𝗜 𝗵𝗲𝗹𝗽 𝘆𝗼𝘂 𝗶𝘁𝗲𝗿𝗮𝘁𝗲 𝗳𝗮𝘀𝘁𝗲𝗿.

Writing specs after the fact gets messy fast. You’re tempted to mention buttons, screens, and other UI stuff, but that only locks you into one way the app works.

#rstats #opensource
Reposted by Jakub Sobolewski
jonocarroll.fosstodon.org.ap.brid.gy
The latest issue of @rweekly is now live!

https://rweekly.org/2025-W31.html

Highlights:
📊 Copy the Pros: How to Recreate this NYTimes Chart in R by @MrPecners
⏩ Speed Testing Code: Three Levels by @kellybodwin
🧪 Testing your Plumber APIs from R by @jakub-sobolewski.bsky.social

As always […]
Original post on fosstodon.org
fosstodon.org
jakub-sobolewski.bsky.social
🔔 Follow me or subscribe for updates as new examples land.
🤔 Have a specific case you want covered? Leave a comment or submit a request, let's build something great, together!
jakub-sobolewski.bsky.social
What You’ll Find

→ A growing collection of focused R test examples
→ Step-by-step breakdowns showing what to do and why it works
→ Real code ready to drop into your project with confidence

So far, there’s only one example, but many more are on the way! 🚀
jakub-sobolewski.bsky.social
As The R Tests Gallery grows, I hope it becomes a reliable source for test examples, techniques, and practical practices in live code.

The patterns featured come straight from real projects I’ve worked on, if they helped me, maybe they’ll help you too!
jakub-sobolewski.bsky.social
Your legacy Shiny app doesn't have to stay legacy forever.

Want to learn more about testing strategies for R? Check out my packages and resources for comprehensive testing approaches.

jakubsobolewski.com/blog
Testing in R
Learn how to effectively test in R and use tests to drive your development process.
jakubsobolewski.com
jakub-sobolewski.bsky.social
3️⃣ Refactor and Unit Test

Now you have a safety net. Start refactoring the code base into smaller, testable pieces. The acceptance tests will catch any regressions while you improve the code structure.