## 3 Data Preparations for Fault Localization
### Transformation Memory-Updated Patterns to Image Data and Labeling Memory-Updated Features  
CNN, which is a multilayer neural network in machine learning, has an advantage in that it directly recognizes the visual pattern of pixel images though minimum preprocessing. As the networks trains directly, it is operated by humans, but not affected by background knowledge. Therefore, using CNN, the updated feature can be automatically extracted from the learning process of the unit test without the intervention of the tester. In this way, it is possible to distinguish the class by identifying the updated feature in the inference process of the integration test. The memory-updated information is transformed into a snapshot, corresponding to a pixel in the image file, in order to be used more easily as an input to the CNN. The size of the transformed snapshot from the memory-updated information in each frame is defined as the height and width obtained by Equation (4), where the coordinate (x, y) of a point in the snapshot is mapped with each address, as in Equation (5). Here, the width is adjusted flexibly as it is in accordance with the collected memory size.  
\[\text{Height}=\text{min}\ \{\text{h}\in\text{N;}\ \text{h}\geq\text{(Number of Addresses}\div\text{Width)}\} \tag{4}\]  
\[\text{Address}=\text{y}\times\text{Width}+\text{x;}\ \text{(x,y)}\ \text{is the pixel position} \tag{5}\]  
Figure 6a shows an example of transform the memory-updated to snapshot. In the figure, the image file of snapshot has width 160 and height 184. From Equation (2), the memory-updated status of 29,440 addresses is marked as a red pixel when \(\text{MU}_{\text{A,k}}\) has a value of 1 and white when it has a value of 0. Because the coordinates of the marked points are (31,117), the address of the point is 18,751 (i.e., \(160\times 117+31\)). In Figure 6b, Test Index #1808 has IDUR frames 66-70 in Figure 5, and it generates the memory-updated status of each frame into the image file. As in the figure, the memory data of all of the frames is transformed into image files, and the transformed image file is used for the training phase of the unit test and as well as to detect the occurrence point of faults using a trained classifier in the integration test.  
The generated image files in unit test are labeled by class for training. First, because the frames 66-70 are classified as the application frame (IDUR) in Figure 5, as Equation (6) it is labeled class as application (App) and the other frames are infrastructure (Infra) class. The updated addresses of frames labeled as application are compared to the featured address of Figure 5(4) to check the unit function index and featured frame index. By Equations (7) and (8), find the updated address of the application  
Figure 6: Example of transforming memory-updated information into image files. (**a**) Example of a memory-updated snapshot; (**b**) transforming each frame into image files.  
frame in the featured addresses of each index as a unit function and featured frame and label the corresponding index number as class. The labeled image files are classified into the infrastructure, or have a unit function label and featured frame label in the application. The files are also used for the training data of the updated feature-classification model.  
\[\text{Class}_{\text{App,k}}=\left\{\begin{array}{ll}\text{App},&\text{k}\in \text{IDUR}\\ \text{Infra},&\text{k}\
otin\text{IDUR}\end{array}\right.;\text{ k is a frame-index number} \tag{6}\]  
\[\text{Class}_{\text{Function,k}}=\text{\#idx};\text{ MU}_{\alpha,k}=1,\text{ }\alpha\in\text{set of the featured addresses in unit function \#idx} \tag{7}\]  
\[\text{Class}_{\text{Feature,k}}=\text{\#idx};\text{ MU}_{\alpha,k}=1,\text{ }\alpha\in\text{set of the featured addresses in featured frame \#idx} \tag{8}\]