I'm fully aware of what you say. And you are right, these ones are not unit
tests, I didn't mention the word on purpose. I always strive for unit
tests, but in this case they need to be integration tests and have to hit
many external resources. It also allowed to find bugs in those external
resources.

I'm also using mockolate, not as powerful as i'd like, but it's also the
fault of not having better reflection, proxies, etc I guess.

2015年8月30日日曜日、Justin Mclean<[email protected]>さんは書きました:

> Hi,
>
> > I know about test suites, but it's not exactly what I'm looking for, I'm
> > talking about reusing logic in several tests
>
> Sounds to me like your tests are more integration test than unit tests. If
> you’ve not read "Working Effectively with Legacy Code” by Michael Feathers
> you might want to take a look.
>
> In it he says "A unit test that takes 1/10th of a second to run is a slow
> unit test.” so any test that touches a database or makes a HTTP call is
> probably not a unit test. That being said it's better to have tests than no
> tests at all. I’d try an aim for a 80% / 20% rule re integration vs unit
> test.
>
> Also look into Mocks they will make you’re life easier and your tests
> faster.
>
> Thanks,
> Justin
>

Reply via email to