HackerTubewatch
Surprise me
Frame from J B  Rainsberger   Integrated Tests Are A Scam HD Plays via YouTube's privacy-enhanced embed

J B Rainsberger Integrated Tests Are A Scam HD

Christopher Cabanne
Talks
YouTube
4 HN users recommended this talk4 months2017–2023 score 4
Years with an HN recommendation, 2007–2026

HN recommends it in testing-strategy debates as the classic case for fewer integration tests and more small, well-contracted unit tests.

J. B. Rainsberger argues that large integrated tests are a scam: they are slow, fail opaquely, and give a false sense of coverage. He advocates focused collaboration and contract tests at boundaries instead.

“JBRainsberger has an nice talk on them [1].” (HN, 2022)

4 recommendations · 2 citations · Talks · intermediate

6 Hacker News comments

From the HN archive; up to 20 kept per video, favoring different commenters. Recommendations first.

@pooktrain Mar 2017 Recommends
on HN thread Zen and the Art of Unit Testing
Trying to cover your state space with coarse-grained tests in database-backed applications can lead to slow tests suites that are laborious to set up/tear down, which is a barrier to fast build times in CI. This harms productivity both while writing tests and in deployment. J.B Rainsberger says it best: [this video]
Rainsberger on why coarse-grained integrated tests hurt productivity.
@1_player Oct 2017 Recommends
on HN thread Write tests. Not too many. Mostly integration
I have adopted the same philosophy. A few resources on this, part of the so-called London school TDD: - [link] (and the rest of the Wiki) - [link] - Most of the screencasts and articles at [link] (especially this brilliant talk [link] ) - Integration Tests Are A Scam: [this video] All of these basically go the opposite way of the article's philosophy: Not too many integration tests, mostly unit tests. Clearly define a contract between the boundaries of the code, and stub/mock on the contract. You'll be left with mostly pure functions at the leaves, which you'll unit test.
Argues for mostly unit tests with clear contracts at boundaries.
@mpweiher Jul 2018 Recommends
on HN thread Goodbye Microservices: From 100s of problem children to 1 superstar
Sure. I'd venture to say that integration tests should be fewer than unit tests, see hexagonal etc. Hopefully those external interfaces are also more stable, so they don't need to be run as often. I tend to use my integration tests also as characterization tests that verify the simulator/test-double I use for any external systems within my unit tests. See also: the testing pyramid[1] and "integrated tests are a scam"[2], which is a tad click-bait, but actually quite good. [1] [link] [2] [this video]
Makes the case for fewer integration tests than unit tests.
@mihaigalos Sep 2022 Recommends
on HN thread Fit: Framework for Integrated Test
I've tried FitNesse professionally. I think it comes short in many regards. To be clear, I think integrated/integration tests in their own only add value if you have a couple of them (meaning <5). Otherwise, they're red and no one knows why. And they take a whole lot of time to execute. JBRainsberger has an nice talk on them [1]. Pactflow have implemented a Contract/Collaboration framework called Pact [2]. I haven't used it professionally but I love the concept. [1] [this video] [2] [link]
Talk on why integration tests slow teams and fail opaquely.

Citations, criticism and jokes

@aszen Oct 2020 Cites it
on HN thread Prefer Fakes over Mocks
Read more
I have been researching into several testing approaches and so far in my experience yes fakes are better than mocks. But what is even better is not having to fake or mock stuff especially for testing business logic. One of the problems we get ourselves into is abstracting service io code into functions and calling them from our business logic code. This forces us to mock all the io calls, instead we should be doing the opposite i.e abstracting business logic into discrete functions of pure data in and out and then calling those functions from our io code. This way we can test the business logic independently of the io code. Testing the business logic now becomes quite simple and one can leverage property testing to further boost our confidence in such tests. Many times the ramaining io code is just calling other functions and doesn't need to be tested. Several other ideas that relate to this are hexagonal architecture, Domain Driver Design, clean architecture and functional core with an imperative shell. Some resources to further explore these ideas: Clean Architecture in Python - [link] Why integrated tests are a scam - [this video] Boundaries - [link]
Listed among resources on testing business logic without mocks.
@Ygg2 Jan 2023 Cites it
on HN thread Testing Without Mocks: A Pattern Language
I think the big issue is. Are you writing a lib or an app? In library you don't need to mock. Library is supposed to be agnostic. In app there are many layers. You kinda need to mock them all, otherwise your app can't be tested. And then you have the problem that minor changes turn your tests red. So mocking is most useful in the place it has almost no impact. [this video]
Linked as support for a view on mocking in apps.

Video list and Hacker News comment labels from HackerTube (prompted by @karpathy), released under ODC-By 1.0, built on the open-index/hacker-news archive. Hacker News data is provided by Y Combinator; comments remain the work of their authors. Video titles, channel names and thumbnails belong to their creators and are shown via YouTube. HackerTube Watch is an unofficial edition. Data export of 2026-10-31.

Keyboard shortcuts

/
Search
j k
Next / previous video
r
Surprise me
l
Like (video page)
w
Watch later (video page)
?
This help
Esc
Close