J
jehugaleahsa
Hello:
When we write our applications, we write them in distinct layers.
Because each layer is tested individually and can be used by many
other code sets, we have been implementing argument checking at every
layer.
However, this just seems like more tests that we have to write. I know
that most of the time the arguments will be valid because they are
sent in by other layers that have also been tested. Some times the
next layer above won't do anything with the arguments at all except
pass them to the next layer down.
So, the question is, do we keep writing checks at every level or do we
use a different approach? Is there a standard for this type of thing
where you work?
Some times I feel like throwing argument checks in at all layers since
I know that they cost relatively nothing. This would at least keep
things consistent at all layers of the system. Plus, each layer being
so reusable, it might be the "safest" alternative. However, the
thought of writing all those tests and all that code to perform a
check I can almost 100% of the time guaruntee will never be hit is
hard to stomach.
When we write our applications, we write them in distinct layers.
Because each layer is tested individually and can be used by many
other code sets, we have been implementing argument checking at every
layer.
However, this just seems like more tests that we have to write. I know
that most of the time the arguments will be valid because they are
sent in by other layers that have also been tested. Some times the
next layer above won't do anything with the arguments at all except
pass them to the next layer down.
So, the question is, do we keep writing checks at every level or do we
use a different approach? Is there a standard for this type of thing
where you work?
Some times I feel like throwing argument checks in at all layers since
I know that they cost relatively nothing. This would at least keep
things consistent at all layers of the system. Plus, each layer being
so reusable, it might be the "safest" alternative. However, the
thought of writing all those tests and all that code to perform a
check I can almost 100% of the time guaruntee will never be hit is
hard to stomach.