A safety device of the invention includes at least one of an input unit having one or more input terminals and an output unit having one or more output terminals, a testing unit having one or more test terminals, a rewritable nonvolatile memory configured to store setting information of a terminal specification which can be set from outside via the tool, and wherein the terminal specification of the one or more test terminals included in the testing unit is determined in accordance with the setting information of the terminal specification.