After you've written a complex query or stored procedure, how do you verify that the results are 100% accurate, and assure yourself that this will be the case for all input parameters?
My personal approach is to test, test, and test all the way through development - checking that NULLs do not appear where I don't expect them to, that rows do not get dropped or doubled-up, and then having completed the query I would perform 'an amount' of testing by taking random records from the resultset and then verify that these are as expected.