# ExtendAIST: Exploring the Space of AI-in-the-Loop System Testing
## 3 Extendaist
### Design
That is, if \(sc(n_{l}^{i},x_{1},x_{2})\wedge-sc(n_{l}^{k},x_{1},x_{2})\wedge(k\
eq i) \Rightarrow sc(n_{l+1}^{j},x_{1},x_{2})\), we say that \((n_{l}^{i},n_{l+1}^{j})\) is _sign-sign covered_ by \(x_{1}\) and \(x_{2}\) which is denoted as \(cov_{SS}(\alpha,x_{1},x_{2})\). * Distance-Sign cover. The small distance change of neurons in the \(l\)th layer can cause the sign change of decision neuron \(n_{l+1}^{j}\) in the next layer. Namely, if \(dc(h,l,x_{1},x_{2})\Rightarrow sc(n_{l+1}^{j},x_{1},x_{2})\), we say that \((n_{l}^{i},n_{l+1}^{j})\) is _distance-sign covered_ by \(x_{1}\) and \(x_{2}\), denoted as \(cov_{DS}^{h}(\alpha,x_{1},x_{2})\). * Sign-Value cover. Similar to sign-sign cover, the sign change of condition neuron \(n_{l}^{i}\) and signs of other neurons in the \(l\)th layer not changing affect the value of decision neuron \(n_{l+1}^{j}\) in the next layer. That is, if \(sc(n_{l}^{i},x_{1},x_{2})\wedge\
eg sc(n_{l}^{k},x_{1},x_{2})\wedge(k\
eq i) \Rightarrow vc(g,n_{l+1}^{j},x_{1},x_{2})\), we say that \((n_{l}^{i},n_{l+1}^{j})\) is _sign-value covered_ by \(x_{1}\) and \(x_{2}\), denoted as \(cov_{SV}^{g}(x_{1},x_{2})\). * Distance-Value cover. Similar to distance-sign cover, the small distance change of neurons in the \(l\)th layer leads to the value change of decision neuron \(n_{l+1}^{j}\) in the next layer. Namely, if \(dc(h,l,x_{1},x_{2})\Rightarrow vc(g,n_{l+1}^{j},x_{1},x_{2})\), then \((n_{l}^{i},n_{l+1}^{j})\) is _distance-value covered_ by \(x_{1}\) and \(x_{2}\), denoted as \(cov_{DV}^{h,g}(x,x_{1},x_{2})\). ### Test Data Generation (EP_TDG)

#### 4.2.1 Description

During training procedure, some common datasets are used as the training sets to compare the training performance of different training models. During testing procedure, the testing data included in the common datasets are used to measure the training effectiveness and correctness of AI-in-the-loop system. Thus, both training and testing procedures are data-driven. Since the AIS may output different labels for inputs with high similarity, generating test data that can cover not only major function behaviors but also corner-case behaviors becomes an indispensable activity for AI-in-the-loop system testing. Thus, test data generation is regarded as an extension point, namely EP_TDG, in ExtendAIST. Since various generation strategies and their variants have been investigated over the past decades, there are mainly four kinds of strategies present to generate test data: adversarial examples, generative adversarial examples, metamorphic testing based strategy, and concolic testing based strategy. These four kinds of common used strategies are also regarded as the sub-extension points, respectively: EP_AE, EP_GAE, EP_MT, and EP_CTS. All of these points allow designing the strategy of test data generation for ExtendAIST producing relevant test samples to train, test, and evaluate the AI-in-the-loop system. #### 4.2.2 Adversarial Examples (EP_AE)

Adversarial examples are test data generated with small, even imperceptible, perturbations on the original test inputs, which cause the network under test to misclassify them [18; 74; 75; 76; 18]. A neural network is vulnerable to adversarial perturbation, and adversarial examples are regarded as effective means to attack network. Therefore, debuggers can detect erroneous behaviors of AI-in-the-loop system by adversarial examples and enhance the robustness by re-training the AI-in-the-loop system against adversarial examples. The following techniques are implemented based on the sub-extension point EP_AE. * L-BFGS. The _box-constrained L-BFGS_[18] is proposed to generate test data to solve the following minimization problem under the condition of \(f(x^{{}^{\prime}})=t\). Equation (7) hopes to minimize the distance between \(x\) and \(x^{{}^{\prime}}\), \(L_{2}=\parallel x-x^{{}^{\prime}}\parallel_{2}^{2}\), and the loss function \(loss_{f,t}(x^{{}^{\prime}})\) for the generated test data \(x^{{}^{\prime}}\) also labeled as \(t\).