7

TFW the mock class has way more code than the real one.
Testing big infrastructures can be a pain...
Or maybe my team is just not so good at it.

My time spent:
Adding new feature to the real class 15%
Extending the mock with the same feature 55%
Writing tests 30%

Comments
  • 2
    It's not uncommon.
  • 0
    Another case against the 100% code coverage mantra/religion.
  • 0
    Awsome. Shipping Mocks to clients now?
  • 0
    If tests get obese, that is a sure sign for the tested thing having too much complexity.

    And some things are better tested without mockup classes on a test system running the entire beast.
  • 0
    @Oktokolo Distributed stuff with lost of async calls, we have to mock to test most cases reliably.
  • 0
    @RemusWasTaken
    Distributed systems are best tested as such.
    That may or may not need lots of virtual machines or containers replicating the real thing as much as possible...
  • 0
    @Oktokolo We have lots of those too.
    But it's really hard to reliably test (failure) cases where things have to happen in a specific order for an edge case to appear.
    So you ned to be able to control all of the timings which you cannot do with the real thing.
Add Comment