- Define Service Interfaces first
- Define a formal contract for the service interface
- Implement a Mock implementation with explicit known behaviour
The contract element is the trickiest, its something we've had a crack at with Obligate but that is just for Java and its early days, as there aren't any real approaches for that so 2 is currently an optional step for most projects. You do still get value from doing continual live.
This means that once you have defined all your services you are able to deploy the whole application to a server and run some system tests. Depending on how you set up the mock implementations these tests could all pass or all fail, most likely (if you've written decent tests) some will pass and others will fail. Assuming that you write decent tests this means that over time as services are implemented the number of failed cases is reduced. Because services are actually calling other services this means that the tests are more system test in nature rather than being unit test, this approach also means that as you start putting screens on the system you don't have to stub out calls that "haven't been implemented yet" you can write the code as required and demonstrate a running environment much earlier in a project.
Tools like cruise control and ant can be easily extended to support a continual live approach, the key change is that instead of just writing unit tests (which should continue, especially when you don't have contracts) you can also write system tests. If you are using a contract based environment then unit tests become less required and its actually the system tests that matter more, as the contracts will enforce the validity of operation of the service.
So basically, Continual Live is about getting a "running" system up as early as possible to help identify inter-service problems based on actual invocation and to track the evolution of the system. If combined with contracts it provides a pretty cheap way to build very robust systems and identify clearly who is causing the problems.
No comments:
Post a Comment