What's the difference between data Validation and Verification? [closed]

眉间皱痕 提交于 2019-12-05 08:38:09

Ok, so I'll take this as an open invitation to musing...

I think the difference is very much like compile-time vs. runtime errors. Just like the compiler is able to tell that two variables a,b are of type double, and thus the expression a/b is valid, it is only during runtime a DivideByZeroException may be raised if b turns out to be 0.

So to complete the analogy, one can validate that a string looks like a credit card number ('compile time'), but can only verify that it corresponds to a valid card only if one tries to charge the credit card ('runtime') with an amount

Duh. So I guess I understand it pretty much like you old company does.

In my vocabulary, validation is checking whether the format of the data is correct, IE if a you're actually dealing with a correctly formatted date string . Verification is checking whether the date you got is actually the date you were expecting.

in terms of programming it makes no difference what you call it (validation or verification) but where you put the logic is important. usually all three rules you mentioned are known to be validations with first two points corresponding to UI validation and last point to business rule validation. we usually validate UI fields using dataannotations in our controller and Business rule validation is performed within business layer. But the bottom line from software point of view is; don't do an operation (save, edit) unless data is good (you call it valid or verified).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!