On Wed, Nov 13, 2013 at 10:39 AM, Ron Wheeler < [email protected]> wrote:
> On 13/11/2013 11:16 AM, Matthew Adams wrote: > >> I don't think timing should be the heuristic here. The fact that unit >> tests take less is a result of the fact that what you're testing, aka the >> "unit", tends to be small. After all, a unit test should test a "unit". >> > So what is your definition? > "A unit test is test code that tests a unit in isolation." It's intentionally ambiguous, because a unit is relative and may differ. > >> An integration test, then, if I were defining it strictly, would be >> anything that's not a unit test. In practice, this usually means >> replacing >> any mocks and/or stubs in your unit tests with the real implementations, >> plus using any other supporting infrastructure, like databases, dependency >> injection contexts, etc. >> > Not sure that this is true for all integration tests. You may be able to > test the integration of two projects (a web service and a database access > layer) while still using mocks and stubs (mock of a database persistence > layer). > People frequently test with Jetty when the final project will run on > Tomcat. > It all depends on what part of the system integration is being tested. > I didn't say it had to be what's used in production. The key difference is that you're using _something_, in addition to the unit. -matthew
