Nesting level in a code fragment is determined by counting how many control structures (loops, if-statements) are embedded one inside another, starting the count from the outermost structure. A code fragment consisting of one conditional or loop nested inside another outer control structure has two nesting levels — the outer structure being level one and the structure embedded within it being level two — which is the standard way nesting depth is assessed for control-flow-based test design and coverage analysis in the ISTQB syllabus.
Community Discussion