In collectively and electrically erase a plurality of memory cells, to set the threshold values of the memory cells constant, electrons are previously stored in the floating gates of the memory cells (M11-Mlm) (S1). The memory cells whose floating gates are accumulated with electrons are electrically erased and the threshold value of each erased memory cell is checked. The collective erasing of the memory cells is repeated until the threshold values of all the memory cells become equal to or below a first value (VEV) (S2-S9). When it is detected that the threshold values of the memory cells become equal to or below the first value (VEV), it is discriminated if those threshold values are equal to or above a second value (VTN(E)min) smaller than the first value (S10-S15).; When there is a memory cell whose threshold value is equal to or below a minimum value (VTN(E)min) allowable on the design base in the previous discrimination step, that memory cell is over-erased and the memory chip containing the memory cell is determined as a defect (S12).