Automatically generate Unit Tests wrapping your HTTP REST Web API
Every bug that exists was created by a developer writing code. Eliminating the ability to write code, will eliminate all bugs in your systems
Join the DZone community and get the full member experience.Join For Free
I am an "automation fundamentalist". What I mean by that, is that I will go through large amounts of pain to avoid having to manually type code if I am able to have my computer do it automatically for me. The reasons are fairly self evident, because all bugs originates from a human being having written code at some point in time. Hence, if I can completely avoid manually writing code, the argument is that I can create 100% perfect software systems, that won't even in theory be allowed to contain bugs of any kind. This idea extends to writing Unit Tests too.
Therefor, I created the ability to automatically generate Unit Tests in Magic. To understand how, watch the following video, where I demonstrate how I invoke an HTTP REST endpoint, for then to persist the invocation, allowing me to "replay" it later. The idea of course, is that being able to replay an HTTP invocation, can help me sanity check my system further down the road, as I modify it for whatever reasons I have to modify it.
This of course has huge advantages, even though they're technically not Unit Tests, but more like integration tests - Allowing me to create "self diagnostic software systems", where I could for instance have my assumptions execute on a daily basis, triggering an email if one of them fail for some reasons, creating the ability to monitor my system over time, as it exists in my production environment.
In fact, creating 100% perfectly valid software systems, that can't even in theory contain bugs, is actually quite simple using this method - Since all bugs originates from software developers manually writing code. Hence ...
No coding, no bugs, no problem!
Download Magic below if you want to play around with it, and of course the idea easily extends into your own software systems, and also non-Magic based applications, where you could for instance create and persist Postman invocations towards your own Web APIs, and execute these as a batch to sanity check your API. Just make sure your sanity checks doesn't DOS attack your production environment please. After all, we do this to create better systems, and not destroy our existing systems. You can find Magic by following the link below.
Opinions expressed by DZone contributors are their own.