Jakub Sobolewski's Avatar

Jakub Sobolewski

@jakub-sobolewski.bsky.social

I help R developers improve their testing skills. https://jakubsobolewski.com Staff Engineer @ Appsilon.

23 Followers  |  12 Following  |  79 Posts  |  Joined: 27.10.2024  |  2.2835

Latest posts by jakub-sobolewski.bsky.social on Bluesky

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?

04.08.2025 14:34 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

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.

04.08.2025 14:34 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Donโ€™t Write Code Your Users Havenโ€™t Asked For -  Jakub Sobolewski
YouTube video by useR! Conference Donโ€™t Write Code Your Users Havenโ€™t Asked For - Jakub Sobolewski

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

04.08.2025 14:34 โ€” ๐Ÿ‘ 8    ๐Ÿ” 4    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 1

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.

01.08.2025 09:59 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

๐Ÿ” Result:

Fast tests โœ…
Reliable tests โœ…
Cheap tests โœ…
Better dev experience โœ…

01.08.2025 09:10 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

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

01.08.2025 09:10 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

โœ… Test only the code you own.

How? Simulate the external system in tests. You donโ€™t need the real thing.

01.08.2025 09:10 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

๐Ÿšซ 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.

01.08.2025 09:10 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Preview
R Tests Gallery Learn how to effectively test in R and use tests to drive your development process.

๐Ÿงช 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

01.08.2025 09:10 โ€” ๐Ÿ‘ 6    ๐Ÿ” 2    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0

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.

30.07.2025 08:18 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Preview
How to Write Cucumber Specifications the Right Way: From App Description to Scenarios Adding Cucumber specifications to an existing application? Learn how to write Gherkin scenarios that focus on user behavior, not implementation details. Use AI to iterate faster.

Looks simple but hides complexity. How to write tests that capture what happens without leaking how?

Check this post to see how to use AI to iterate on writing specifications faster: jakubsobolewski.com/blog/ai-assi...

30.07.2025 08:18 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

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

30.07.2025 08:18 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

๐—ช๐—ฎ๐—ป๐˜ ๐˜๐—ผ ๐˜„๐—ฟ๐—ถ๐˜๐—ฒ ๐˜€๐—ฝ๐—ฒ๐—ฐ๐˜€ ๐—ณ๐—ผ๐—ฟ ๐—ฎ๐—ป ๐—ฒ๐˜…๐—ถ๐˜€๐˜๐—ถ๐—ป๐—ด ๐—ฎ๐—ฝ๐—ฝ? ๐—Ÿ๐—ฒ๐˜ ๐—”๐—œ ๐—ต๐—ฒ๐—น๐—ฝ ๐˜†๐—ผ๐˜‚ ๐—ถ๐˜๐—ฒ๐—ฟ๐—ฎ๐˜๐—ฒ ๐—ณ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ.

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

30.07.2025 08:18 โ€” ๐Ÿ‘ 2    ๐Ÿ” 1    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Original post on fosstodon.org

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 [โ€ฆ]

28.07.2025 11:01 โ€” ๐Ÿ‘ 5    ๐Ÿ” 4    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

๐Ÿ”” 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!

22.07.2025 08:06 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

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! ๐Ÿš€

22.07.2025 08:06 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

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!

22.07.2025 08:06 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Testing in R Learn how to effectively test in R and use tests to drive your development process.

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

15.07.2025 12:01 โ€” ๐Ÿ‘ 1    ๐Ÿ” 1    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

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.

15.07.2025 12:01 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

2๏ธโƒฃ Create Acceptance Tests

With the behavior documented, make it executable with Cucumber.

To implement the steps you can use:

โ†’ shinytest2
โ†’ Playwright
โ†’ or Cypress

There's a Cucumber implementation available to execute your specifications whether your steps are written in R or JavaScript.

15.07.2025 12:01 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Format specifications with Given, When, Then syntax to describe preconditions, actions and outcomes.

This creates living documentation that both technical and non-technical stakeholders can understand and validate.

15.07.2025 12:01 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Write it down.

Don't mix user interface with behavior. Be precise, but abstract enough so that those behaviors are true when the implementation changes. Instead of saying "click a button", try to phrase it as "do something".

Stay focused on the business goal.

15.07.2025 12:01 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

1๏ธโƒฃ Document Current Behavior

Work with previous maintainers and users to understand what the app should do.

Don't assume you know everything. Ask questions like:

โ†’ What happens when users click this button?
โ†’ How should the app respond to different inputs?

15.07.2025 12:01 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Your legacy Shiny app needs a makeover, but jumping straight into refactoring is like repainting a room with furniture still inside. Things will get messy.

The safest approach? Write acceptance tests first.

#rstats #rshiny #tests #testing #opensource

15.07.2025 12:01 โ€” ๐Ÿ‘ 3    ๐Ÿ” 2    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Preview
Issue 2025-W28 Highlights It's been far too long since our last episode of R Weekly Highlights, but we are finally back with episode 207! In this episode we learn about novel waysโ€ฆ

Episode 207 of R Weekly Highlights is out! serve.podhome.fm/episodepage/...
๐Ÿ› ๏ธ Generating Quarto syntax (Danielle Navarro)
๐Ÿค” Behavior-Driven Development @jakub-sobolewski.bsky.social
๐Ÿ” Dive()ing into the Hunt @milesmcbain.bsky.social

h/t @mike-thomas.bsky.social & @rbyryo.bsky.social ๐Ÿ™

#RStats

12.07.2025 16:06 โ€” ๐Ÿ‘ 6    ๐Ÿ” 3    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Every failing or awkward test is feedback.

Let your tests guide you toward modular, decoupled, focused code.

11.07.2025 09:24 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

3๏ธโƒฃ Tests can warn you when your code does too much.

If a single test checks too many things, has lots of assertions, or uses โ€œandโ€ in its title, your code probably lacks separation of concerns.

Clean code means each part, and each test has a focused job.

11.07.2025 09:24 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

2๏ธโƒฃ Tests can show if your code is tightly coupled.

If testing requires an elaborate setup or stubbing lots of internal parts, your code is likely tightly coupled.

When tests expose implementation details, itโ€™s a warning sign: your codeโ€™s parts depend on each other too much.

11.07.2025 09:24 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

1๏ธโƒฃ Tests can reveal if your code isnโ€™t modular.

If you struggle to run code in tests, needing to pass tons of arguments, set up global state, write files, or mock everything, your code probably isnโ€™t modular.

Modular code is easy to use in any context, not just production.

11.07.2025 09:24 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

3 Things Tests Reveal About Your Code

Ever wondered what your tests are really telling you about your code?
Tests arenโ€™t just safety netsโ€”theyโ€™re feedback loops on your design.

#rstats #tests

11.07.2025 09:24 โ€” ๐Ÿ‘ 3    ๐Ÿ” 2    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

@jakub-sobolewski is following 12 prominent accounts