Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Mocks, stubs, fakes, and spies – commonalities and differences

Before digging deeper into the concepts behind unit testing, we need to discuss and disambiguate some of the terms that we will be using in the upcoming sections. While these terms have been out there for years, software engineers tend to occasionally conflate them when writing tests. A great example of such confusion becomes evident when you hear engineers use the terms mock and stub interchangeably.

To establish some common ground for a fruitful discussion and to clear any confusion around this terminology, let's examine the definition of each term, as outlined by Gerard Meszaros [5] in his XUnit Test Patterns: Refactoring Test Code book on test patterns.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content