I have forgotten the term for a class that provides pre-canned objects for use as test data.

e.g. If I'm testing a payment module and I need credit card objects of different types, I might have a class in my test scope called CreditCard__something__ with static members or factory methods for creating cards of different flavours.

What is this term?

  • Collections of pre-created objects for testing purposes are variously called stubs, fakes and mocks (depending on their specific use). Dec 19, 2014 at 6:07
  • None of those terms mean what I have described. In particular, none of them are a repository of (or factory for) instances of domain objects.
    – Synesso
    Dec 19, 2014 at 7:04

1 Answer 1



The setUp and tearDown methods are for creating or cleaning up your fixtures. If they live in memory, cleanup is easy, but if your fixtures live in the database, then both setting them up and tearing them down can be a little more involved.

  • 1
    Thanks. I busted my brain for several hours and finally remembered. Glad you have confirmed it for me. Cheers!
    – Synesso
    Dec 19, 2014 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.