flitsr.tie.Tie

class flitsr.tie.Tie(entities: Collection[Entity], all_faults: Dict[Any, _CollapsableFault], active_faults: Dict[Any, int])

Bases: object

__init__(entities: Collection[Entity], all_faults: Dict[Any, _CollapsableFault], active_faults: Dict[Any, int])

Methods

__init__(entities, all_faults, active_faults)

active_fault_locations(...)

Return all active fault locations (either groups or elements) in this tie, with the faults they contain.

active_faults(-> ~typing.Dict[~typing.Any, ...)

Return a dictionary of all faults identified in this tie, along with their fault locations (either groups or elements).

elems(...)

Return the set of all the elements (or entities) in this tie.

expected_value(q, weffort[, collapse])

Calculates the expected value of the qth fault in this tie.

fault_groups(...)

Return all active fault locations (either groups or elements) in this tie, with the faults they contain.

fault_identify_num(fault[, collapse])

Return the number of locations that must be inspected (according to the bug understanding model) to identify the given fault in this tie.

fault_identify_nums([collapse])

Return a dictionary with the number of locations that must be inspected (according to the bug understanding model) to identify each of the active faults in this tie.

len([collapse])

Return either the number of groups (if collapsed), or number of elements in this tie (if not collapsed).

num_active_fault_locs([collapse])

Return only the number of active fault locations (either groups or elements) in this tie.

num_fault_locs([collapse, active])

Return the total number of faulty locations (either groups or elements) in this tie.

num_faults([active])

Return the number of faults in this tie.

Attributes

T

T = ~T
active_fault_locations() Dict[Element, Any]
active_fault_locations(collapse: Literal[False]) Dict[Element, Any]
active_fault_locations(collapse: Literal[True]) Dict[Entity, Any]
active_fault_locations(collapse: bool) Dict[Element, Any] | Dict[Entity, Any]

Return all active fault locations (either groups or elements) in this tie, with the faults they contain. Active fault locations are those of faults identified in this tie.

Added in version 2.4.0: Renamed from Tie.fault_groups.

active_faults() Dict[Any, Set[Element]]
active_faults(collapse: Literal[False]) Dict[Any, Set[Element]]
active_faults(collapse: Literal[True]) Dict[Any, Set[Entity]]
active_faults(collapse: bool) Dict[Any, Set[Element]] | Dict[Any, Set[Entity]]

Return a dictionary of all faults identified in this tie, along with their fault locations (either groups or elements). This is a subset of the Ties.faults dictionary.

Added in version 2.4.0.

elems() Set[Element]
elems(collapse: Literal[False]) Set[Element]
elems(collapse: Literal[True]) Set[Entity]
elems(collapse: Literal[False], no_passive: bool) Set[Element]
elems(collapse: Literal[True], no_passive: bool) Set[Entity]
elems(collapse: bool, no_passive: bool) Set[Element] | Set[Entity]

Return the set of all the elements (or entities) in this tie. When no_passive is True, only return elements that are not passive faults.

Changed in version 2.5.0: Added the collapse and no_passive optional parameters

expected_value(q: int, weffort: bool, collapse: bool = False) float

Calculates the expected value of the qth fault in this tie. The expected value can either be in terms of wasted effort (not counting fault inspection) or actual position in the ranking.

Deprecated since version 2.5.0: Moved to flitsr.calculations.exp_values.effort_exp_val_tie

fault_groups() Dict[Element, Any]
fault_groups(collapse: Literal[False]) Dict[Element, Any]
fault_groups(collapse: Literal[True]) Dict[Entity, Any]
fault_groups(collapse: bool) Dict[Element, Any] | Dict[Entity, Any]

Return all active fault locations (either groups or elements) in this tie, with the faults they contain. Active fault locations are those of faults identified in this tie.

Deprecated since version 2.4.0: This function has been renamed to Tie.active_fault_locations.

fault_identify_num(fault: Any, collapse: bool = False) int

Return the number of locations that must be inspected (according to the bug understanding model) to identify the given fault in this tie.

Raises:

ValueError – If fault is not an active fault in this tie.

Added in version 2.5.0: Added support for multiple bug understanding models

fault_identify_nums(collapse: bool = False) Dict[Any, int]

Return a dictionary with the number of locations that must be inspected (according to the bug understanding model) to identify each of the active faults in this tie.

Returns:

A dictionary with keys being each of the active faults, and values being the number of locations of that fault in this tie that must be inspected to conclusively identify the fault.

Added in version 2.5.0: Added support for multiple bug understanding models

len(collapse: bool = False) int

Return either the number of groups (if collapsed), or number of elements in this tie (if not collapsed).

num_active_fault_locs(collapse: bool = False) int

Return only the number of active fault locations (either groups or elements) in this tie. An active fault location is a fault location that belongs to a fault that is identified in this tie. This method is equivalent to num_fault_locs(active=True).

num_fault_locs(collapse: bool = False, active: bool = False) int

Return the total number of faulty locations (either groups or elements) in this tie. By default, returns the locations of both active and passive faults. If active is True, returns only the locations of active faults. Active fault locations are those of faults conclusively identified in this tie, while non-active are those of faults identified in a previous or subsequent tie.

Changed in version 2.5.0: Added the active optional parameter

num_faults(active: bool = True) int

Return the number of faults in this tie. Either returns only the number of active faults (default), or the total number of faults if active is False.

Changed in version 2.5.0: Added the active optional parameter