# Pattern-Based Test Suite Reduction Method for Smart Contracts
## 5 Test Results Analysis  
Smart contracts are executed in varied environments. Therefore, environments with standard parameters of commonly available hardware and system software should be used in smart contract testing. As far as the execution environment is concerned, the tests were carried out on a MacBook Air with the parameters shown in Table 5.  
First, performance tests were carried out on the evaluation time of a single smart contract. The dependence of this time on the number of verification rules was investigated. In this test, the verification time of a single transaction by a smart contract \(t_{k}^{sc}\) with \(k\) verification rules was assumed as the basic efficiency measure. To obtain the average value \begin{table}
\begin{tabular}{c c} \hline \hline
**Execution Environment Parameter** & **Execution Environment Value** \\ \hline Processor & Apple M2 \\ RAM & 16 GB \\ SSD & 256 GB \\ Operating system & macOS Sonoma 14.3.1 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Parameters of the test execution environment. of \(t_{k}^{sc}\), each test was repeated 50 times. The tests were performed for \(k\in\langle 1;8\rangle\) number of verification rules in the smart contract. A total of 400 tests were performed. Figure 8 presents test results of transaction evaluation time by a smart contract. Smart contract evaluation time values are within the range \(\langle 0.00079;0.00261\rangle\) ms. The dependence of the evaluation time on the number of verification rules in a smart contract can be approximated using a polynomial function \(y=-2.458\times 10^{-5}x^{2}+0.0005x+0.0003\), with the model fit quality measure \(R^{2}\) = 0.9934. The obtained result shows that the rule processing mechanism in the smart contract allows for limiting the evaluation time. If a rule returning a FALSE value occurs, further processing of the rule list is interrupted. For the first transaction only in each of the tested smart contracts, the full list of rules is verified. However, the most important was the performance tests that verify the evaluation time of the test suite prepared according to the \(k+1\) method. The basic performance metric for that test was the execution time of the test suite \(t_{k}^{suite}\) for the smart contract with \(k\) verification rules. Tests were performed for test suites with the number of test cases in the range \(T_{k}^{suite}\in\langle 2;9\rangle\). The number of all test cases was 44. Each test has been repeated 50 times to obtain an estimator of the mean value of \(t_{k}^{suite}\). Therefore, a total of 2200 tests were run. Figure 9 presents test results of test suite execution time for the number of test cases, \(T_{k}^{suite}\in\langle 2;9\rangle\). It can be concluded that the test suite execution time increases polynomially with the increase in the test case numbers. The dependence of execution time on the number of test cases can be approximated by the function \(y=4.809\times 10^{-5}x^{2}+0.0005x+0.0014\), with the model fit quality measure \(R^{2}\) = 0.991. Two variables overlap here as follows: the number of verification rules and the number of test cases in the test suite. As the number of verification rules increases, the number of test cases increases as well. The test suite execution times are within the range \(\langle 0.0016;0.0082\rangle\) ms. It should be underlined that the execution times of the test suites presented in the paper are four orders of magnitude shorter than those presented in the paper [7]. The currently performed tests are characterized by higher accuracy. Besides, the method allows for reducing the number of test transactions for testing the test set \(T_{k}^{set}\). Performance tests were conducted for smart contracts with the \(k\in\langle 1;8\rangle\) number of verification rules. According to Figure 5, 2 to 44 test transactions had to be prepared for them. Using the developed smart contract testing package, this was achieved by preparing just two to nine test transactions. Figure 8: Smart contract evaluation time, \(k\in\langle 1;8\rangle\).