The use of Immersed Gratings offers advantages for both space- and ground-based spectrographs. As diffraction takes place inside the high-index medium, the optical path difference and angular dispersion are boosted proportionally, thereby allowing a smaller grating area and a smaller spectrometer size. Short-wave infrared (SWIR) spectroscopy is used in space-based monitoring of greenhouse and pollution gases in the Earth atmosphere. On the extremely large telescopes currently under development, mid-infrared high-resolution spectrographs will, among other things, be used to characterize exo-planet atmospheres. At infrared wavelengths, Silicon is transparent. This means that production methods used in the semiconductor industry can be applied to the fabrication of immersed gratings. Using such methods, we have designed and built immersed gratings for both space- and ground-based instruments, examples being the TROPOMI instrument for the European Space Agency Sentinel-5 precursor mission, Sentinel-5 (ESA) and the METIS (Mid-infrared E-ELT Imager and Spectrograph) instrument for the European Extremely Large Telescope. Three key parameters govern the performance of such gratings: The efficiency, the level of scattered light and the wavefront error induced. In this paper we describe how we can optimize these parameters during the design and manufacturing phase. We focus on the tools and methods used to measure the actual performance realized and present the results. In this paper, the bread-board model (BBM) immersed grating developed for the SWIR-1 channel of Sentinel-5 is used to illustrate this process. Stringent requirements were specified for this grating for the three performance criteria. We will show that -with some margin- the performance requirements have all been met.