tags:

views:

43

answers:

1

Let say I have written a small program that reads file_A and file_B as input data of test_case_A and test_case_B, passes the input to component_X which needs to be test, then verifies result against predefined expectation. That component_X could be in the same process, or different process on another machine.

I try to learn more about testing, but confused by various terms. Take above scenario as example, which of them is fixture/mock/harness/stub? Thanks.

+1  A: 

The thing you are testing plus the sample data plus the mocked objects is the "fixture". The entire business is a fixture for testing a component. In the old days we called this a "harness"

The things the fixture requires that you are not testing are "mocks" or "stubs".

S.Lott
Mind to elaborate within above example's context? i.e. mock is component_X; stub is ..., etc
shiouming
Umm. I can't elaborate any more. Do you need me to repeat the question? Do you want me to repeat that the thing you are testing "component_X" is the fixture? I can repeat that if it helps. You provided no mocks in question, so I can't repeat that. Do you want me to repeat that your tests are tests? What more could you possibly want?
S.Lott
I'm able to find some explanations for those terms over the Internet, but some of the explanations vary from another. I believe I should be able to get a more credible answer here in contrast with from most other Internet resources. Thanks :)
shiouming
@shiouming: I'm still not clear on what you want. "some of the explanations vary from another" is a natural consequence of people thinking about hard problems. This is not some miraculous revelation direct from the mouth of God to the ears of mankind, heard the same everywhere. This is not abstract mathematics, perfect and complete with a proof system. What do you want?
S.Lott