A code to perform Hazard analysis using Python

João Bosco
3 min readAug 19, 2023

--

The hazard analysis is a based task to be performed in many different industries, and it is an essential part of the requirement in the Safety Management System in Aircraft Industry, represented by the “Service Providers,” according to ICAO.
Safety risk assessment is one of the functions of a Safety Management System, and an essential element of safety risk assessment is the identification of hazards.
Different tools and approaches exist to perform the preliminary hazard analysis in the literature, such as brainstorming, Hazard and Operability Studies, Checklists, Failure Mode and Effect Analysis, What If analysis, etc.
Figure 2 shows a bowtie diagram summarizing the “Risk Management” task established in the Safety Management System requirements.

See the “Risk Management” task is in Figure 1 below, left side.

Figure 1: Risk Management according to FAA

This simple piece of code has as main idea to generate a code to perform a preliminary Hazard analysis, based on the model presented in the Figure 2.

This code is the first piece or preliminary project to capture all elements in the bowtie model to perform a systematic hazard analysis based on good practices.

This code is composed of four elements:

1 — “call_hazard.py” code.

2 — “main_hazard.py” code.

3 — “get_constraints.py code.

4 — “hazard_class.py” code.

The code interacts with the users to define the elements shown in the Figure 2.
The first input is the Hazard description or source of hazard, the hazard element present.
The definition of the “Undesirable Event” or what the user can avoid.
Associated with the “Undesirable Event,” the user should choose the likelihood of this event.
The following steps are:
Define the “Safety Events” that can directly cause the “Undesirable Event.”
Define the “Barriers” related to each “Safety Event.”
Define the “Outcomes” related to “Undesirable Event.”
For each “Outcome,” the user is requested to choose a “Severity Level,” and the code generates the “Risk Index” and the Assessment. For each “Outcome,” the user can add the “Mitigation” strategy.
The users can change the Risk Indexes, Levels, and Assessments accordingly.
The code saves the information in a “txt” file.

Figure 2: BowTie Diagram; Source: Guidance on Hazard Identification from ECAST

The method for building a bow-tie involves asking a structured set of questions in a logical sequence. The completed Bow-Tie illustrates the hazard, the undesirable event, the safety events and potential outcomes, and the risk controls put in place to minimise the risk. From “Guidance on Hazard Identification from ECAST.

This code could incorporate new features to improve performance; this is the first step to developing a tool that can be used for different users to perform this critical task in a friendly way.

The link for the GitHub repository is below.

Link for the GitHub repository!

--

--