Refactoring coverage calculation