A library for writing client/testing code based on DFA