Παρασκευή, Απριλίου 01, 2005

Where are bugs coming from?

As I keep on testing (I use a rather complex application with 23 tables, multiple relationships and combinations with nested datasets) I found a rather odd bug: I promised (primarily myself) that there isn't any need to Refresh datasets, so that primary and foreign key values are in correct place. But, I ...failed! Something certainly wasn't on the right route. As a low self-respect person (referring to developing efficiency), I reviewed my code and indeed I found out some problems (mainly related to foreign keys having null values) and fixed them (or at least I think I did). But, the messing with nested dataset foreign key values remained! I got disappointed at this point.
Then a thought came by: try to reproduce the same problem using plain client datasets and Dataset providers. If the bug remained, that meant that this was a midas bug, not something wrong in my code. And it did. I formed a test case application and posted on QC# 11761 (I debugged into source code, but was not able to figure out where the problem occurs. Provider.pas seems to do all things correctly and returns all the propagated values in the right order. I believe the problem is somewhere in the implementation of Reconcile_MD in midas.dll).
Anyway, the generic question is how a developer reacts to bugs and where do they come from (my code or a bug in the code base- library I am using). My opinion is that it highly depends on developer character (arrogance, self-respect), capabilities and experience. In my case, it was more or less intuition driven from disappointment.