# Can Defect Prediction Be Useful for Coarse-Level Tasks of Software Testing?
## 4 Case Study
### Apply Our Method to MC  
#### 4.3.1 The First Phase  
According to the test requirement, _MC_ needs to be checked by system testing, integration testing, and unit testing. For coarse-level tasks, the call relationship is derived from development specifications (or documents) and software development engineers. Our goal is to make system testing about three tasks, which is implemented by calling four integration functions. For fine-level tasks, the relationship is gained by the code and specifications. Besides, the functions, which will be tested in the integration testing process, call thirteen files (units), which will be checked by unit testing. After the analysis, we complement the first phase of our method. The structure of MC is divided into Goal-layer, Criteria-layer, and Alternatives layer. Our target is to obtain the resource allocation strategy of ST for _MC_. Moreover, there are two sublayers in Criteria-layer. The whole structure \begin{table}
\begin{tabular}{l l l} \hline \hline
**ID** & **Name** & **Description** \\ \hline Task1 (T1) & Stress Calculation Task & Collect AD current signal and convert the current value to air spring press signal by AD conversion module. The effective range of current signal is 4\(\sim\)20 mA. \\ Task2 (T2) & Frame Number Acquisition Task & Collect four channels of AD voltage signal and convert the analog signal through AD conversion module, and determine the car number and bogie ID by the analog signal. The voltage signal that is \(<\)2.7 V corresponds to position number 0 and the voltage signal \(\geq\)2.7 V corresponds to position number 1. \\ Task3 (T3) & Mass Weight Calculation Task & Calculate the mass weight by the air spring pressure and the frame information. \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The Basic Information about Coarse-level Tasks of MC. \begin{table}
\begin{tabular}{l l l l l l l l l l l l} \hline \hline
**ID** & **File Name** & **\#Metrics** & **LOC** & \(\mathbf{vg}\) & \(\mathbf{e(vg)}\) & \(\mathbf{N_{1}}\) & \(\mathbf{N_{2}}\) & \(\mathbf{\eta_{1}}\) & \(\mathbf{\eta_{2}}\) & \(\mathbf{N}\) & \(\mathbf{V}\) \\ \hline A1 & AD Sample & 48 & 137 & 6 & 1 & 48 & 67 & 13 & 18 & 115 & 569 \\ A2 & AD Value Acquisition & 48 & 367 & 1 & 1 & 9 & 47 & 2 & 9 & 56 & 193 \\ A3 & Analog In Press Processing & 48 & 408 & 6 & 1 & 90 & 130 & 11 & 30 & 220 & 1178 \\ A4 & Analog Condition Calculation & 48 & 1049 & 29 & 1 & 188 & 524 & 13 & 54 & 712 & 4319 \\ A5 & Rescale Press Value & 48 & 266 & 3 & 1 & 27 & 41 & 9 & 8 & 68 & 277 \\ A6 & Read BCD ID & 48 & 373 & 1 & 1 & 12 & 76 & 1 & 17 & 88 & 366 \\ A7 & BCD ID Bit Value Calculation & 48 & 257 & 2 & 1 & 6 & 5 & 5 & 2 & 11 & 30 \\ A8 & Bogie ID Identification & 48 & 464 & 5 & 1 & 53 & 173 & 8 & 27 & 226 & 1159 \\ A9 & BCU ID Bit to Byte & 48 & 365 & 11 & 1 & 27 & 36 & 7 & 1 & 63 & 189 \\ A10 & Car Type Identify & 48 & 298 & 5 & 1 & 7 & 12 & 3 & 1 & 19 & 38 \\ A11 & Mass Calculation & 48 & 873 & 49 & 1 & 152 & 326 & 15 & 60 & 478 & 2977 \\ A12 & Mass Valid Arrange & 48 & 290 & 1 & 1 & 10 & 26 & 3 & 9 & 36 & 129 \\ A13 & Fixed Weight Factor Calculation & 48 & 387 & 6 & 1 & 26 & 60 & 11 & 9 & 86 & 371 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The Basic information bout Thirteen Files from Fine-level tasks of MC. \begin{table}
\begin{tabular}{l l l} \hline \hline
**ID** & **Name** & **Description** \\ \hline Function1 (F1) & AD calculation Function & Calculate AD value by sampling AD. \\ Function2 (F2) & Press calculation Function & Calculate the press and rescale the press value. \\ Function3 (F3) & Read Bogie ID Function & Convert ID bit value to byte, and calculate the Bogie ID. \\ Function4 (F4) & Mass Weight Calculation & When the mass weight signal is valid, Calculate the weight. \\ Function & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The Basic Information about Four Functions from Fine-level Tasks of MC. is conducted as Figure 2 indicated. As the figure depicted, the inter-layers and intro-layers are interdependent.