A device is provided for testing a sample via a gas stream, including: an opening; structure for generating a device gas stream along at least one flow path passing through the opening; at least one pressure sensor, each pressure sensor being arranged to measure a pressure of the gas stream along at least one flow path; and a mass flowmeter arranged to measure a parameter representative of the mass flow of the gas stream along the flow path. The device is arranged to quantify the presence of a gas of interest within a gas being analyzed and/or to determine the size of a leak hole from a measurement of the parameter representative of the mass flow. A method is also provided that is implemented by such a device. The method can be used to test the integrity of food packaging, and for detecting leaks or problems related to sealing containers.