A method for testing an optical fiber, comprising: receiving a reflected test optical signal from an optical fiber network, and converting the test optical signal into a test current signal (step 100, step 200); receiving, by a transimpedance amplifier, the test current signal by using a first working mode and outputting a first test voltage signal (step 101, step 201); acquiring a swing of the first test voltage signal, and determining whether the swing of the first test voltage signal meets a preset condition (step 102, step 202); and receiving, by the transimpedance amplifier, the test current signal by using a second working mode and outputting a second test voltage signal when the swing of the first test voltage signal meets the preset condition, wherein an upper limit and a lower limit of a receiver dynamic range when the transimpedance amplifier works in the first working mode are different from those when the transimpedance amplifier works in the second working mode (step 103, step 203), wherein the upper limit of the receiver dynamic range is a 1dB compression point input power, being input power when a gain of the transimpedance amplifier decreases to 1dB lower than a linear gain, and the lower limit of the receiver dynamic range is a minimum input power that can be detected by the transimpedance amplifier, wherein in a high 1dB compression point working mode the transimpedance amplifier has a first 1 dB compression point input power and a first minimum input power and in a high sensitivity working mode the transimpedance amplifier has a second 1 dB compression point input power and a second minimum input power and the first 1dB compression point input power is higher than the second 1dB compression point input power and the first minimum input power is higher and the second minimum input power, wherein • in a first alternative the first working mode is the high 1dB compression point working mode, the second working mode is the high sensitivity working mode, and the preset condition is that the swing of the first test voltage signal is less than a preset value and • in a second alternative instead of the first alternative the first working mode is the high sensitivity working mode and the second working mode is the high 1dB compression point working mode, and the preset condition is that the swing of the first test voltage signal is greater than the preset value. receiving a reflected test optical signal from an optical fiber network, and converting the test optical signal into a test current signal (step 100, step 200); receiving, by a transimpedance amplifier, the test current signal by using a first working mode and outputting a first test voltage signal (step 101, step 201); acquiring a swing of the first test voltage signal, and determining whether the swing of the first test voltage signal meets a preset condition (step 102, step 202); and receiving, by the transimpedance amplifier, the test current signal by using a second working mode and outputting a second test voltage signal when the swing of the first test voltage signal meets the preset condition, wherein an upper limit and a lower limit of a receiver dynamic range when the transimpedance amplifier works in the first working mode are different from those when the transimpedance amplifier works in the second working mode (step 103, step 203), • in a first alternative the first working mode is the high 1dB compression point working mode, the second working mode is the high sensitivity working mode, and the preset condition is that the swing of the first test voltage signal is less than a preset value and • in a second alternative instead of the first alternative the first working mode is the high sensitivity working mode and the second working mode is the high 1dB compression point working mode, and the preset condition is that the swing of the first test voltage signal is greater than the preset value.