A semiconductor device testing apparatus 1A includes a tester unit 16 that generates an operational pulse signal, an optical sensor 10 that outputs a detection signal as a response to the operational pulse signal, a pulse generator 17 that generates a reference signal containing a plurality of harmonics for the operational pulse signal in synchronization with the operational pulse signal, a spectrum analyzer 13 that receives the detection signal and acquires a phase and amplitude of the detection signal at a detection frequency, a spectrum analyzer 14 that receives the reference signal and acquires a phase of the reference signal at a detection frequency, and an analysis control unit 18 that acquires a time waveform of the detection signal based on the phase and the amplitude of the detection signal acquired by the spectrum analyzer 13 and the phase of the reference signal acquired by the spectrum analyzer 14.