We present a formal framework for notions related to testing and model based test generation for a behavioural subset of UML Statecharts (UMLSCs). This framework builds, on one hand, upon formal testing and conformance theory that has originally been developed in the context of process algebras and Labeled Transition Systems (LTSs), and, on the other hand, upon our previous work on formal semantics for UMLSCs. The paper covers the development of proper extensional testing preorders and equivalence for UMLSCs. We present an algorithm for testing equivalence verification which is based on an intensional characterization of the testing relations. Testing equivalence verification is reduced to bisimulation equivalence verification. We also address the issue of conformance testing and present a formal conformance relation together with a test case generation algorithm which is proved sound and exhaustive w.r.t. the conformance relation. We show results on the formal relationship of the tes...