Abstract
Software testing is usually starts with the Unit testing phase. The goal of unit testing is to reveal logic and implementation errors in each unit. The unit testing process is usually costly and time-consuming especially when the system under test is very large. In addition, because of the time pressures, the testing team may not find time to fully test the product. Therefore, identifying the units that have most of the errors helps the testing team to focus on testing them to save time and resources. In this paper, we propose an approach for unit testing that weights each method using a combination of static object-oriented metrics. The proposed approach predicts the number of test cases necessary to test system methods. If assumes that complex methods contain more errors which require executing more test cases to test the complex methods. The goal of this work is to help software developers where to dedicate their available resources when performing unit testing. The experimental results on the studied Java systems show that how small number of test cases are needed and how those test cases detect a high percentage of errors.