In the frame of the Slovenian-Polish bilateral project we developed a method for design of optimal structures of test pattern generators. The research group from the Institute of Electronics, Silesian University of Technology, Gliwice, contributed the knowledge and experiences on test patterns generation with linear feedback shift registers, while we added our experiences on built-in self test design and evolutionary optimizations.