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

Chapter 4

  1. A stub satisfies a particular interface and returns canned answers for every invocation to the methods it implements. Mocks allow us to specify the following in a declarative way:
    • The order and parameters of the expected set of method invocations
    • The set of values to be returned for each combination of inputs
  1. A fake object provides a fully working implementation whose behavior matches the objects that they are meant to substitute. For example, instead of having our tests communicate with a real key-value (KV) store, we might inject a fake object that provides a compatible, in-memory implementation of the KV store's API.
  2. A table-driven test consists of three main components:
    • A type that encapsulates the parameters for running ...
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