I am working on introducing tests to an old system. Because of the amound of technical debt, we have landed on component/interface testing.
The system is a servies of servers which sends messages in a custom format between each other. The idea is to create a framework where we can create a testcase to stimulate a server, then mock the messages that it sends to others servers and finally validating the respons on the original request.
My question, what is the best design for this? Due to restrictions, a little as possible code should be changes. I see two different approches. In process and out of process test framework
In process: Store testcases and test framework in a dll which is dynamically loaded by the server we want to test. A NetworkObserver needs to be created, which can forward information to the TestFramework
The design drawings are not amazing, but hopefully they make it easier to understand.
Things to consider:
The servers are multithreaded
There is a lot of db access
- I would like to run the same test cases in two modes. One for validating the internal and one where I validate the mock data against the actuall data returned by the other servcies. For this to work I need to set some spesific data on some of the servers which communicate with external systems.
- There are a lot of config files.
I would love some input on how to best handle this. Is there a 3rd way of doing this?