Run-length codes and their variants have recently been shown to be very effective for compressing system-on-achip (SOC) test data. In this paper, we analyze the Golomb code, the conventional run-length code and the FDR code for a binary memoryless data source, and compare the compression obtained in each case to fundamental entropy bounds. We show analytically that the FDR code outperforms both the conventional run-length code and the Golomb code for test resource partitioning (TRP) based on data compression. We also present a modified compression/decompression architecture for obtaining even higher compression. We demonstrate the effectiveness of these compression codes using the larger ISCAS-89 benchmark circuits and two representative circuits from industry. Finally, we show that the FDR code is almost as effective as Unix utilities gzip and compress, even though it uses a much simpler decompression algorithm.