test code and debugging utilities