Migrate more tests to use debug_code method