3min chapter

Software Engineering Radio - the podcast for professional software developers cover image

SE Radio 572: Gregory Kapfhammer on Flaky Tests

Software Engineering Radio - the podcast for professional software developers

CHAPTER

How to Avoid Writing Flaky Tests

A goal that I set for myself whenever possible is to avoid introducing conditional logic or loops into my test suite. Whenever it's possible to do so, I also try to ensure that I have as few assertions as possible in my test suite because that will also give me more confidence in the test cases reliability when it's run frequently on a developer workstation or in CI. There's one strategy that I always think of to aid my testing process and it has to do with the number of inputs that go into the function under test and then the number of outputs. So if I have a significant number of inputs, but only a single output or no Outputs? Then I probably don't have enough

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode