Refactor measurement tests