Testing object-oriented software is complex and costly. A strategy to incrementally testing and integrating components (classes or methods) in object-oriented software while minimizing the number of test stubs has been proposed. This reduces testing efforts and thereby reduces testing cost and enhances testing efficiency. However, an important issue of how to select an appropriate component test order remains. This paper presents a new approach to test order generation that requires (near) optimal number of test stubs by exploiting heuristics based on a dependency graph constructed from a given object-oriented model. Our approach offers several benefits. First, it is simpler and more efficient than most other graph-based approaches with an improved complexity of quadratic polynomial time in the number of components. Second, it is deterministic and thus, the resulting test order is not biased by randomness. Finally, it is flexible in that it can be applied to object-oriented models at different levels of detail. The paper describes the proposed approach and gives two illustrations, one of which is a case study of an application system in telecommunication.