438: Writing abstractions in tests
The Bike Shed3 Sep 2024

438: Writing abstractions in tests

Writing abstractions in tests can be surprisingly similar to storytelling. The most masterful stories are those where the author has stripped away all of the extra information, and given you just enough knowledge to be immersed and aware of what is going on. But striking that balance can be tricky, both in storytelling and abstractions in tests. Too much information and you risk overwhelming the reader. Too little and they won’t understand why things are operating the way they are. Today, Stephanie and Joël get into some of the more controversial practices around testing, why people use them, and how to strike the right balance with your information. They discuss the most common motivations for introducing abstractions, from improved readability to simplifying the test’s purpose and the types of tests where they are most likely to introduce abstractions. Our hosts also reflect on how they feel about different abstractions in tests – like custom matchers and shared examples – outlining when they reach for them, and the tradeoffs and benefits that come with each. To learn more about how to find the perfect level of abstraction, be sure to tune in!

Key Points From This Episode:

What’s new in Joël’s world; mocking out screens for processes or a new bit of UI.
The new tool Stephanie’s using for reading on the web: Reader by Readwise.
Today’s topic: controversial practices around testing.
How Stephanie and Joël feel about looping through arrays and having IT blocks for each.
The most common motivations for introducing abstractions or helper methods into your tests.
Pros and cons of factories as abstractions in testing.
Types of tests where Joël and Stephanie are more likely to introduce abstractions.
Using page objects in system tests to improve user experience.
Finding the balance between too little and too much information with abstraction in testing.
Why Stephanie has been enjoying fancier matchers like RSpecs.
Top uses of custom matchers, especially for specialized error messaging.
Why Stephanie prefers custom matchers over shared examples.
Using helper methods as a lighter version of abstraction.
Differences and similarities between abstractions in tests versus application code.
A reminder to keep your goals in mind when using abstraction.

Links Mentioned in Today’s Episode:

Det här avsnittet är hämtat från ett öppet RSS-flöde och publiceras inte av Podme. Det kan innehålla reklam.

Avsnitt(510)

510: Technical Debt is Technically Risk

510: Technical Debt is Technically Risk

Debt metaphors abound! In this week’s episode of The Bike Shed, Aji and Joel ponder the question, what are risks in a code base? From looking at technical risk as a different lens on the idea of tech...

13 Okt 36min

509: Bringing Back Rails Generators with Rachel Wright-Munn

509: Bringing Back Rails Generators with Rachel Wright-Munn

Joël takes Bike Shed out onto the conference floor at RailsWorld as he interviews programer and streamer Rachael Wright-Munn, aka ChaelCodes. Rachael talks about her efforts to index all ruby events ...

6 Okt 23min

508: The Wonders of Static Analysis

508: The Wonders of Static Analysis

In this week’s episode of The Bike Shed, Aji and Joël dive into the distrust around the phrase ‘programmer discipline’, why you cannot just rely on willpower, and how Static Analysis tools can help wi...

29 Sep 42min

507: Stacked Vertical Slices

507: Stacked Vertical Slices

The Bike Shed is BACK! Aji and Joel kick off this week’s episode with a fantastic combination of component bugs and how much headspace they take up, historic heraldry vs ChatGPT’S anchoring bias, befo...

15 Sep 44min

506: The Muppet Software Team

506: The Muppet Software Team

It’s time to play the music, it’s time to… get Aji and Sally together again. This week’s episode is a radical one, and a listener suggestion no less; let’s Muppet-cast a software development team! Wh...

14 Juli 38min

505: What is a “principal” or “staff” engineer?

505: What is a “principal” or “staff” engineer?

Sally and Joël join forces to discuss the different ways to interpret the role of a ‘principle’ or ‘staff’ engineer, and the handwaving around what those titles mean in terms of the gradation. Whilst...

7 Juli 34min

504: AI Ethics (with guests!)

504: AI Ethics (with guests!)

Aji is joined by thoughtbot’s own Tess Griffin and Jimmy Thigpen, two members of the recently established AI Ethics Taskforce, to talk about what kind of conversations are going on in the company arou...

30 Juni 32min

503: Seeing the Graph for the Trees

503: Seeing the Graph for the Trees

Aji and Joël join forces to discuss graph and tree structures, and their connection to the emergent properties, attributes and qualities you can find from a largely connected group of data. Joël dive...

23 Juni 41min

Populärt inom Politik & nyheter

svenska-fall
aftonbladet-krim
fordomspodden
motiv
rss-krimstad
p3-krim
flashback-forever
aftonbladet-daily
svd-ledarredaktionen
rss-vad-fan-hande
rss-sanning-konsekvens
rss-expressen-dok
rss-krimreportrarna
omni-podd
kungligt
spar
rss-flodet
en-runda-till
olyckan-inifran
rss-sparra-in-isa-tilda