I would like to start a discussion thread on the topic of error
handling:
Suppose you have just developed the first draft of your SW which only
handles nominal cases.
Suppose you are about to make the application more robust by going
over your code again and
modify it in order to:
- analyse
- detect
- handle
- report
- prevent
- recover
- reproduce
- debug
errors/anomalies/faults which can be caused by:
- system failure
- bad user input
- programming failures
- bad design
- unexpected input data
- ...
I'm interested in learning about your a litle breakdown to get the discussion started: some topics: ...
tips/tricks/code-samples/strategies/methodologies/views/guidelines/tools/do
that can help software engineers in building more robust SW.
These can cover the fases: debug-mode, code-instrumentation,
applications in use by users
for whatever type of application: GUI, commandline,
multi/single-threaded, OO, servers, device drivers, communication, ...
------------------------------------------------
analysis: methods to find anomalies by analysing your code,
error-propagation, ...
detection: choosing function return-values, pre-/post-validation,
..
handling: error-codes vs exceptions, handling exceptions at low or
high level, just reporting or fixing the problem, maintaing code
integrity
reporting: messages on screen, in logfiles, sending eventmessages,
..
preventing: is it possible to prevent errors and if so, how ...
recovering: are there any techniques for recovering from errors,...
reproducing: techniques in reproducing reported anomalies for
debug-purposes,...
debugging: techniques that can help in debugging,...
------------
what can go wrong with casting
memory-leaks
bounds
mathematical overflow/underflow
rounding errors
stack problems