It is seen that inspite of capturing lot of requirements and coding meticulously, the code which we wrote is bound to some kind of core dumping at certain point of time if it is part of large application / system.
Many of the analysis of the core dumps through debugger always point to something which was totally unexpected while coding, some kind of input which is not expected and not taken care.
In a large application, it will be very difficult to ensure that all the methods / functions behave properly and gives you the right return everytime for the next functions / methods which is a very much ideal / perfect situation.
One way of encountering it is to make your method takes care of such unexpected inputs which is like conquering the hell to make heaven safe because you never know what hell can be of. I feel this is very difficult or next to impossible in a large system.
So, the next easier way of dealing with the same problem is to check your input before you processed or passed to your methods / functions. This will ensure that atleast your code don't dump because somebody feeds you something wrong. It is simple logic GIGO (Garbage In and Garbage Out). Check the input reject it if it garbage / unwanted to your code. I think this will resolve as much as more than 90% of your core dumps provided you code it as expected with your sets of input.
Thursday, June 25, 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment