A test pattern generating apparatus includes an extractor configured to
extract a plurality of layout parameters (elements) of a circuit under
test based on gate net information and layout information of the circuit,
and to link the layout parameters (elements) with corresponding fault
models respectively. A weight calculator is configured to calculate a
weight for each fault model linked with the layout parameters (elements)
for both a plurality of undetected faults of the fault model and a
plurality of faults detected by a plurality of test patterns, based on
process failure (defect) information and layout parameter (element)
information. An automatic test pattern generator is configured to
generate the test patterns in accordance with the weight of each fault
model linked with the layout parameters (elements).