A method of operating a semiconductor device including a multi-level variable resistance device , the method comprising: a first operation (S110) of applying a first, reset, voltage to the variable resistance device to change a resistance value of the variable resistance device from a first, set, resistance value to a second, reset, resistance value, the second resistance value being different from the first resistance value; a second operation (S120) of sensing a first current flowing through the variable resistance device to which the first voltage has been applied during the first operation; and a third operation (S125) of determining whether the first current falls within a test range corresponding to a level of multi-level data; and wherein said method further comprises: a fourth operation (S130) of, when the first current does not fall within the test range, repeating the first to third operations, and when the first current falls within the test range, determining a second, set, voltage used to change the resistance value of the variable resistance device from the second resistance value to the first resistance value based on a dispersion value of the sensed first current; a fifth operation (S140) of applying the second voltage to the variable resistance device; and a sixth operation (S150) of repeating the applying the first voltage to the variable resistance device to which the second voltage is applied. a first operation (S110) of applying a first, reset, voltage to the variable resistance device to change a resistance value of the variable resistance device from a first, set, resistance value to a second, reset, resistance value, the second resistance value being different from the first resistance value; a second operation (S120) of sensing a first current flowing through the variable resistance device to which the first voltage has been applied during the first operation; and a third operation (S125) of determining whether the first current falls within a test range corresponding to a level of multi-level data; and wherein said method further comprises: a fourth operation (S130) of, when the first current does not fall within the test range, repeating the first to third operations, and when the first current falls within the test range, determining a second, set, voltage used to change the resistance value of the variable resistance device from the second resistance value to the first resistance value based on a dispersion value of the sensed first current; a fifth operation (S140) of applying the second voltage to the variable resistance device; and a sixth operation (S150) of repeating the applying the first voltage to the variable resistance device to which the second voltage is applied. a fourth operation (S130) of, when the first current does not fall within the test range, repeating the first to third operations, and when the first current falls within the test range, determining a second, set, voltage used to change the resistance value of the variable resistance device from the second resistance value to the first resistance value based on a dispersion value of the sensed first current; a fifth operation (S140) of applying the second voltage to the variable resistance device; and a sixth operation (S150) of repeating the applying the first voltage to the variable resistance device to which the second voltage is applied. <EOS>