Class: SixthSense::Analyzers::RedundancyCoverage

Inherits:
SixthSense::Analyzer show all
Includes:
RedundancyRequirement
Defined in:
lib/sixth_sense/analyzers/redundancy_coverage.rb

Instance Method Summary collapse

Methods inherited from SixthSense::Analyzer

analyzer_id, axis, inherited, level, reference, references

Instance Method Details

#analyze(test_file, context) ⇒ Object

Paper basis: Harrold/Gupta/Soffa 1993 (doi:10.1145/152388.152391) models minimization through requirement coverage; Rothermel et al. 1998 (doi:10.1109/ICSM.1998.738487) motivates conservative reporting.



28
29
30
31
32
33
34
35
36
# File 'lib/sixth_sense/analyzers/redundancy_coverage.rb', line 28

def analyze(test_file, context)
  coverage = context.coverage_map_for(test_file)
  return unmeasured(confidence: :low) unless coverage

  requirements = test_file.test_cases.to_h do |test_case|
    [test_case.id, coverage.branch_requirements_for(test_case.id)]
  end
  analyze_requirements(test_file, requirements, confidence: :medium)
end