Mathematical Problems in Engineering / 2013 / Article / Tab 1

Research Article

Metamorphic Testing Integer Overflow Faults of Mission Critical Program: A Case Study

Table 1

Examples of four types of integer overflow.

An overflow integer defectAn underflow integer defect

(1) int i;(1) int i;
(2) unsigned int j;(2) unsigned int j;
(3) i = INT_MAX; //2147483647(3) i = INT_MIN; //−2147483648
(4) i++;(4) i− −;
(5) printf (“i = %d n” , i); /*i = −2147483648*/(5) printf (“i = %d n  , i); /*i = 2147483647*/
(6) j= UINT_MAX; //4294967295(6) j = 0;
(7) j++;(7) j− −;
(8) printf (“j = %u n  , j); /*j = 0*/(8) printf (“j = %u n”,  j); /*j= 4294967295*/

A signedness integer defectA truncation integer defect

(1) int i = −3;(1) unsigned short int u = 32768;
(2) unsigned short u;(2) short int i;
(3) u = i;(3) i = u;
(4) printf (“u = %hun  , u); /*u = 65533*/(4) printf (“i = %d n”, i); /*i = −32768*/
(5) u = 65535;
(6) i = u;
(7) printf (“i = %d n”, i); /*i = −1*/

Article of the Year Award: Outstanding research contributions of 2020, as selected by our Chief Editors. Read the winning articles.