When forming an opening conforming to a groove of a quartz resonator in a metal film serving as a mask of the quartz resonator by conducting etching, the outer periphery of the metal film is wavingly etched. Therefore, when the groove is formed on the quartz resonator, the quartz resonator is formed according to the above-described metal film, which results in appearance defects or dimension defects. In order to solve the problems, the outer shape of the metal film is formed smaller than the outer shape of the quartz resonator before forming the opening conforming to the groove of the quartz resonator in the metal film, then etching of the metal film and etching of the quartz resonator are performed.