A minimal implementation of a software component that provides predetermined responses to method calls during testing. Stubs replace real dependencies with simplified versions that return fixed values.
From Old English 'stybb' meaning tree stump or short projecting part. In computing, it was first used in the 1960s for placeholder code segments, emphasizing the 'cut-off' or minimal nature - like a tree stump that shows where a full tree once stood.
A stub is like a cardboard cutout of a celebrity at a photo booth - it looks like the real thing from the front and serves its purpose for photos, but there's nothing behind it. Stubs give your tests the answers they need without any of the complexity, making tests fast and predictable!
Complete word intelligence in one call. Free tier — 50 lookups/day.