1) Burning fossil fuel results in the creation of water and CO2 when done perfectly. Since nothing is perfect there is also some amount of CO present although diesels are pretty good about that. Since air isn't just O2 there is also oxidation of the other components, mainly N2 which forms NOX (various oxides of Nitrogen). Oh.. and there is also unburned hydrocarbons (fossil fuel) coming out.
2) I have no idea what type of testing you will need. If it is safety related I presume they will find the hole in your muffler acoustically. The exhaust gas analyzer on a IM240 test bench can tell if you have a significant exhaust leak. It does this by measuring the amount of CO2 coming out (exactly in grams). It does this normally to detect a fraudulent test. In other words an engine with a certain displacement will pump an exact amount of gases out the tailpipe (predicted by the volumetric efficiency and the chemical equation HC + O2 = CO2 + H2O). The test looks at unburned HC, CO, and NOX for polutants and it looks at CO2 to verify that the probe was actually in a tailpipe (and in a pipe of a car with a certain sized engine).
3) Aside from whats is coming out above, Diesels are usually checked for soot (particulates).
Bosch Master, ASE Master, L1
33 years MB technician