0

I am working on CloudGen Automated Test Engine. For testing concepts, I would like to know what is difference between Service Level Unit Testing & End to End Testing?

Thanks.

Aqdas
  • 868
  • 4
  • 16
  • 57
  • A unit test, tests a single unit. Anything that the "unit" currently "news up" save model objects, need to have their concrete dependencies removed and replaced with abstractions which are then mocked/stubbed/faked in order to accomplish a "true unit test". End to end/integration testing is testing behavior with actual implementations from top to bottom. – Kritner Oct 12 '16 at 11:45

1 Answers1

2

For me a service level unit test is executing the business logic of a service (micro?) without external dependencies (they are mocked). End to end is executing the entire service (with protocols like http involved) in a more use-case fashion. Fowler has some thought regarding this: http://martinfowler.com/articles/microservice-testing/#anatomy-modules

Jocke
  • 2,189
  • 1
  • 16
  • 24
  • Thanks for the reply. Can you please elaborate "Without external dependencies". – Aqdas Oct 11 '16 at 19:53
  • it means that if the service consumes a different (external) service, in the unit testing scenario the latter will be mocked (return some preset dummy values instead of actually calling the service) so that you only test a unit, and not depend on all the dependencies working properly (that's what end to end testing is for) – Alexandru Marculescu Oct 12 '16 at 06:18
  • I am confused because of one thing, being a developer, we mostly write unit tests using different test projects which resides within same solutions. Now, if there is a rest api and client asks to perform service level unit testing then how i will start this? if i create a new project as client and consume that rest api and perform automation then i guess it will be end to end testing but not service level unit testing. so how i can perform service level unit testing by consuming service? I am beginner in this so apology if i asked something that don't make sense. – Aqdas Oct 12 '16 at 13:38
  • You are correct, that would be service level (integration) testing, in order to make unit test you will need access to the source code of the service – Jocke May 17 '18 at 05:59