4 ms·
Its also great at validating data! We're running some of our specs in production to enforce guarantees on data coming in and out of the app :)
by jeremiep 9y ago
Its also great at validating data!
We're running some of our specs in production to enforce guarantees on data coming in and out of the app :)
- misterbowfinger 9y agoYup, specs can be used at runtime as well. Very helpful to validate data, or perhaps a set of business rules. Insures the spec you use to test is the same logic you use at runtime.
- always_good 9y ago>specs can be used at runtime as well. What do you mean "as well"? I thought it was only a runtime check at all.
- simongray 9y agoOne of the stated goals of spec is generative testing. While technically runtime, it's is not runtime from the user's point of view.
- ambulancechaser 9y agoi think they're talking about production run time versus development runtime. think of it as turning asserts off on production builds. but spec can conform data and explain the reason for non-conformance so some might leave some spec in production for logging, messages, etc.
- misterbowfinger 9y ago^^ this, using spec at run time in your actual application logic