Class: SixthSense::Model::CheckedCoverageMap
- Inherits:
-
Struct
- Object
- Struct
- SixthSense::Model::CheckedCoverageMap
- Defined in:
- lib/sixth_sense/model.rb
Instance Attribute Summary collapse
-
#executed_lines ⇒ Object
Returns the value of attribute executed_lines.
-
#per_test_checked_lines ⇒ Object
Returns the value of attribute per_test_checked_lines.
Instance Method Summary collapse
-
#checked_ratio ⇒ Object
Paper basis: Schuler/Zeller 2011 (doi:10.1109/ICST.2011.32) scores the fraction of executed code that is checked by an oracle.
-
#unchecked_lines ⇒ Object
Paper basis: Schuler/Zeller 2011; unchecked executed lines are reported as oracle-quality gaps rather than ordinary coverage gaps.
Instance Attribute Details
#executed_lines ⇒ Object
Returns the value of attribute executed_lines
143 144 145 |
# File 'lib/sixth_sense/model.rb', line 143 def executed_lines @executed_lines end |
#per_test_checked_lines ⇒ Object
Returns the value of attribute per_test_checked_lines
143 144 145 |
# File 'lib/sixth_sense/model.rb', line 143 def per_test_checked_lines @per_test_checked_lines end |
Instance Method Details
#checked_ratio ⇒ Object
Paper basis: Schuler/Zeller 2011 (doi:10.1109/ICST.2011.32) scores the fraction of executed code that is checked by an oracle.
146 147 148 149 150 151 152 153 154 |
# File 'lib/sixth_sense/model.rb', line 146 def checked_ratio executed = normalize_requirements(executed_lines || {}) return nil if executed.empty? checked = per_test_checked_lines.values.flat_map do |requirements_by_path| normalize_requirements(requirements_by_path).to_a end.to_set (checked & executed).length.to_f / executed.length end |
#unchecked_lines ⇒ Object
Paper basis: Schuler/Zeller 2011; unchecked executed lines are reported as oracle-quality gaps rather than ordinary coverage gaps.
158 159 160 161 162 163 |
# File 'lib/sixth_sense/model.rb', line 158 def unchecked_lines checked = per_test_checked_lines.values.flat_map do |requirements_by_path| normalize_requirements(requirements_by_path).to_a end.to_set normalize_requirements(executed_lines || {}) - checked end |