In the XJTAG application note “Working with configured Xilinx and Altera devices” the point is made that the way to get the best test coverage is to test with blank devices.
Blanking a device has its own challenges – from generating a blank image to stopping the device from reconfiguring itself without having to blank the configuration device as well.
For Altera Cyclone III devices, if they are setup to use either Active Serial or Active Parallel configuration schemes there is an easy way to clear the devices using just a few lines of RAW JTAG. These devices support what Altera calls CONFIG_IO which has two useful instructions for clearing the configuration from a device.
The instructions are ACTIVE_DISENGAGE and PULSE_NCONFIG. These two commands are used in the following XJEase code example. First the configuration controller is halted so the device does not attempt to re-configure itself. Secondly the existing configuration is cleared.
The above code is a complete XJEase function that can be called as part of a test run and will keep the Altera device blank until the power is cycled.