A method for testing a lifetime of a surface state carrier of a semiconductor, comprising the following steps: 1) using a narrow pulse light source with photon energy higher than a semiconductor forbidden band width to emit a light pulse, coupling the light pulse to an interior of a near-field optical probe through light path collimation, and producing, by the near-field optical probe, a photon-generated carrier on a surface of a semiconductor material under test through excitation; 2) concentrating the excited photon-generated carrier on the surface of the semiconductor material, and conducting recombination continuously with a surface state as a recombination center, wherein a recombination rate is in direct proportion to a carrier concentration and a carrier lifetime; 3) in both carrier excitation and recombination processes in step 1) and step 2), producing a change in a lattice constant due to an electronic volume effect, producing a stress wave, and detecting a signal of the stress wave in a high-frequency broadband ultrasonic testing mode; and 4) conducting fitting calculation on the signal of the stress wave to obtain the lifetime of the surface state carrier τ c, wherein fitting is conducted on a trailing part of the signal of the stress wave produced on the surface of the semiconductor material through excitation by near-field light to obtain the lifetime of the surface state carrier τ c, wherein a specific fitting formula is: Δc c = d E G d P n = Q exp − t τ c wherein c is a lattice constant, d E G d P is a band gap pressure coefficient, n is an electron-hole pair concentration, Q is a constant coefficient, and t is time. 1) using a narrow pulse light source with photon energy higher than a semiconductor forbidden band width to emit a light pulse, coupling the light pulse to an interior of a near-field optical probe through light path collimation, and producing, by the near-field optical probe, a photon-generated carrier on a surface of a semiconductor material under test through excitation; 2) concentrating the excited photon-generated carrier on the surface of the semiconductor material, and conducting recombination continuously with a surface state as a recombination center, wherein a recombination rate is in direct proportion to a carrier concentration and a carrier lifetime; 3) in both carrier excitation and recombination processes in step 1) and step 2), producing a change in a lattice constant due to an electronic volume effect, producing a stress wave, and detecting a signal of the stress wave in a high-frequency broadband ultrasonic testing mode; and 4) conducting fitting calculation on the signal of the stress wave to obtain the lifetime of the surface state carrier τ c, wherein fitting is conducted on a trailing part of the signal of the stress wave produced on the surface of the semiconductor material through excitation by near-field light to obtain the lifetime of the surface state carrier τ c, wherein a specific fitting formula is: Δc c = d E G d P n = Q exp − t τ c wherein c is a lattice constant, d E G d P is a band gap pressure coefficient, n is an electron-hole pair concentration, Q is a constant coefficient, and t is time.