In this paper, we describe an approach to query-based debugging for C++ programs that uses queries formulated in the object constraint language, OCL. By using OCL, together with UML, to formulate queries, debugging can begin early in the design phase. Queries can be formulated to verify design constraints such as invariants on classes and pre and post-conditions for member functions. These queries can be reused after code generation to verify the design contract, as part of the testing process, and to facilitate fault detection.