Embodiments of the present invention relate a gas sensor comprising a gas detector and a hydrocarbon gas generating device, wherein the hydrocarbon gas generating device is positioned to provide an amount of hydrocarbon gas to the gas detector for testing. The hydrocarbon gas generating device comprises a heater and a gas releasing material.