muteria.drivers.criteria.meta_testcriteriatool module

This module is used through MetaCriteriaTool class Which access the relevant testcase tools as specified

The tools are organized by programming language For each language, there is a folder for each tool, named after the tool in lowercase

Each criteria tool package have the following in the __init__.py file: >>> import <Module>.<class extending BaseCriteriaTool> as CriteriaTool

class muteria.drivers.criteria.meta_testcriteriatool.MetaCriteriaTool(language, meta_test_generation_obj, criteria_working_dir, code_builds_factory, tools_config_by_criterion_dict)[source]

Bases: object

TOOL_OBJ_KEY = 'tool_obj'
TOOL_WORKDIR_KEY = 'tool_working_dir'
check_tools_installed()[source]
clear_working_dir()[source]
get_checkpoint_state_object()[source]
get_criteria_tools_by_name(toolname)[source]
get_criterion_info_file(criterion)[source]
get_criterion_info_object(criterion)[source]
classmethod get_toolnames_by_types_by_criteria_by_language()[source]

get imformation about the plugged-in criteria tool drivers. :return: a dict having the form:

{
language: {
criterion: {
CriteriaToolType: [

(toolname, is_installed?)

]

}

}

}

has_checkpointer()[source]
instrument_code(criteria_enabled_list=None, exe_path_map=None, parallel_count=1, restart_checkpointer=False, finish_destroy_checkpointer=True)[source]

Instrument the code for the criteria measurements.

type criteria_enabled_list:

dict or None

param criteria_enabled_list:

When None, use all supported criteria else use the specified criteria

type exe_path_map:

dict or None

param exe_path_map:

When None, use all exe, else instrument files as dict key and write the instrumented output in directory as value.

type parallel_count:

param parallel_count:

:type

estart_checkpointer:

:param

estart_checkpointer:

:type

inish_destroy_checkpointer:

:param

inish_destroy_checkpointer:

raises:

rtype:

runtests_criteria_coverage(testcases, criterion_to_matrix, criterion_to_executionoutput=None, criteria_element_list_by_criteria=None, re_instrument_code=False, cover_criteria_elements_once=False, prioritization_module_by_criteria=None, parallel_count=1, parallel_criteria_test_scheduler=None, restart_checkpointer=False, finish_destroy_checkpointer=True)[source]

Executes the instrumented executable code with testscases and returns the different code coverage matrices.

param testcases:

list of testcases to execute

param criterion_to_matrix:

dict of <criterion, Matrix file where to store coverage>.

param criterion_to_executionoutput:

dict of <criterion, execoutput file where to store coverage>.

param criteria_element_list_by_criteria:

dictionary representing the list of criteria elements (stmts, branches, mutants) to consider in the test execution matices. Key is the criterion and the value the list of elements

param re_instrument_code:

Decide whether to instrument code before running the tests. (Example when instrumentation was not specifically called. This is True by default)

param cover_criteria_elements_once:

Specify whether to cover criteria elements once is enough, meaning that we stop analysing a criterion element once a test covers it. The remaining test covering verdict will be UNKNOWN.

param prioritization_module_by_criteria:

dict of prioritization module by criteria. None means no prioritization used.

type parallel_count:

param parallel_count:

type parallel_criteria_test_scheduler:

param parallel_criteria_test_scheduler:

scheduler that organize parallelism across criteria tools. (TODO: Implement support)

:type

estart_checkpointer:

:param

estart_checkpointer:

type finish_destroy_checkpointer:

param finish_destroy_checkpointer: