Lucian Ghinda
@lucianghinda.com
1.8K followers 760 following 1.9K posts
Product Engineer, Ruby on Rails Developer ‣ Curator of newsletter.shortruby.com ‣ Helping #Ruby developers design better test cases at https://goodenoughtesting.com
Posts Media Videos Starter Packs
Pinned
lucianghinda.com
Only 7 spots are still available for the #GoodEnoughWorkshop happening on 12 December at 15:00 UTC. Last days for getting the tickets with discounts!

You can buy a ticket here lu.ma/533zg5zq
lucianghinda.com
The pairing one because I want to access any branch quickly I'm reviewing while still seeing the main branch. Having separate folders makes switching between them easy.

Additionally, I use folders for each feature or bug I'm working on.
lucianghinda.com
Why these folders:

I always maintain a local copy of the current main branch. This helps me review changes or start something new, as I can quickly verify how production functions if the main branch is what's deployed.
lucianghinda.com
Say I work on the short_ruby project and set up the following structure:

`short_ruby/main`: Main branch.
`short_ruby/pairing`: For code reviews, exploring changes, or sharing drafts.
`short_ruby/feature_<id>`: A temporary worktree for each feature, deleted when complete.
lucianghinda.com
I've been using git worktree for at least five years now.
Here's how I set things up:
How I use git worktree
lucianghinda.com
During the workshop, we will not write any test code in RSpec or Minitest; instead, we will focus more on test design.

Here is an example of a slide from the workshop where we discuss test design for low risk and low effort. We also cover high risk and high effort scenarios.
lucianghinda.com
During the workshop, I use Ruby code to demonstrate logic that facilitates discussion of various testing techniques. However, knowing Ruby is not a strict requirement.

The code samples resemble pseudocode, thanks to Ruby's remarkable similarity to English.

Example:
answer to question if people that attend should now Ruby
lucianghinda.com
6 spots filled, 9 remaining for the Good Enough Workshop this Friday at 15:00 UTC

Here are all the details about the workshop. In case you have questions reply here or via email -> [email protected]
Screenshot of Workshop page
lucianghinda.com
Made also a small video (thanks to @snappify.com) from the last thread:
bsky.app/profile/luc...
lucianghinda.com
Good test data isn’t random.

It’s chosen deliberately by structure, boundaries, and risk.
Good test data isn’t random.  It’s chosen deliberately by structure, boundaries, and risk.
lucianghinda.com
Synthetic data = clean logic testing.
Realistic data = messy, real-world surprises.

You need both in various degrees.
Synthetic data = clean logic testing. Realistic data = messy, real-world surprises.  You need both in various degrees.
lucianghinda.com
Edge cases are bug magnets.

Just as example when working with strings or numbers:

- Empty strings
- Nulls
- Max lengths
- Weird characters
- Very large numbers
Edge cases are bug magnets.  Just as example when working  with strings or numbers:   - Empty strings - Nulls - Max lengths - Weird characters - Very large numbers
lucianghinda.com
Don’t over-test (of course this depends on the industry you are in and regulations)

Cover each risk area once, then go deeper where instability or change occurs. That’s risk-based coverage.
Don’t over-test (of course this depends on the industry you are in and regulations)  Cover each risk area once, then go deeper where instability or change occurs. That’s risk-based coverage.
lucianghinda.com
In case you are testing only the “happy path.” That’s sampling bias.
Sometimes it is ok if that is a part of the codebase with low risk, sometimes it is bad as you are leaving out important cases/users/groups.
In case you are testing only the “happy path.” That’s sampling bias. Sometimes it is ok if that is a part of the codebase with low risk,  sometimes it is bad as you are leaving out important cases/users/groups.
lucianghinda.com
Divide inputs into logical groups and pick from each.
That’s equivalence partitioning.

Example: A login form:
TC1: ✅ valid user
TC2: ❌ invalid password
TC3: 🚫 nonexistent user
TC4: ⚪ empty input
Divide inputs into logical groups and pick from each. That’s equivalence partitioning.
lucianghinda.com
Random sampling = fuzz testing.
Systematic sampling = one from each important category or boundary.

For business logic, systematic sampling works best because you want to pin specific cases as documentation and protection of future failures.
Random sampling = fuzz testing. Systematic sampling = one from each important category or boundary.  For business logic, systematic sampling works best because you want to pin specific cases as documentation and protection of future failures.
lucianghinda.com
Think of your code’s input space as a population. Your tests are a sample of that population.
Your goal: test a meaningful and representative subset.
Think of your code’s input space as a population. Your tests are a sample of that population. Your goal: test a meaningful and representative subset.
lucianghinda.com
The time you spend setting up realistic test data today is an investment.

It saves hours when debugging tomorrow, especially during critical incidents.
The time you spend setting up realistic test data today is an investment.  It saves hours when debugging tomorrow, especially during critical incidents.
lucianghinda.com
Good tests begin with good samples.
You can’t test everything, but you can test a representative subset that matters.
Think like a statistician: sample across boundaries, cover each risk area, and avoid bias.
Good tests begin with good samples. You can’t test everything, but you can test a representative subset that matters. Think like a statistician: sample across boundaries, cover each risk area, and avoid bias.
lucianghinda.com
Just a reminder:

The Short Ruby Newsletter continues as usual, with nearly 6,000 subscribers.

If you'd like to receive weekly news from the #Ruby world, visit newsletter.shortruby.com.
Short Ruby Newsletter
It is a Monday morning summary of the articles, discussions, and news from the Ruby community
newsletter.shortruby.com
lucianghinda.com
This is a pleasant surprise to find out that people are subscribing to my personal newsletter.

I started with 360 people merged from various lists and now we are over 400. Got 37 new subscribers in the last 7 days.

The newsletter is at: newsletter.lucianghinda.com
Reposted by Lucian Ghinda
martinemde.com
Now’s a good time to add CHECKSUMS to your Gemfile.lock. For an existing project:

bundle lock --add-checksums

This will add a new CHECKSUMS section to the lockfile that Bundler will keep up to date.

Now, configure Bundler to always include checksums:

bundle config lockfile_checksums true