measuring the I-V Curve for the n-channel mosfet bs170
Typically curve traces for MOSFETs are measured with Vg at set of useful, fixed values between the Gate-Source Threshold Voltage, Vgs(th), and Gate Source Voltage, Vgs. The value of Vds is then swept between 0 and some useful value at or below about 70% of the Drain-Source breakdown Voltage, Vdss(br).

Note that it is also not uncommon to pulse the gate and use values up to Vgsm. Most good component data sheets give a reference schematic of the test fixture. Vishay Siliconix has a very thorough application note, Measuring Power MOSFET Characteristics, that is worth a look to better understand how such things are tested.