Share to: share facebook share twitter share wa share telegram print page

Test stub

A test stub is a test double that provides static values to the software under test.

A test stub provides canned answers to calls made during the test, usually not responding at all to anything outside what's programmed in for the test.[1]

A stub may be coded by hand, generated via a tool or be created as a dedicated part of a larger system such as a stub server or service.

Stubs differ from mock objects, which assert and verify interactions. Stubs only supply data.[2][3]

See also

References

  1. ^ Fowler, Martin (2007), Mocks Aren't Stubs (Online)
  2. ^ Freeman, Steve; Pryce, Nat (2009). Growing Object-Oriented Software, Guided by Tests. Addison-Wesley. ISBN 978-0321503626.
  3. ^ Fowler, Martin. "Mocks Aren't Stubs". martinfowler.com. Retrieved 2025-09-17.


Prefix: a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9

Portal di Ensiklopedia Dunia

Kembali kehalaman sebelumnya