lecture-13-lint

lecture-13-lint - same model of the shared memory...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Inspection Check Inspection Checks Fault class Inspection check Data faults Are all program variables initialised before their values d? are used? Have all constants been named? Should the lower bound of arrays be 0, 1, or something else? Should the upper bound of arrays be equal to the size of the array or Size -1? If character strings are used, is a delimiter explicitly assigned? Control faults For each conditional statement, is the condition correct? Is each loop certain to terminate? Are compound statements correctly bracketed? In case statements, are all possible cases accounted for? Input/output faults Are all input variables used? Are all output variables assigned a value before they are output? Interface faults Do all function and procedure calls have the correct number of parameters number of parameters? Do formal and actual parameter types match? Are the parameters in the right order? If components access shared memory, do they have the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: same model of the shared memory structure? Storage management If a linked structure is modified, have all links been faults correctly reassigned? If dynamic storage is used, has space been allocated correctly? Is space explicitly de-allocated after it is no longer required? E ception Ha e all possible error conditions been taken int Exception management faults Have all possible error conditions been taken into account? Sample C Program const space = ' '; const endString = '\0'; removeSpace(char s){ int i = 0; int j; if (NULL != s) { do{ if (s[i] == space){ while (s[i+1] == space){ for (j = i; s[j] != endString; j++){ s[j] = s[j+1]; s[j] s[j+1]; } } } } while(s[i++] != endString); } } main(){ char *s1 = (char *)malloc(40); strcpy(s1, "this is a test"); printf("%s%c", s1, '\n'); printf("%s", "Running the space removal.\n"); removeSpace(s1); printf("%s%c", s1, '\n'); }...
View Full Document

This note was uploaded on 10/21/2011 for the course CSCI 5802 taught by Professor Heimdahl,m during the Spring '08 term at Minnesota.

Page1 / 2

lecture-13-lint - same model of the shared memory...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online