tests and logging