Class: SixthSense::Model::Mutant

Inherits:
Struct
  • Object
show all
Defined in:
lib/sixth_sense/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#diffObject

Returns the value of attribute diff

Returns:

  • (Object)

    the current value of diff



174
175
176
# File 'lib/sixth_sense/model.rb', line 174

def diff
  @diff
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



174
175
176
# File 'lib/sixth_sense/model.rb', line 174

def id
  @id
end

#killing_hintObject

Returns the value of attribute killing_hint

Returns:

  • (Object)

    the current value of killing_hint



174
175
176
# File 'lib/sixth_sense/model.rb', line 174

def killing_hint
  @killing_hint
end

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



174
175
176
# File 'lib/sixth_sense/model.rb', line 174

def location
  @location
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



174
175
176
# File 'lib/sixth_sense/model.rb', line 174

def 
  @metadata
end

#operatorObject

Returns the value of attribute operator

Returns:

  • (Object)

    the current value of operator



174
175
176
# File 'lib/sixth_sense/model.rb', line 174

def operator
  @operator
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



174
175
176
# File 'lib/sixth_sense/model.rb', line 174

def status
  @status
end

Instance Method Details

#excluded?Boolean

Paper basis: Jia/Harman 2011 describes equivalent mutants as a threat; equivalent/skipped mutants are excluded from the mutation-score denominator.

Returns:

  • (Boolean)


194
195
196
# File 'lib/sixth_sense/model.rb', line 194

def excluded?
  status == :excluded || status == "excluded" || status == :equivalent || status == :skipped || status == "skipped"
end

#killed?Boolean

Paper basis: Jia/Harman 2011 (doi:10.1109/TSE.2010.62) counts killed mutants as behaviorally distinguished by the test suite.

Returns:

  • (Boolean)


186
187
188
189
190
# File 'lib/sixth_sense/model.rb', line 186

def killed?
  return timeout_killed? if status == :timeout || status == "timeout"

  status == :killed || status == "killed" || status == :timeout
end

#to_hObject



198
199
200
201
202
203
204
205
206
207
208
# File 'lib/sixth_sense/model.rb', line 198

def to_h
  {
    id: id,
    operator: operator,
    location: location&.to_h,
    status: status,
    diff: diff,
    killing_hint: killing_hint,
    metadata:  || {}
  }
end