deltacoverage

package module
v0.0.1-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 8 Imported by: 0

README

deltacoverage

Go package to provide delta coverage between your tests.

Example

$ deltacoverage
TestParseCoverageResult_ErrorsIfGivenNoTests 1.0%
TestParseCoverageResult_ReturnsCorrectValueGivenTestScriptTestCoverResult 3.2%
TestParseCoverageResult_ReturnsCorrectValueGivenNoTestScriptsTestCoverResult 0.0%
TestParseListTests_ReturnsZeroTestsIfGivenNoTests 0.0%
TestParseListTests_ReturnsCorrectValuesGivenTestListResult 0.0%
TestTestScript_ 54.2%

The test TestParseCoverageResultErrorsIfGivenNoTests contributes to exclusive 1.0% of the total coverage while TestScript is responsible for 54.2%.

Motivation

Herb Derby came up with this metric of “delta coverage”. 
You look at your test suite and you measure what coverage each test adds uniquely that no other test provides.
If you have lots of tests with no delta coverage, so that you could just delete them and not lose your 
ability to exercise parts of the system, then you should delete those tests, unless they have some some 
communication purpose.
—Kent Beck, “Is TDD Dead?”

Thank you @bitfield for the suggestion.

Roadmap

  • POC ✅
  • Brute force implementation using go test commands ✅
  • Borrow cover.go code and create deltagecoverage.go -> WIP
  • (Dream) Implement as Go CLI feature.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main() int

Main runs and returns an exit code If succeed, it will print to stdout the delta coverage of a function given as first argument and return zero If error, it will print to stdderr and return non zero

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL