21.08.2013 Views

Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SELF-TEST QUESTION<br />

17.1 Categorize the following eventualities:<br />

17.2 ● Fault detection by software<br />

17.2 Fault detection by software 239<br />

Clearly, the difference between anticipated and unanticipated faults is a rather arbitrary<br />

distinction. A better terminology might be the words “exceptional circumstances”<br />

and “catastrophic failures”. Whatever jargon we use, we shall see that the two<br />

categories of failure are best dealt with by two different mechanisms.<br />

Having identified the different types of faults, let us now look at what has to be done<br />

when a fault occurs. In general, we have to do some or all of the following:<br />

■ detect that a fault has occurred<br />

■ assess the extent of the damage that has been caused<br />

■ repair the damage<br />

■ treat the cause of the fault.<br />

As we shall see, different mechanisms deal with these tasks in different ways.<br />

How serious a problem may become depends on the type of the computer application.<br />

For example power failure may not be serious (though annoying) to the user of a<br />

personal computer. But a power failure in a safety critical system is serious.<br />

Faults can be prevented and detected during software development using the following<br />

techniques:<br />

■ good design<br />

1. the system stack (used to hold temporary variables and method<br />

return addresses) overflows<br />

2. the system heap (used to store dynamic objects and data structures)<br />

overflows<br />

3. a program tries to refer to an object using the null pointer (a pointer<br />

that points to no object)<br />

4. the computer power fails<br />

5. the user types a URL that does not obey the rules <strong>for</strong> valid URLs.<br />

■ using structured walkthroughs<br />

■ employing a compiler with good compile-time checking<br />

■ testing systematically<br />

■ run-time checking.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!