In my team, we are about to start the reimplement of a service. One of the important steps to do to accomplish this is how do we ensure that we are doing it in the right way and  we are not introducing new bugs.So, what we have in mind is create a bunch of test to verify the following:The behavior. Both services should behave the same way (store data in the same places, send same, notificacions, etc...)Results. Object returned by the service's calls should be exactly the same.So, the things that we have thought is to do the following:Create a set of test that verifies the behavior and results of old service.Create the new service adding unit test, and whitebox integration test for the new serviceCreate some kind of Mirror test that checks if the new service is working as the old one. Is there a way to do this?Thanks for any help.Note: None of the code of the previous version is reusable. There is no test for the older version of the service[Edited]replaced original word migrate with reimplement
Best way to test a reimplemented web service
testing;web services
Well, after diving deep in this, we have two possible solutions:Replay prod data: It will be kinda complicated to do it, but the good thing is that if you can capture and replay prod data against your service, then all whitebox integration test will be done for you. the bad thing is that you are just testing the inputs and outputs and not how the data is changed by the service.A different approach is the following: Apply factory pattern for both service's clients, the old one and the new one, then create a test for the old service (here you want to check result objects and data changes), migrate the service, test your new service against the test of the old one.