Timeline for Do I need unit test if I already have integration test?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 6, 2021 at 21:14 | comment | added | Ross Patterson | @Daniel "Your last bullet point seems to contradict the argument you're making. In this bullet point you're making the case against writing unnecessary mocks, which is an argument against writing unit tests for parts that are already covered by integration tests. The thrust of your argument, however, is in favour of writing unit tests for parts that are already covered by integration tests." No, I'm saying that mocks are a cost, and they need to be weighed against the benefits of testing. TANSTAAFL :-) | |
| Apr 24, 2019 at 22:13 | comment | added | Daniel | Your last bullet point seems to contradict the argument you're making. In this bullet point you're making the case against writing unnecessary mocks, which is an argument against writing unit tests for parts that are already covered by integration tests. The thrust of your argument, however, is in favour of writing unit tests for parts that are already covered by integration tests. Could you please clarify your intent here @RossPatterson ? | |
| Apr 11, 2017 at 20:51 | history | edited | Matthew Flynn | CC BY-SA 3.0 | It's |
| Jul 6, 2015 at 21:57 | comment | added | Rogério | I started writing automated developer tests (unit and integration, but mostly the latter) back in 2004 or 2005, and developed an advanced mocking library for Java. Many times I saw multiple integration tests breaking for the same reason (like a change in the DB, or a network change), and I sometimes write "lower-level" integration tests for reusable components, but still, I much prefer to only have integration tests. Isolated unit tests with mocking, most of the time, are just not worth it; I apply mocking only as an aid for the integration tests. | |
| Feb 6, 2015 at 15:00 | history | edited | Ross Patterson | CC BY-SA 3.0 | deleted 1 character in body |
| Feb 6, 2015 at 3:19 | comment | added | Ross Patterson | As an aside, that "10 years and 6,000 unit tests" are numbers from personal experience, not hyperbole. | |
| Apr 5, 2014 at 12:19 | comment | added | Ross Patterson | @Dogweather Mocks work well when first created. As time passes and the real object is changed, the mocks have to change with it. 10 years and 6,000 unit tests down the road, it's very difficult to know that your "successful" tests are really successful. | |
| Apr 4, 2014 at 22:15 | comment | added | Dogweather | Isn't mocking cheaper in real-world cases? You're only setting up expectations of what messages the mock receives and specifying what it will return. | |
| Jul 15, 2013 at 8:46 | vote | accept | Bryan Chen | ||
| Jul 14, 2013 at 13:22 | history | answered | Ross Patterson | CC BY-SA 3.0 |