function and integration tests