ID generator and test code