The Case against NULL
One of the more polarizing issues in the database community is whether having NULL as a valid entry is a Good Thing, or a Bad Thing. I am quite firmly in the Bad Thing camp.
Why? Simply, because the convenience achieved on the development side of things is way overshadowed by the decrease in Quality of data. There is an entire chapter in about this issue, but I’ll try to summarize from memory.
The whole argument comes down to What is NULL? Consider a fictitious table which stores information about a customer. Now suppose one column is Middle_Initial which could be 1 character long, or NULL. If there is a character, then things are hunky-dory, however, things get interesting if the value is NULL. Does this record belong to someone who does not have a middle name, or is it unknown? While this is a very simplistic example of how NULL can have multiple meanings, it applies to pretty much every field. A much better set of values would be NOT_APPLICABLE is the person did not have a middle name and UNKNOWN if we were unsure of the value. A query could then be generated to return all the records with UNKNOWN values and correct them. Another example that the Data Quality mentions is the input of data from manual forms. Not everyone’s handwriting is legible, so you might need another value along the lines of UNREADABLE.
Most people will agree, that knowing what your data is supposed to be representing is a great idea, but this brings us to the point of ideological deviation. Doing this is Hard. Instead of having “if not NULL”, developers now need to check all the appropriate values in their code and do the right thing accordingly. Not only that, but they need to keep their data dictionaries accurate so that the other in the programming ecosystem can play nicely with them.
So what are we testers to do? Continue the crusade of course. When invited to design reviews (as you should be), question the logic of having NULL as an acceptable value. Ask enough of these, and Product Management might get enough of the willies to cut down the usage of NULL.