A semiconductor device comprising an RF circuit (1; 1A) and a microcontroller (2; 2A; 2B), wherein the RF circuit (1; 1A) comprises: a transmission unit (11; 11A) for generating a transmission signal; a reception unit (12; 12A) for generating a first generation signal and a second generation signal; and a transmission/reception loop-back switching unit (13; 13a to 13c) for switching between a first coupling state of coupling an output terminal of the transmission unit (11; 11A) to a transmission antenna (200; 200a; 200b) and coupling an input terminal of the reception unit (12; 12A) to a reception antenna (300; 300a to 300c) and a second coupling state of coupling an output terminal of the transmission unit (11; 11A) to the input terminal of the reception unit (12; 12A), wherein the reception antenna (300; 300a to 300c) is an antenna receiving, as a reception signal, a reflection wave which is a transmission signal transmitted from the transmission antenna (200; 200a; 200b) and reflected by a target object when the transmission/reception loop-back switching unit (13; 13a to 13c) is in the first coupling state, characterized in that: the microcontroller (2; 2A; 2B) is configured to switch the transmission/reception loop-back switching unit (13; 13a to 13c) to the second coupling state in the case where the first generation signal when the transmission/reception loop-back switching unit (13; 13a to 13c) is in the first coupling state is not normal, and execute a test of the RF circuit (1; 1A) on the basis of the second generation signal when the transmission/reception loop-back switching unit (13; 13a to 13c) is in the second coupling state and an output signal of a first sensor circuit (400; 400A) for detecting the target object. a transmission unit (11; 11A) for generating a transmission signal; a reception unit (12; 12A) for generating a first generation signal and a second generation signal; and a transmission/reception loop-back switching unit (13; 13a to 13c) for switching between a first coupling state of coupling an output terminal of the transmission unit (11; 11A) to a transmission antenna (200; 200a; 200b) and coupling an input terminal of the reception unit (12; 12A) to a reception antenna (300; 300a to 300c) and a second coupling state of coupling an output terminal of the transmission unit (11; 11A) to the input terminal of the reception unit (12; 12A), wherein the reception antenna (300; 300a to 300c) is an antenna receiving, as a reception signal, a reflection wave which is a transmission signal transmitted from the transmission antenna (200; 200a; 200b) and reflected by a target object when the transmission/reception loop-back switching unit (13; 13a to 13c) is in the first coupling state, characterized in that: the microcontroller (2; 2A; 2B) is configured to switch the transmission/reception loop-back switching unit (13; 13a to 13c) to the second coupling state in the case where the first generation signal when the transmission/reception loop-back switching unit (13; 13a to 13c) is in the first coupling state is not normal, and execute a test of the RF circuit (1; 1A) on the basis of the second generation signal when the transmission/reception loop-back switching unit (13; 13a to 13c) is in the second coupling state and an output signal of a first sensor circuit (400; 400A) for detecting the target object. the microcontroller (2; 2A; 2B) is configured to switch the transmission/reception loop-back switching unit (13; 13a to 13c) to the second coupling state in the case where the first generation signal when the transmission/reception loop-back switching unit (13; 13a to 13c) is in the first coupling state is not normal, and execute a test of the RF circuit (1; 1A) on the basis of the second generation signal when the transmission/reception loop-back switching unit (13; 13a to 13c) is in the second coupling state and an output signal of a first sensor circuit (400; 400A) for detecting the target object.