Abstract
Characterizing unknown quantum states and measurements is a fundamental problem in quantum information processing. In this Letter, we provide a novel scheme to self-test local quantum systems using noncontextuality inequalities. Our work leverages the graph-theoretic framework for contextuality introduced by Cabello, Severini, and Winter, combined with tools from mathematical optimization that guarantee the unicity of optimal solutions. As an application, we show that the celebrated Klyachlco-Can-Binicioglu-Shumovsky inequality and its generalization to contextuality scenarios with odd n-cycle compatibility relations admit robust self-testing.