# Application of Software Data Analysis Model Based on K-Means Clustering Algorithm

Authors: Wenhai Qiu
Journal: Security and Communication Networks
 (2022)

---

## Abstract

In order to improve the anomaly detection ability of portable multidimensional control software test data, a software test data anomaly detection method based on K-means clustering is proposed. The abnormal data distribution structure model of portable multidimensional control software testing is constructed. The fuzzy semantic feature reconstruction method is adopted to identify the fuzzy parameters of portable multidimensional control software and extract the feature quantity of associated information. According to the evolution distribution of associated features, the joint combination feature analysis method is adopted to realize the fuzzy clustering center detection of abnormal data of portable multidimensional control software test, and the fusion of abnormal feature distribution is carried out to complete the joint multidimensional feature detection. The K-means clustering method is used for effective data combination control in portable multidimensional control software to extract and detect abnormal features of test data in portable multidimensional control software. Experimental results show that the accuracy of anomaly detection of software test data by the proposed method is always greater than 0.8.Conclusion. Using this method to detect abnormal data of portable multidimensional control software test has higher accuracy and better detection performance.


---

## Body

## 1. Introduction

Computer software is an important part of the information industry and plays a vital role in the national economy, social development, and national defense construction. Its reliability has always been the focus of academic and industrial circles. One of the important ways to improve the quality of the software is to carry out a lot of testing before the software is put into use and discover the defects and even errors in time. Software testing includes many links, such as generating test data, executing the software under test, and evaluating test results [1].With the increasing scale and complexity of software, the possibility of defects or errors in software gradually increases. On the other hand, people’s requirements for software quality are also increasing. Therefore, software testing costs more and more manpower and material resources. The efficiency of software testing can be greatly improved, and the cost of software testing can be reduced if each link of testing can be automated.According to the different stages of software development, software testing can be divided into unit testing, integration testing, confirmation testing, and system testing [2]. The unit test mainly tests the correctness of the smallest component unit (module) of the program. The integration test will assemble the modules that have passed the unit test and then test the architecture of the assembled modules. The confirmation test mainly checks whether the finished software can complete various functions specified in requirements and specifications and whether the software configuration is correct [3]. The system test puts the software that has completed the confirmation test into the actual running environment and combines it with other systems for testing.


## 2. Literature Review

With the continuous development of software technology, software testing technology has also been paid attention to. Besides, software testing ideas, testing methods, and testing tools have made great progress. Especially since the beginning of the century, the evaluation of software testing has a certain quantitative standard, and software measurement technology began to get attention. Kotsareva et al. designed the method of process measurement management and pointed out that responsible software development companies need to measure the software testing process [4]. Tochino et al. put forward a software measurement method, scientifically organize the whole process of the software, and also put forward a method that can be used for many times [5]. Ferrer et al. proposed a goal-driven model. This goal-driven model is different from the traditional object-oriented method but adopts the goal-oriented method, combines the software goal with the whole development process and product quality, and measures it step by step. This top-down approach to goal quality definition makes the measurement of the entire software comprehensive and straightforward [6]. Strandberg et al. proposed a method of abnormal feature mining and feature detection for portable multidimensional control software testing based on particle swarm evolutionary optimization control. The fuzzy C-means clustering method is used to mine the abnormal data of portable multidimensional control software testing. Combined with the detection of fuzziness, the abnormal classification and identification of portable multidimensional control software testing are realized. However, this method has a large computational load for the abnormal detection of portable multidimensional control software testing [7]. Dang et al. proposed an anomaly detection method for portable multidimensional control software testing based on fusion scheduling of multisource information resources as a service (MIRaaS). A fuzzy decision algorithm was used to detect abnormal data in portable multidimensional control software testing. The fuzzy detection of this method is not good, and the mining accuracy of abnormal test data is not high [8]. To solve the above problems, this paper proposes a software test data anomaly detection method based on K-means clustering. First, the abnormal data distribution structure model of portable multidimensional control software test data is built, and the abnormal feature distribution fusion model of portable multidimensional control software test data is established. Then, joint multidimensional feature detection is used to realize fuzzy weight analysis and adaptive learning of the test data of portable multidimensional control software, and the K-means clustering method is used to implement effective data combination control in portable multidimensional control software to realize abnormal feature detection. Finally, the reliability and superiority of the proposed method in improving the abnormal detection ability of portable multidimensional control software testing are demonstrated by simulation test analysis.


## 3. The Research Methods

### 3.1. Portable Multidimensional Control Software Testing Anomaly Data Mining and Distribution Structure

#### 3.1.1. Portable Multidimensional Control Software Testing Anomaly Data Mining

In order to detect and mine abnormal data of portable multidimensional control software testing, a feature extraction model of portable multidimensional control software testing was established. The constraint feature quantity reflecting the security level of portable multidimensional control software was constructed, the fuzzy degree of portable multidimensional control software test was detected by combining linear programming and interpolation fitting method, and the overall structural model of portable multidimensional control software test anomaly detection was obtained [9, 10], as shown in Figure 1.Figure 1
Overall structure model of anomaly detection for portable multidimensional control software testing.According to the overall structure model in Figure1, information fusion and process combination control of portable multidimensional control software testing are carried out. The time distribution sequence of the portable multidimensional control software test was carried out in heterogeneous space, and the semantic search method was adopted to obtain the text distribution sequence of the portable multidimensional control software test as follows (1) [11]:(1)Ea1,a2=α⋅LA+β⋅YBA+γ1∫BGQ−a12dxdy+γ2∫BGQ−a22dxdy,where a1 and a2, respectively, denote portable multidimensional control software testing data matching coefficient, a1 denotes the average detection coefficient, coefficient a2 for the fuzzy degree of detection, LA denotes portable multidimensional control the length of the abnormal distribution of software testing, YBA denotes the distribution features of the software test cases, α for portable multidimensional control coefficient, β is the rough matching set, γ1 is the one-dimensional joint feature component, γ2 is the two-dimensional joint feature component, and Q is the weighted component of abnormal data.Let the membership function at the joint detection nodeK of the current portable multidimensional control software test data be denoted as K=K1,K2,K3,…,Kn. The spatial distribution sequence of metadata of portable multidimensional control software test data is r1,r2,…,rn, C,H is the correlation constraint function of portable multidimensional control software test [12], and the information correlation degree of portable multidimensional control software test is obtained as follows:(2)CK=1/λ∑i=0λ+1gheh−i−ϑ21/λ∑i=0λ+1gheh−i−ϑ21/2,HK=1/λ∑i=0λ+1gheh−i−ϑ31/λ∑i=0λ+1gheh−i−ϑ22,where λ is the sample category parameter, gh is the prior feature quantity of the detected data, eh is the fuzzy sample distribution set, i is the length of the data distribution, and ϑ is the dimension of multidimensional control. Based on the above analysis, the abnormal data mining model of portable multidimensional control software testing is constructed, and the abnormal characteristics analysis of portable multidimensional control software testing is realized based on spatial information fusion [13].


#### 3.1.2. Portable Multidimensional Control Software Test Anomaly Feature Location

Fuzzy parameter identification of portable multidimensional control software is carried out by using the fuzzy semantic feature reconstruction method, and the feature quantity of associated information of data in portable multidimensional control software is extracted. The difference degree function of fuzzy semantic feature reconstruction is expressed as follows (3) [14]:(3)Z=3Udhcosiμfc×∑i=1h+1cisin12μfca3h+i+12+ω,where d is the change information of program modules, h is the distribution length of abnormal data of portable multidimensional control software, μ is the gradient information component, fc is the combined parameter of project metadata, U is the edge feature set, a3 is the defect report parameter, and ω is the correlation coefficient of program modules. Through the correlation and fusion control of defect report and program module, the spatial combination function of abnormal feature distribution of transplanted multidimensional control software test can be obtained as follows:(4)fl=vf1t,f2t,…,fnt∏i=13fti=2δ2∑1/4exp14ft−δ∑1/4ft−δ∏i=13fti.Inft=f1t,f2t,…,fnt, which is the standardized quantitative parameter set of defect report, υ is the special characters removed from the anomaly test, ft is the degree of connection between words, fti is the template detection coefficient, fti is the defect class function. Semantic attribute distribution detection and generalization learning algorithm are adopted to conduct the association information fusion of portable multidimensional control software test. If Fk∈Z is A repeated or similar defect parameter, the following results can be obtained:(5)W=OT<Wi<σT=fpσT2+fpT2,where O is the text similarity of the defect report, Wi is the text ambiguity of the defect report, fp is the fitness function, σ is the number of shared words, T is the fuzzy test component. Fk,Hk and F1,H1 are set as abnormal feature quantities of portable multidimensional control software test data, and the K-means algorithm is used to realize detection optimization of abnormal test data [15].


#### 3.1.3. K-Means Algorithm

The clustering algorithm is a kind of unsupervised machine learning algorithm. According to the similarity between texts, a kind of text with high similarity is aggregated into the same cluster according to certain rules, and finally, the set of these clusters is obtained.K-means algorithm, proposed by Stuart Lloyd [16], is a classic clustering algorithm based on partition and is widely used in the field of text clustering. The basic principle of the K-means algorithm is to select several texts from the data set as the initial clustering center, calculate the distance between each data and the clustering center, assign them to the nearest cluster, then recalculate the center of the cluster, and iterate the above process until the criterion function converges or reaches the maximum number of iterations.The K-means algorithm is simple. And its calculation speed is fast. The clustering effect is also good, but there are also some obvious defects: the initial clustering centers need to be given in advance, but before the clustering result is completed, it is difficult to estimate the appropriate number and configuration of clustering centers. If an inappropriate initial object is selected, not only the efficiency of the algorithm will be greatly affected but also the clustering effect will be affected.The basic idea of the K-means algorithm [17] is to give a data set containing sample data and give the number of clustering. First, select randomly: then, according to the similarity measurement function, the iterative method is adopted to calculate the distance between the undivided sample data and the center point of each cluster and divide the sample data into the cluster where the nearest cluster center is located. For each allocated cluster, by calculating the average value of all data in the cluster, the cluster is constantly moved and redivided until the sum of squares of errors within the cluster is minimum, and there is no change. The algorithm has a feature that each iteration should judge whether each sample data are correctly divided into clusters. If not, it will be readjusted. After all the data are adjusted, the cluster class center is modified for the next iteration calculation. If each data sample is assigned to the correct class during an iteration, the clustering center will not be adjusted. The clustering center is stable and no longer changes, indicating that the objective function converges, and the algorithm ends. Finally, the clustering result is evaluated [18]. K-means clustering algorithm flow chart is shown in Figure 2.Figure 2
Flow chart of K-means clustering algorithm.


### 3.2. Optimization of Abnormal Detection for Portable Multidimensional Control Software Testing

#### 3.2.1. Feature Clustering for Portable Multidimensional Control Software Testing

According to the evolution distribution of association features, the joint combination feature analysis method is adopted to realize the fuzzy clustering center detection of abnormal data of portable multidimensional control software testing, build the clustering model of abnormal data of portable multidimensional control software testing, and obtain the item set of big data distribution association rules of portable multidimensional control software testing as shown in the following formula:(6)M=Wfz1+fz2+⋯+fzn≥T=∫∫Z≥T⋯∫fp1,p2,…,pn12λ1Zhft+ω,where fz1+fz2+⋯+fzn for portable multidimensional control software testing coefficient of feature point sampling time window, fp1,p2,…,pn denote time matching function. Combined with the method of text similarity and stack trace similarity detection, the statistical information distribution of the portable multidimensional control software test was obtained, and the abnormal data detection function of the portable multidimensional control software test was obtained as shown in the following formula:(7)fn=Ti+10exp0.51Sx∑d=13Hd+exp1b∑d=13sin12Hd,where Ti is the classification domain value of portable multidimensional control software testing fuzzy clustering, b is anomaly detection offset coefficient, Sx is text similarity, Hd is stack control coefficient. According to the difference degree between program module d and program module e, the output of feature clustering to portable multidimensional control software test is shown in the following formula:(8)J=∑j=13jk2ln1+jp−∑i=13eigi,where jk is the probability density function of spectrum feature alignment of portable multidimensional control software test, and jp is the probability density function of abnormal detection of portable multidimensional control software test. Therefore, joint multidimensional feature detection is adopted to realize fuzzy weight analysis and adaptive learning for test data of portable multidimensional control software [19], and the K-means clustering method is adopted to carry out effective data combination control in portable multidimensional control software.


#### 3.2.2. Anomaly Detection Output

The feature extraction model of portable multidimensional control software testing is established to improve the abnormal analysis ability of portable multidimensional control software testing. The discriminant function of abnormal data detection of portable multidimensional control software testing in the random vector distribution space is shown in the following formula:(9)fa=fj^fjk=W+12ln1+xtIk+fm,where f^j represents the observation sequence of abnormal data flow of portable multidimensional control software test, xt is the normalized error, fm is the fuzzy membership function, and Ik is the joint error of abnormal clustering distribution of portable multidimensional control software test data.In the complex defects program module, portable multidimensional control of software test data under the abnormal distribution difference function is of the following type:(10)fh=∑y=1ya+ybMxi,xk−ζ,where ya and yb are the boundary coefficient and template coefficient detected by test data of portable multidimensional control software, Mxi,xk is the ratio of defect repair times to defect repair values of all files, and ζ is the anomaly detection threshold. According to the test feature extraction results of portable multidimensional control software, the distributed attribute fusion of portable multidimensional control software test is carried out, and the training sample set of detection function is obtained as a1,b1,a2,b2,…,an,bn. Through semantic ontology fusion, the heterogeneous function of portable multidimensional control software test data K-means clustering is obtained as the following formula:(11)min∑j=1fpψjfnτj,where ψj and τj denote portable multidimensional control software testing anomaly detection of confidence level and convolution, based on the analysis of the K-means clustering method of the portable multidimensional control software of data combination control effectively [20], realize portable multidimensional abnormal control software testing data of feature extraction and detection, and measuring process is shown in Figure 3.Figure 3
Portable multidimensional control software testing process.


## 3.1. Portable Multidimensional Control Software Testing Anomaly Data Mining and Distribution Structure

### 3.1.1. Portable Multidimensional Control Software Testing Anomaly Data Mining

In order to detect and mine abnormal data of portable multidimensional control software testing, a feature extraction model of portable multidimensional control software testing was established. The constraint feature quantity reflecting the security level of portable multidimensional control software was constructed, the fuzzy degree of portable multidimensional control software test was detected by combining linear programming and interpolation fitting method, and the overall structural model of portable multidimensional control software test anomaly detection was obtained [9, 10], as shown in Figure 1.Figure 1
Overall structure model of anomaly detection for portable multidimensional control software testing.According to the overall structure model in Figure1, information fusion and process combination control of portable multidimensional control software testing are carried out. The time distribution sequence of the portable multidimensional control software test was carried out in heterogeneous space, and the semantic search method was adopted to obtain the text distribution sequence of the portable multidimensional control software test as follows (1) [11]:(1)Ea1,a2=α⋅LA+β⋅YBA+γ1∫BGQ−a12dxdy+γ2∫BGQ−a22dxdy,where a1 and a2, respectively, denote portable multidimensional control software testing data matching coefficient, a1 denotes the average detection coefficient, coefficient a2 for the fuzzy degree of detection, LA denotes portable multidimensional control the length of the abnormal distribution of software testing, YBA denotes the distribution features of the software test cases, α for portable multidimensional control coefficient, β is the rough matching set, γ1 is the one-dimensional joint feature component, γ2 is the two-dimensional joint feature component, and Q is the weighted component of abnormal data.Let the membership function at the joint detection nodeK of the current portable multidimensional control software test data be denoted as K=K1,K2,K3,…,Kn. The spatial distribution sequence of metadata of portable multidimensional control software test data is r1,r2,…,rn, C,H is the correlation constraint function of portable multidimensional control software test [12], and the information correlation degree of portable multidimensional control software test is obtained as follows:(2)CK=1/λ∑i=0λ+1gheh−i−ϑ21/λ∑i=0λ+1gheh−i−ϑ21/2,HK=1/λ∑i=0λ+1gheh−i−ϑ31/λ∑i=0λ+1gheh−i−ϑ22,where λ is the sample category parameter, gh is the prior feature quantity of the detected data, eh is the fuzzy sample distribution set, i is the length of the data distribution, and ϑ is the dimension of multidimensional control. Based on the above analysis, the abnormal data mining model of portable multidimensional control software testing is constructed, and the abnormal characteristics analysis of portable multidimensional control software testing is realized based on spatial information fusion [13].


### 3.1.2. Portable Multidimensional Control Software Test Anomaly Feature Location

Fuzzy parameter identification of portable multidimensional control software is carried out by using the fuzzy semantic feature reconstruction method, and the feature quantity of associated information of data in portable multidimensional control software is extracted. The difference degree function of fuzzy semantic feature reconstruction is expressed as follows (3) [14]:(3)Z=3Udhcosiμfc×∑i=1h+1cisin12μfca3h+i+12+ω,where d is the change information of program modules, h is the distribution length of abnormal data of portable multidimensional control software, μ is the gradient information component, fc is the combined parameter of project metadata, U is the edge feature set, a3 is the defect report parameter, and ω is the correlation coefficient of program modules. Through the correlation and fusion control of defect report and program module, the spatial combination function of abnormal feature distribution of transplanted multidimensional control software test can be obtained as follows:(4)fl=vf1t,f2t,…,fnt∏i=13fti=2δ2∑1/4exp14ft−δ∑1/4ft−δ∏i=13fti.Inft=f1t,f2t,…,fnt, which is the standardized quantitative parameter set of defect report, υ is the special characters removed from the anomaly test, ft is the degree of connection between words, fti is the template detection coefficient, fti is the defect class function. Semantic attribute distribution detection and generalization learning algorithm are adopted to conduct the association information fusion of portable multidimensional control software test. If Fk∈Z is A repeated or similar defect parameter, the following results can be obtained:(5)W=OT<Wi<σT=fpσT2+fpT2,where O is the text similarity of the defect report, Wi is the text ambiguity of the defect report, fp is the fitness function, σ is the number of shared words, T is the fuzzy test component. Fk,Hk and F1,H1 are set as abnormal feature quantities of portable multidimensional control software test data, and the K-means algorithm is used to realize detection optimization of abnormal test data [15].


### 3.1.3. K-Means Algorithm

The clustering algorithm is a kind of unsupervised machine learning algorithm. According to the similarity between texts, a kind of text with high similarity is aggregated into the same cluster according to certain rules, and finally, the set of these clusters is obtained.K-means algorithm, proposed by Stuart Lloyd [16], is a classic clustering algorithm based on partition and is widely used in the field of text clustering. The basic principle of the K-means algorithm is to select several texts from the data set as the initial clustering center, calculate the distance between each data and the clustering center, assign them to the nearest cluster, then recalculate the center of the cluster, and iterate the above process until the criterion function converges or reaches the maximum number of iterations.The K-means algorithm is simple. And its calculation speed is fast. The clustering effect is also good, but there are also some obvious defects: the initial clustering centers need to be given in advance, but before the clustering result is completed, it is difficult to estimate the appropriate number and configuration of clustering centers. If an inappropriate initial object is selected, not only the efficiency of the algorithm will be greatly affected but also the clustering effect will be affected.The basic idea of the K-means algorithm [17] is to give a data set containing sample data and give the number of clustering. First, select randomly: then, according to the similarity measurement function, the iterative method is adopted to calculate the distance between the undivided sample data and the center point of each cluster and divide the sample data into the cluster where the nearest cluster center is located. For each allocated cluster, by calculating the average value of all data in the cluster, the cluster is constantly moved and redivided until the sum of squares of errors within the cluster is minimum, and there is no change. The algorithm has a feature that each iteration should judge whether each sample data are correctly divided into clusters. If not, it will be readjusted. After all the data are adjusted, the cluster class center is modified for the next iteration calculation. If each data sample is assigned to the correct class during an iteration, the clustering center will not be adjusted. The clustering center is stable and no longer changes, indicating that the objective function converges, and the algorithm ends. Finally, the clustering result is evaluated [18]. K-means clustering algorithm flow chart is shown in Figure 2.Figure 2
Flow chart of K-means clustering algorithm.


## 3.1.1. Portable Multidimensional Control Software Testing Anomaly Data Mining

In order to detect and mine abnormal data of portable multidimensional control software testing, a feature extraction model of portable multidimensional control software testing was established. The constraint feature quantity reflecting the security level of portable multidimensional control software was constructed, the fuzzy degree of portable multidimensional control software test was detected by combining linear programming and interpolation fitting method, and the overall structural model of portable multidimensional control software test anomaly detection was obtained [9, 10], as shown in Figure 1.Figure 1
Overall structure model of anomaly detection for portable multidimensional control software testing.According to the overall structure model in Figure1, information fusion and process combination control of portable multidimensional control software testing are carried out. The time distribution sequence of the portable multidimensional control software test was carried out in heterogeneous space, and the semantic search method was adopted to obtain the text distribution sequence of the portable multidimensional control software test as follows (1) [11]:(1)Ea1,a2=α⋅LA+β⋅YBA+γ1∫BGQ−a12dxdy+γ2∫BGQ−a22dxdy,where a1 and a2, respectively, denote portable multidimensional control software testing data matching coefficient, a1 denotes the average detection coefficient, coefficient a2 for the fuzzy degree of detection, LA denotes portable multidimensional control the length of the abnormal distribution of software testing, YBA denotes the distribution features of the software test cases, α for portable multidimensional control coefficient, β is the rough matching set, γ1 is the one-dimensional joint feature component, γ2 is the two-dimensional joint feature component, and Q is the weighted component of abnormal data.Let the membership function at the joint detection nodeK of the current portable multidimensional control software test data be denoted as K=K1,K2,K3,…,Kn. The spatial distribution sequence of metadata of portable multidimensional control software test data is r1,r2,…,rn, C,H is the correlation constraint function of portable multidimensional control software test [12], and the information correlation degree of portable multidimensional control software test is obtained as follows:(2)CK=1/λ∑i=0λ+1gheh−i−ϑ21/λ∑i=0λ+1gheh−i−ϑ21/2,HK=1/λ∑i=0λ+1gheh−i−ϑ31/λ∑i=0λ+1gheh−i−ϑ22,where λ is the sample category parameter, gh is the prior feature quantity of the detected data, eh is the fuzzy sample distribution set, i is the length of the data distribution, and ϑ is the dimension of multidimensional control. Based on the above analysis, the abnormal data mining model of portable multidimensional control software testing is constructed, and the abnormal characteristics analysis of portable multidimensional control software testing is realized based on spatial information fusion [13].


## 3.1.2. Portable Multidimensional Control Software Test Anomaly Feature Location

Fuzzy parameter identification of portable multidimensional control software is carried out by using the fuzzy semantic feature reconstruction method, and the feature quantity of associated information of data in portable multidimensional control software is extracted. The difference degree function of fuzzy semantic feature reconstruction is expressed as follows (3) [14]:(3)Z=3Udhcosiμfc×∑i=1h+1cisin12μfca3h+i+12+ω,where d is the change information of program modules, h is the distribution length of abnormal data of portable multidimensional control software, μ is the gradient information component, fc is the combined parameter of project metadata, U is the edge feature set, a3 is the defect report parameter, and ω is the correlation coefficient of program modules. Through the correlation and fusion control of defect report and program module, the spatial combination function of abnormal feature distribution of transplanted multidimensional control software test can be obtained as follows:(4)fl=vf1t,f2t,…,fnt∏i=13fti=2δ2∑1/4exp14ft−δ∑1/4ft−δ∏i=13fti.Inft=f1t,f2t,…,fnt, which is the standardized quantitative parameter set of defect report, υ is the special characters removed from the anomaly test, ft is the degree of connection between words, fti is the template detection coefficient, fti is the defect class function. Semantic attribute distribution detection and generalization learning algorithm are adopted to conduct the association information fusion of portable multidimensional control software test. If Fk∈Z is A repeated or similar defect parameter, the following results can be obtained:(5)W=OT<Wi<σT=fpσT2+fpT2,where O is the text similarity of the defect report, Wi is the text ambiguity of the defect report, fp is the fitness function, σ is the number of shared words, T is the fuzzy test component. Fk,Hk and F1,H1 are set as abnormal feature quantities of portable multidimensional control software test data, and the K-means algorithm is used to realize detection optimization of abnormal test data [15].


## 3.1.3. K-Means Algorithm

The clustering algorithm is a kind of unsupervised machine learning algorithm. According to the similarity between texts, a kind of text with high similarity is aggregated into the same cluster according to certain rules, and finally, the set of these clusters is obtained.K-means algorithm, proposed by Stuart Lloyd [16], is a classic clustering algorithm based on partition and is widely used in the field of text clustering. The basic principle of the K-means algorithm is to select several texts from the data set as the initial clustering center, calculate the distance between each data and the clustering center, assign them to the nearest cluster, then recalculate the center of the cluster, and iterate the above process until the criterion function converges or reaches the maximum number of iterations.The K-means algorithm is simple. And its calculation speed is fast. The clustering effect is also good, but there are also some obvious defects: the initial clustering centers need to be given in advance, but before the clustering result is completed, it is difficult to estimate the appropriate number and configuration of clustering centers. If an inappropriate initial object is selected, not only the efficiency of the algorithm will be greatly affected but also the clustering effect will be affected.The basic idea of the K-means algorithm [17] is to give a data set containing sample data and give the number of clustering. First, select randomly: then, according to the similarity measurement function, the iterative method is adopted to calculate the distance between the undivided sample data and the center point of each cluster and divide the sample data into the cluster where the nearest cluster center is located. For each allocated cluster, by calculating the average value of all data in the cluster, the cluster is constantly moved and redivided until the sum of squares of errors within the cluster is minimum, and there is no change. The algorithm has a feature that each iteration should judge whether each sample data are correctly divided into clusters. If not, it will be readjusted. After all the data are adjusted, the cluster class center is modified for the next iteration calculation. If each data sample is assigned to the correct class during an iteration, the clustering center will not be adjusted. The clustering center is stable and no longer changes, indicating that the objective function converges, and the algorithm ends. Finally, the clustering result is evaluated [18]. K-means clustering algorithm flow chart is shown in Figure 2.Figure 2
Flow chart of K-means clustering algorithm.


## 3.2. Optimization of Abnormal Detection for Portable Multidimensional Control Software Testing

### 3.2.1. Feature Clustering for Portable Multidimensional Control Software Testing

According to the evolution distribution of association features, the joint combination feature analysis method is adopted to realize the fuzzy clustering center detection of abnormal data of portable multidimensional control software testing, build the clustering model of abnormal data of portable multidimensional control software testing, and obtain the item set of big data distribution association rules of portable multidimensional control software testing as shown in the following formula:(6)M=Wfz1+fz2+⋯+fzn≥T=∫∫Z≥T⋯∫fp1,p2,…,pn12λ1Zhft+ω,where fz1+fz2+⋯+fzn for portable multidimensional control software testing coefficient of feature point sampling time window, fp1,p2,…,pn denote time matching function. Combined with the method of text similarity and stack trace similarity detection, the statistical information distribution of the portable multidimensional control software test was obtained, and the abnormal data detection function of the portable multidimensional control software test was obtained as shown in the following formula:(7)fn=Ti+10exp0.51Sx∑d=13Hd+exp1b∑d=13sin12Hd,where Ti is the classification domain value of portable multidimensional control software testing fuzzy clustering, b is anomaly detection offset coefficient, Sx is text similarity, Hd is stack control coefficient. According to the difference degree between program module d and program module e, the output of feature clustering to portable multidimensional control software test is shown in the following formula:(8)J=∑j=13jk2ln1+jp−∑i=13eigi,where jk is the probability density function of spectrum feature alignment of portable multidimensional control software test, and jp is the probability density function of abnormal detection of portable multidimensional control software test. Therefore, joint multidimensional feature detection is adopted to realize fuzzy weight analysis and adaptive learning for test data of portable multidimensional control software [19], and the K-means clustering method is adopted to carry out effective data combination control in portable multidimensional control software.


### 3.2.2. Anomaly Detection Output

The feature extraction model of portable multidimensional control software testing is established to improve the abnormal analysis ability of portable multidimensional control software testing. The discriminant function of abnormal data detection of portable multidimensional control software testing in the random vector distribution space is shown in the following formula:(9)fa=fj^fjk=W+12ln1+xtIk+fm,where f^j represents the observation sequence of abnormal data flow of portable multidimensional control software test, xt is the normalized error, fm is the fuzzy membership function, and Ik is the joint error of abnormal clustering distribution of portable multidimensional control software test data.In the complex defects program module, portable multidimensional control of software test data under the abnormal distribution difference function is of the following type:(10)fh=∑y=1ya+ybMxi,xk−ζ,where ya and yb are the boundary coefficient and template coefficient detected by test data of portable multidimensional control software, Mxi,xk is the ratio of defect repair times to defect repair values of all files, and ζ is the anomaly detection threshold. According to the test feature extraction results of portable multidimensional control software, the distributed attribute fusion of portable multidimensional control software test is carried out, and the training sample set of detection function is obtained as a1,b1,a2,b2,…,an,bn. Through semantic ontology fusion, the heterogeneous function of portable multidimensional control software test data K-means clustering is obtained as the following formula:(11)min∑j=1fpψjfnτj,where ψj and τj denote portable multidimensional control software testing anomaly detection of confidence level and convolution, based on the analysis of the K-means clustering method of the portable multidimensional control software of data combination control effectively [20], realize portable multidimensional abnormal control software testing data of feature extraction and detection, and measuring process is shown in Figure 3.Figure 3
Portable multidimensional control software testing process.


## 3.2.1. Feature Clustering for Portable Multidimensional Control Software Testing

According to the evolution distribution of association features, the joint combination feature analysis method is adopted to realize the fuzzy clustering center detection of abnormal data of portable multidimensional control software testing, build the clustering model of abnormal data of portable multidimensional control software testing, and obtain the item set of big data distribution association rules of portable multidimensional control software testing as shown in the following formula:(6)M=Wfz1+fz2+⋯+fzn≥T=∫∫Z≥T⋯∫fp1,p2,…,pn12λ1Zhft+ω,where fz1+fz2+⋯+fzn for portable multidimensional control software testing coefficient of feature point sampling time window, fp1,p2,…,pn denote time matching function. Combined with the method of text similarity and stack trace similarity detection, the statistical information distribution of the portable multidimensional control software test was obtained, and the abnormal data detection function of the portable multidimensional control software test was obtained as shown in the following formula:(7)fn=Ti+10exp0.51Sx∑d=13Hd+exp1b∑d=13sin12Hd,where Ti is the classification domain value of portable multidimensional control software testing fuzzy clustering, b is anomaly detection offset coefficient, Sx is text similarity, Hd is stack control coefficient. According to the difference degree between program module d and program module e, the output of feature clustering to portable multidimensional control software test is shown in the following formula:(8)J=∑j=13jk2ln1+jp−∑i=13eigi,where jk is the probability density function of spectrum feature alignment of portable multidimensional control software test, and jp is the probability density function of abnormal detection of portable multidimensional control software test. Therefore, joint multidimensional feature detection is adopted to realize fuzzy weight analysis and adaptive learning for test data of portable multidimensional control software [19], and the K-means clustering method is adopted to carry out effective data combination control in portable multidimensional control software.


## 3.2.2. Anomaly Detection Output

The feature extraction model of portable multidimensional control software testing is established to improve the abnormal analysis ability of portable multidimensional control software testing. The discriminant function of abnormal data detection of portable multidimensional control software testing in the random vector distribution space is shown in the following formula:(9)fa=fj^fjk=W+12ln1+xtIk+fm,where f^j represents the observation sequence of abnormal data flow of portable multidimensional control software test, xt is the normalized error, fm is the fuzzy membership function, and Ik is the joint error of abnormal clustering distribution of portable multidimensional control software test data.In the complex defects program module, portable multidimensional control of software test data under the abnormal distribution difference function is of the following type:(10)fh=∑y=1ya+ybMxi,xk−ζ,where ya and yb are the boundary coefficient and template coefficient detected by test data of portable multidimensional control software, Mxi,xk is the ratio of defect repair times to defect repair values of all files, and ζ is the anomaly detection threshold. According to the test feature extraction results of portable multidimensional control software, the distributed attribute fusion of portable multidimensional control software test is carried out, and the training sample set of detection function is obtained as a1,b1,a2,b2,…,an,bn. Through semantic ontology fusion, the heterogeneous function of portable multidimensional control software test data K-means clustering is obtained as the following formula:(11)min∑j=1fpψjfnτj,where ψj and τj denote portable multidimensional control software testing anomaly detection of confidence level and convolution, based on the analysis of the K-means clustering method of the portable multidimensional control software of data combination control effectively [20], realize portable multidimensional abnormal control software testing data of feature extraction and detection, and measuring process is shown in Figure 3.Figure 3
Portable multidimensional control software testing process.


## 4. Results Analysis

Matlab 7 simulation experiment was used to verify the application performance of the proposed method in realizing the abnormal detection of portable multidimensional control software testing. The parameters of abnormal feature detection of portable multidimensional control software testing were set as 1400, the sequence length of the training set was 400, and the fuzzy matching coefficient was 0.35 [21]. Related parameter settings are shown in Table 1.Table 1
Parameter setting of abnormal distribution in portable multidimensional control software test.
DetectionMatch the sparseThe sparse degreeSemantic relevanceCombined statistical characteristic quantitySample set 10.1680.3780.4980.044Sample set 20.1750.3890.5020.046Sample set 30.1430.3660.4970.058Sample set 40.1690.3780.4850.048Sample set 50.1430.3860.5010.049Sample set 60.1470.3780.5260.058Sample set 70.1550.3910.5230.052Sample set 80.1410.3790.5020.048Sample set 90.1480.3780.4980.046Sample set 100.1380.3790.4990.053Sample set 110.1370.3890.4980.046Sample set 120.1280.3970.5180.051Sample set 130.1470.3770.5020.046Sample set 140.1420.3850.5000.047According to the above simulation parameter setting, the test anomaly detection of the portable multidimensional control software is carried out, and the detection sequence distribution of original test data is obtained.Taking the detection sequence of original test data as the research object, the abnormal feature detection of test data of portable multidimensional control software is realized, and the detection results are shown in Figure4.Figure 4
Anomaly detection results.Analysis of Figure4 shows that the method in this paper can effectively detect abnormal characteristics of test data of portable multidimensional control software. The accuracy of abnormal detection of test data of portable multidimensional control software by different methods is tested, and the comparison results are shown in Figure 5. Analysis shows that the method presented in this paper has higher accuracy in anomaly detection of software test data, all of which are greater than 0.8.Figure 5
Comparison test of detection accuracy.


## 5. Conclusion

The operation reliability analysis model of portable multidimensional control software was established to improve the abnormal feature analysis and detection ability of portable multidimensional control software, and a software test data anomaly detection method based on K-means clustering was proposed. The constraint feature quantity reflecting the security level of portable multidimensional control software was constructed, and the fuzzy degree testing of portable multidimensional control software was carried out by combining linear programming and interpolation fitting methods [22]. The K-means clustering method is used for effective data combination control in portable multidimensional control software to extract and detect abnormal features of test data in portable multidimensional control software. Analysis shows that the method presented in this article has high accuracy in detecting abnormal data of portable multidimensional control software testing.Aiming at the establishment of a software quality measurement framework, the relevant theoretical research is carried out. First, starting from software quality assurance, the test case design method is described, and the possibility of errors and risk cost analysis in the software test design process are analyzed. Analysis shows that the method presented in this paper has high accuracy in detecting abnormal data of portable multidimensional control software testing.



---

*Source: 4505814-2022-07-18.xml*