ATPG, short for automatic test pattern generation, is the software process that derives test patterns targeting specific modeled defects by working through a design's scan-accessible structure fault by fault. For each fault still undetected, the tool searches for a pattern that both activates the fault and propagates its effect to a point the tester can observe, then fault-simulates that pattern against the entire remaining fault list to credit every fault it incidentally also catches — repeating until achievable fault coverage plateaus or the remaining faults are judged impractical to detect. The resulting pattern set, together with the chip's scan chain structure, is what actually gets shifted through automatic test equipment during production test.