685 reputation
1710
bio website
location
age
visits member for 3 years, 8 months
seen Mar 26 at 17:59

Apr
29
awarded  Yearling
Mar
26
comment From a TDD perspective, am I a bad person if I test against a live endpoint instead of a mock?
Thank you -- I'll look into that.
Mar
25
awarded  Commentator
Mar
25
accepted From a TDD perspective, am I a bad person if I test against a live endpoint instead of a mock?
Mar
25
comment From a TDD perspective, am I a bad person if I test against a live endpoint instead of a mock?
But I agree on your main point, that one shouldn't write mocks for classes they don't own. And definitely agree there's no point in writing a mock test that tests the same thing as an integration test. It would seem mocks are best for testing interfaces/contracts. Thanks for the advice -- this has helped me a lot!
Mar
25
comment From a TDD perspective, am I a bad person if I test against a live endpoint instead of a mock?
I suppose I could create a nice, friendly wrapper class for HTable that took care of all that housekeeping, but at that point ... I feel like I'm kinda building a framework around HTable, and should that really be my job? Usually "Let's build a framework!" is a sign I'm going in the wrong direction. I could spend days writing classes to make HBase more friendly, and I don't know if that's a great use of my time. Plus, then I'm paasing around an interface or wrapper instead of just the plain old HTable object, and that would definitely make my code more complex.
Mar
25
comment From a TDD perspective, am I a bad person if I test against a live endpoint instead of a mock?
I agree with most of your answer. However, I'm not sure I agree about the Adapter part. HTable is a pain to mock because it's fairly bare-metal. For example, if you want to do a batch get operation, you must create a bunch of Get objects, put them in a list, then call HTable.batch(). From a mocking perspective, this is a serious pain, because you have to create a custom Matcher that examines the list of get objects you pass to HTable.batch() and then returns the correct results for that list of get() objects. A SERIOUS pain.
Mar
20
awarded  Nice Question
Mar
20
awarded  Favorite Question
Mar
18
asked From a TDD perspective, am I a bad person if I test against a live endpoint instead of a mock?
Mar
11
awarded  Notable Question
Aug
8
awarded  Popular Question
Apr
29
awarded  Yearling
Dec
26
awarded  Famous Question
Oct
14
awarded  Popular Question
Jun
15
awarded  Good Question
Jun
11
awarded  Notable Question
Apr
29
awarded  Yearling
Feb
3
awarded  Popular Question
Jul
22
comment What are some best practices for populating and using a test database?
Okay, thanks! I'm going to continue looking into this. Any other tips for using DBUnit?