Mostly a Relative measure
Assuming you have a well-known, well-printing nozzle and filament combination, then you can print a benchmark print, change one factor and then test with altered settings.
One of the most ubiquitous prints for a benchmark is Benchy. Benchy isn't so much a calibration test, but has all aspects you need in a benchmark. Overhangs, rounded corners, sharp corners, small diameter parts and sharp corners followed by longer stretches: it's all in there! and with those one gets a decent idea of print quality for other parts.
Another typical benchmark test is a cube, which has the sharp corners and stretches.
Depending on which factors you switched, you get a resulting relative quality comparison between the two prints. But you won't get a measurable metric, unless you invent a score based on artifacts.
Filament factors
Among the factors that would show up based on bad filament. The three most noticeable I can think of are:
- hissing, bubbling & gaps can indicate wet filament
- stretches of random underextrusion and motor skipping can indicate uneven filament diameter
- sudden stalling of the extruder and no extrusion indicates a bulge on the filament
Nozzle factors
Nozzle problems generally are systemic and would show up on the whole print.
- clogs from bad machining result in systematic underextrusion or no extrusion at all
- too large a nozzle shows in a larger print
- too small a nozzle shows in bad wall-to-wall and inter-layer adhesion and extruder skipping