Simulation or testing of codes