# Can Defect Prediction Be Useful for Coarse-Level Tasks of Software Testing?
## 1 Introduction  
Software testing (ST) is an necessary and vital activity in software quality assurance activities [1; 2; 3]. ST assists in finding defects (aka. bugs) to improve software reliability and quality [3; 4; 5]. Distributing test resources evenly makes defective and non-defective software entities (such as, class, file, function, subsystem) treated equally, which will lead to a waste of test resources (e.g., time, budget, software testers, etc.) or even do not meet the test objectives, especially with limited resource [6; 7]. Therefore, before performing ST, it is quite important to appropriately allocate the resources. Software defect prediction (SDP), which uses historical defect data including static code metrics (aka. features) and historical defect information (aka. labels) to predict the defect situations of entities via machine learning or deep learning techniques, is a good way to alleviate the issue mentioned above [8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18]. If there is lack of local historical defect data, cross-project defect data can be collected for SDP, named cross-project defect prediction (CPDP) [19; 20; 21; 22; 23; 24]. However, the granularity of prediction results relies on historical defect data and prediction models. That is, if the defect information is class-level and binary (i.e., the entity is defective or non-defective), only the machine learning algorithms that are able to implement binary classification targets are used to predict the class under test defect or not. For ST, generally, test methods can be divided into white-box testing (WBT), which focuses on source codes (such as code review, module or unit testing) and black-box testing (BBT), which is related to inputs and outputs of the system without internal structure (such as system testing or functional testing) [25]. We refer WBT and BBT as methods for fine- and coarse-level tasks of ST, respectively. Moreover, researchers or industrial practitioners proposed several approaches to design test cases and improve test quality for the two tasks [3; 26; 27]. For instance, [PERSON] et al. proposed a coverage-based test case prioritization (TCP) method by using the code coverage data of code units and the fault-proneness estimations to prioritize test cases [26]. The authors of [PERSON] et al. combined adaptive random sequence approach with clustering by applying black-box information to make TCP [27]. These authors wanted to refine test cases by using execution information to assist on resource allocation. From the summary above, SDP can be widely used without execution or code coverage information for fine-level tasks instead of coarse-level test tasks. However, how should managers or project leaders arrange the resources when they face on coarse-level test tasks? Can the defect prediction results provide some meaningful information for coarse-level test tasks? Based on the above motivation and need, in this study, we consider resource allocation for coarse-level tasks of ST as a single objective decision problem. We proposed a DP-based association hierarchy method (DPAHM) using incidence matrix and analytic hierarchy process (AHP). We conduct hierarchy framework that consists of three layers via AHP and analyze relationships between the inter-level (i.e., coarse- and fine-level) and intro-level (i.e., coarse- or fine-level) via incidence matrix, and then calculate the SDP result of the top-layer from AHP based on the SDP result of the bottom-layer, which also drives from AHP. The SDP result of the top-layer is the strategy for coarse-level test tasks. Besides, our contributions are as follows:  
1. We apply SDP and make use of the prediction information for coarse-level tasks of ST.
2. We combine AHP with incidence matrix to conduct an up-to-down association hierarchy framework. 3. We propose a defect prediction based on AHP and incidence matrix, and use an example to apply DPAHM. Moreover, our study aims at answering the following research questions (RQs):  
* RQ1: how is defect prediction used for coarse-level test tasks?