bahamas
Submodules
- bahamas.cccg
- bahamas.defect_conditional_probability
- bahamas.human_error_mode_distribution
- bahamas.main
- bahamas.plot_utils
- bahamas.sdlc_stage_hep_calculation
- bahamas.sdlc_stage_hep_calculation_approx
- bahamas.software_total_failure_probability_bbn
- bahamas.stage_odc_distribution
- bahamas.subfactor
- bahamas.uca_defect_correlation
- bahamas.utils
- bahamas.validate
- bahamas.workflow
Attributes
Classes
Bayesian belief network for reliability analysis of software |
|
Compute CCCGs for the given list of components of diversity and redundancy system |
|
Workflow manager for BAHAMAS calculation |
Functions
|
|
|
This function reads in the human error probability (mean and std) from a |
|
|
|
Get the distribution of each ODC defect at the given SDLC stage |
|
Defect conditional probability calculation for each SDLC stage |
|
Assign distribution for each UCA defect correlation term |
|
Plot histogram for sampled data |
|
Validate TOML input file |
Package Contents
- class bahamas.BBN(defect_file, task_file, num_samples=1000, approx=False, data=None, seed=42)[source]
Bases:
objectBayesian belief network for reliability analysis of software
- num_samples = 1000
- _approx = False
- _data = None
- _uca = ['UCA-A', 'UCA-B', 'UCA-C', 'UCA-D']
- _odc = ['Algorithm', 'Assignment', 'Checking', 'Documentation', 'Function', 'Interface',...
- _sdlc = ['Concept', 'Requirement', 'Design', 'Implementation', 'Testing', 'Install and Maintenance']
- _defect
- _task
- prob_stage
- prob_odc
- prob_dcp
- prob_total = None
- prob_uca
- _hemd_dist
- prob_stage_odc
- prob_uca_correlation
- _G = 0.25
- review_trigger_factor
- get_total_failure_probability()[source]
Get total failure probability
- Returns:
mean, sigma, and samples
- Return type:
tuple
- bahamas.sdlc_stage_hep_calculation(excel_file_path, sheet_name, hemd, num_samples=100, distribution='lognorm')[source]
- Parameters:
excel_file_path (str) – Filename of the spreadsheet with the number of actions and types
sheet_name (str) – Sheet name in the spreadsheet with the data
hemd (dict) – Dictionary of rvs functions, keyed by action type
num_samples (int) – Number of samples to generate for each action
distribution (str) – Type of distribution to use (currently always “lognorm”)
- Returns:
total, fitted (numpy.array, dict) – The samples for the SDLC stage by considering all human error propagations, and a dictionary of the fitted mu and sigma parameters.
This function reads in the number of human actions and human error modes from a
spreadsheet, and calculates the human error probability distributions.
- bahamas.sdlc_stage_hep_calculation_approx(excel_file_path, sheet_name, num_samples=100, distribution='norm')[source]
This function reads in the human error probability (mean and std) from a spreadsheet and calculates the human error probability distributions.
- Parameters:
excel_file_path (str) – Filename of the spreadsheet with the number of actions and types
sheet_name (str) – Sheet name in the spreadsheet with the data
num_samples (int) – Number of samples to generate for each action
distribution (str) – Type of distribution to use (currently always “norm”)
- Returns:
total, None – Samples for the SDLC stage by considering all human error propagations
- Return type:
numpy.array, None
- bahamas.get_hemd_from_spreadsheet(spreadsheet_file, sheet_name='HEMD', distribution='lognorm')[source]
- Parameters:
spreadsheet_file (str) – Filename of the spreadsheet to read in
sheet_name (str) – Name of the sheet with the human error mode distribution data
distribution (str) – Type of distribution to use (currently only “lognorm” is supported)
- Returns:
hemd, dist_dict (dict, dict) – The first dictionary contains the rvs sampling function for the action type; the second dictionary contains the distribution dictionary — both are keyed by the action type.
gets the human error mode distributions from a spreadsheet
- bahamas.get_stage_odc_dist(excel_file, distribution='beta', sheet_name='ODC')[source]
Get the distribution of each ODC defect at the given SDLC stage P(Defect type|SDLC Stage) = dist_dict[‘SDLC Stage’][‘Defect type’]
- Parameters:
excel_file (str) – Filename of the excel file to read in
distribution (str, optional) – Type of distribution to use (defaults to “beta”)
sheet_name (str, optional) – Name of the sheet with the ODC data (defaults to “ODC”)
- bahamas.stage_dcp_calculation(excel_file, sheet_name)[source]
Defect conditional probability calculation for each SDLC stage
- Parameters:
excel_file (str) – The filename of the spreadsheet with the review number and trigger coverage
sheet_name (str) – The sheet name in the spreadsheet with the data (i.e., the SDLC stage name)
- Returns:
defect conditional probability
- Return type:
dcp (float)
- bahamas.get_uca_defect_correlation_dist(excel_file, distribution='norm', sheet_name='UCA Correlation')[source]
Assign distribution for each UCA defect correlation term
- Parameters:
excel_file (str) – Excel file to read in
distribution (str, optional) – Type of distribution (defaults to “norm”)
sheet_name (str, optional) – Name of the sheet with UCA correlation data (defaults to “UCA Correlation”)
- Returns:
UCA defect correlation distribution, {‘UCA type’:{‘ODC type’:Dist},…}
- Return type:
dict
- bahamas.SDLC_stages = ['Concept', 'Requirement', 'Design', 'Implementation', 'Testing', 'Install and Maintenance'][source]
- bahamas.ODC_types = ['Algorithm', 'Assignment', 'Checking', 'Documentation', 'Function', 'Interface',...[source]
- bahamas.plot_histogram(data_dict, title, save=False, show=True)[source]
Plot histogram for sampled data
- Parameters:
data_dict (dict) – dictionary of sampled data
title (str) – title for the plot
save (bool, optional) – Save plot into .png file if True (defaults to False)
- Returns:
plotly figure object
- Return type:
figure object
- class bahamas.CCCG(file)[source]
Bases:
objectCompute CCCGs for the given list of components of diversity and redundancy system
- _sys_diagram
- _cccg_final = []
- _cccg_function = []
- _cccg_input = []
- _cccg_design = []
- _cccg_single = []
- _cccg_function_input = []
- _cccg_function_design = []
- _cccg_input_function = []
- _cccg_input_design = []
- _cccg_design_input = []
- _cccg_design_function = []
- _cccg_double = []
- _cccg_function_input_design = []
- _cccg_function_design_input = []
- _cccg_input_design_function = []
- _cccg_input_function_design = []
- _cccg_design_input_function = []
- _cccg_design_function_input = []
- _cccg_triple = []
- _function_all = []
- _input_all = []
- _design_all = []
- generate(config=None)[source]
Generate CCCGs based on three coupling factors (i.e., Function, Input, and Design)
- Parameters:
config (dict, optional) – config file for output control. Defaults to None.
- get(name)[source]
Get CCCGs
- Parameters:
name (str) – name for CCCGs group
- Returns:
list of CCCGs
- Return type:
list (list of Pandas.DataFrame)
- class bahamas.Workflow(config)[source]
Workflow manager for BAHAMAS calculation
- _config
- _bbn_config = None
- _ccf_config = None
- update_config(config, name)[source]
update default config with user provided data
- Parameters:
config (dict) – User-provided config file
name (str) – Name for the config file (i.e., BBN or CCF)
- Raises:
IOError – If name is valid, raise the error
- Returns:
updated config file
- Return type:
dict
- run_bbn()[source]
Run BBN Calculation
- Raises:
IOError – Error out if invalid input for analysis type is provided