Agile, rule-based specification and testing of integration and mediation solutions.
Discipline through test-driven development in a low code environment.
Process-oriented, focused on requirements, documentation and testing.
This is a mock of our new upstream API, to order a product for a user, getting a JSON document back:
$mock order.product (product ?= "Email", user ?= "John") => (order = {
items:["Email", "Login"],
status:"Success"
})
Note that ?= means could be like. It's very useful in providing examples and test values...
Following best TDD practices, we'll test our API up-front, so it will always be correct - this way we provide maximum value to the other components using our API:
$send order.product (product = "Email", user="John")
$expect (order.status is "Success")
These tests will always keep our solution honest, throughout the entire development lifecycle and provide maximum value to clients.
We will now mock the expected downstream APIs that we'll integrate. Here is a smart mock which can simulate success and failure, depending on the user name:
$mock mailServer.create (what ?= "Email", user)
=> $if (user == "John@") (payload = {
status:"Fail"
})
=> $if (user != "John@") (payload = {
status:"Success"
})
Note that a username containing @ will result in a failure.
We will keep the downstream systems honest by continuously testing their API, to make sure it always behaves as we expected, either mocks or full implementation! Ensure that no future updates will break this promise and impact our behavior! Catch any mistakes they make before spending time debugging some results of ours...
$send mailServer.create (what = "Email", user="John")
$expect (payload.status is "Success")
$send mailServer.create (what = "Email", user = "John@")
$expect (payload.status is "Fail")
These tests can run on a schedule or on demand and alert when they fail.
The final step is to implement the actual flows, from the new upstream to the downstream. This is what your system would do... this is when you would get busy developing code... or you can wire it here:
$when order.product (product == "Email", user)
=> mailServer.create (what="Email", user)
=> (order = {
items:["Email", "Login"],
status:payload.status
})
The rules engine is a fast and rules-based reactive message processor, using a modern cloud-native messaging infrastructure (akka), scalable and fault-tolerant, which is suitable for a range of services. Read more at DOM Engine
At this point, we have the upstream and downstream APIs defined and mocked. All three teams can start/continue development (client, implementation and providers). Throughout the development, the contracts defined here will keep all the teams honest - any bugs will be caught asap.