A non-transitory computer readable medium having stored thereon, a set of computer-executable instructions for causing the computer to perform steps comprising:
- dividing a level difference, which indicates a level difference distribution on a surface of a semiconductor device, into two or more unit level differences in depthwise direction of the level difference;
- generating a contour line diagram of the level difference for each of the two or more unit level differences based on position coordinates acquired for each of the two or more unit level differences;
- determining, for each of the divided two or more unit level differences, a relationship between the height of each of the divided two or more unit level differences, from a predetermined position of the level difference, and a corresponding area of an opening surrounded by a contour line, formed using each of the divided two or more unit level differences in the generated contour line diagram,
- wherein the relationship is a value obtained by computing a difference between heights of two consecutive unit level differences divided by a difference between square roots of corresponding areas of opening surrounded by the contour lines;
- and
- deciding presence or absence of the defective portion on the surface of the semiconductor device based on comparison of the computed value against a predetermined threshold value.