What a great question homework or not!. Well, it is true that years ago human analysts were used to sniff toxic gases and chemicals. They came to no real harm as more often than not, the gases were combined with oxygen or air effectively diluting their toxic qualities. In addition, a good guess was often made about the likely odour from a chemical from the compounds that reacted together to make the chemical in the first place especially if the compounds themselves were relatively non-toxic but odoriferous. Having said that, fatalities have occurred with many compounds.
So how is it done nowadays? Well, there are quite a few methods available to scientists but I'll mention only one here as it's probably the simplest. The compound is analysed using Gas Chromatography and Olfactometry which effectively splits the toxic compound down to simpler compounds.
The odour evaluation is performed by a specially trained operator who in essence, smells the given compounds at special "ports" attached to the analysis equipment. Each of these evaluated compounds is less toxic than the parent compound.
The operator is then asked via a touch-screen to describe the odour, using many parameters such as "earthy", "fishy", "fruity" etc. Details of other factors such as the perception of a lingering odour are also requested. From the operator analysis (and other operators too), a profile is built up by computer of the odour of the toxic chemical as a whole.
The final data will provide an accurate description of the odour of the parent compound. I must add though, that I've greatly simplified the details used in this type of analysis and not discussed much more complex systems that are in use.
Finally, you have to remember that virtually all chemical compounds have had their odour described in chemical dictionaries such as Hawley's for many years. In effect, this reduces the need to