testing - Providing a third party with testable web services -
the applications follows, seen point of view:
the application making (lets call app1), , 2 third parties, app2 , app3.
- app2: wants consume simplified web services app1
- app1: i'm at. services app3 handled nicely here already, nice, clean internal api easy usage.
- app3: third party service provider. complex services. important point: has no test environment, ever against done production data (although separate test account). if screw here, things happen real people in real world. lack of real test environment not in control.
app3 provides application, app1, web services. app2 wants me "forward" services in simpler manner, don't have reimplement complexities i've handled. app2, consuming web services, needs have testable version of services use while implementing side, handle different use cases themselves.
how can implemented smooth possible?
internally, relevant parts of existing application looks this:
- presentation + web services (web application + small web api, , web service)
- service facades services below (providing clean api services app3 provide)
- services (parsing, mapping, logging, diagnostics soap calls app3) - sortof "data tier"
the web service fine, , talking directly service facades. leave app2 production data test services against (and service can't tested on production data, it's harsh write operation). tell ioc-container use separate implementation of relevant service facade when, example, given config parameter set. however, since i'm going "forward" limited subset of these services, leave rest of application using service facade unusable on our test environment, not thing - other stuff needs tested (even against production data).
i'm thinking introducing tier between presentation/web service tier , service facades, web service use. let ioc container dish test version of when deploying test environment.
good things it:
- it lets me put provided web services third parties consume in testable state seen outside, can if-else different stuff internally simulate different use-cases.
- it enables rest of application stay as-is, using actual production services app3 necessary elsewhere testing.
- will make both testable , "real deal" versions of new tier unit testable
bad things:
- creating layer of seemingly unnecessary complexity that's not really giving application anything
- requiring mechanism turning on/off test mode (= more junk code/config)
- junk-like code people might mistake being prototyping year or 2 later, trying rid of it
am thinking right thing, or there other (noticably) different solutions this?
- send in separate parameter enable test mode? seems risky , far more work on side.
app2 [...] needs have testable version of services use while implementing side, handle different use cases themselves
it's not clear want test here.
if mean testing app2
plays app1
, tend consider it's not third party component's job make "testable" - it's consumer component should test communication 3d party , verify if can handle results.
in app2
, create proxy app1
's services. in unit tests, can stub proxy's methods return canned test data. these data can more or less close production data depending on scenarios want cover. create integration tests between proxy , real services verify runs smoothly.
Comments
Post a Comment