In my last entry about testing, I mentioned that Andy's presentation got me rolling on testing everything that goes wrong from day to day even if it has nothing to do with actual code being written; ala testing your environment. Today we have part 2.
Through a series of data tubes, I must receive data from sources beyond my control. These sources sometimes don't have the kind of keys, indexes or data integrity that I would like it to have. Sometimes, that's how things just are.
In one such case this week, a list of names from a table should have one and only one entry per unique name, but duplicates were allowed to exist. This caused data imports to go boom.
So, in order to be notified of such data problems, I now have a test that checks the data feed for duplicate names.
For those keeping score, that's:
Two tests ensure that I never have to deal with investigating or identifying these problems again.