Saturday, July 11, 2020

Data Entropy, Part 5 -- Murphy is a user. If he can do it, he will.

Early in my career, I was developing an application where the workflow and data entry was straightforward (or so I thought).  However, a few days after I submitted the work to our test team, they came back with a number of issues.  As they described the steps that caused the problems, I realized they weren't following the workflow that we had defined.  When I asked why they did what they did, the lead tester responded, "Because we can."  Which opened my eyes to a stark reality.  If users can do something, they will do it and that includes entering bad data.  This is why we need constraints and we need to enforce them.

Constraints are gateways that protect your data from errors.  Don't side step them.  Often, I see pick lists that allow additions whenever a user can't find the value she searches.  If users can add any value, then the foreign key you defined on the column isn't really being enforced.  If possible use smart searches that look for variations on the way people input values.

You're a user too!
It's very tempting (and sometimes justified) to disable constraints for data loads.  By all means, consider the performance hit you would take.  But, for goodness sake, please validate the data before and after you perform the load to make sure your constraints are enforced.