## 4 Data Representation: Runtime Events and Dataset
### Execution Trace (Level 3)
#### 4.3.1. Allocations and Resources (\(AllocMask\))  
At this third level, the execution trace includes events that can be represented at the VM (bytecode interpreter) level. For example, a program allocates various resources to facilitate processing and computing; these resources usually include dynamic memory for various data structures, file descriptors, string allocations, thread resources, etc. The execution of different test cases use different resources. Therefore, this level helps identify the similarities and differences between various test cases based on the fine-grain detail of resource allocations for the test cases, which can play a significant role in the testing and profiling process. The following are the major event types that can be traced and monitored; see Table 3 for specific event names and types. The mnemonic \(AllocMask\) denotes the union of all these various kinds of allocation events.  
* **Data-Structure Allocations**: this subcategory includes events that represent blocks of memory or resources, such as:
* _List Allocations_: includes events triggered when a list or a list element is allocated.
* _Table Allocations (hash tables or dictionaries)_: includes events that can be triggered to indicate that a hash table (_called a dictionary in some languages_) or an element of the table has been allocated.
* _Set Allocations_: includes events that can be triggered to indicate that a set, set element, or character set has been allocated.
* _Object Allocations_: includes events that can be triggered to indicate that an instance of a structure, class, or record has been allocated.  
\begin{table}
\begin{tabular}{l l l} \hline \hline
**Category** & **Event Code** & **Descriptions** \\ \hline \multirow{2}{*}{ListAlloc} & E\_List & List allocation \\  & E\_Lelem & List element allocation \\  & E\_Table & Table allocation \\  & E\_Telem & Table element allocation \\  & E\_Tvsubs & Substring table value allocation \\  & E\_Tvtbl & Table-element value allocation \\  & E\_Set & Set allocation \\  & E\_Selem & Set element allocation \\  & E\_Slots & Hash header allocation \\  & E\_Cset & Cset or character set allocation \\ \hline StrAlloc & E\_String & String allocation \\ \hline ObjAlloc & E\_Record & Record allocation \\  & E\_File & File allocation \\  & E\_Lgrimit & Large integer allocation \\ \multirow{2}{*}{MiscAlloc} & E\_Real & Real allocation \\  & E\_Refresh & Refresh allocation \\  & E\_Coexpr & Co-expression allocation \\ \hline \hline \end{tabular}
\end{table}
Table 3: Level 3 runtime events representing Allocations and Resources (\(AllocMask\)). These 17 kinds of events can be traced to identify the allocation activities of various resources used by a running test case. At _level 3_, each event is uniquely mapped to one type of allocation or resource. _Event codes and descriptions are from_[19].  
Figure 4: A sample of _level 3_ execution traces for a one test case, where the list has only one element.  
* **String Allocations**: includes events that can be triggered to indicate that an Immutable String block has been allocated.
* **Miscellaneous Allocations**: includes all other events that can be triggered to allocate resources such as file handlers, a thread, etc.