Writing tests when creating patches