A BOTDA system based on pulse coding and coherent detection comprises a narrow linewidth laser device (10), a first polarization-maintaining coupler (11), a second polarization-maintaining coupler (12), a microwave signal source (17), testing optical fibers (18), an optical circulator (19), a 3dB coupler (20), a balance photoelectric detector (21), a scrambler (16), a spectrum analyzer (22) and a digital signal processing unit (23), wherein continuous light emitted by the arrow linewidth laser device (10) is divided into two channels of continuous light, namely, a first channel of the continuous light and a second channel of the continuous light, through the first polarization-maintaining coupler (11); and the system further comprises a frequency shifter (9), a first electrooptical modulator (13), a pulse signal source (14) and a second electrooptical modulator (15). The system adopts a pulse coding technology and a coherent detection method, so that the signal to noise ratio of the BOTDA and the measurement accuracy can be improved, the sensing distance is increased, and the system has the function of breakpoint detection.