| With the development of software industry,more and more problems are encountered in software development,and software testing is becoming more and more important.Fuzzy testing is an automated testing technique that tests software programs with a large number of random test cases,and is now widely used in various fields.However,fuzzy testing also has shortcomings,as a large number of test cases have the same role and can only detect the same exception in the program to be tested,so the efficiency of traditional fuzzy testing is not high.There are some fuzzy test optimization techniques,which have good results for testing structured data,but the results are not optimal for testing unstructured data due to its special characteristics.Therefore,this paper proposes a fuzzy testing method for unstructured data and optimizes the fuzzy testing of unstructured data by improving the quality of test cases.The main work is as follows:(1)Convert unstructured data and execution paths.Unstructured data unlike structured data,cannot be processed directly by computer.To solve this obstacle,this paper parses the data and its paths triggered in the target program into sequences by analysis tools,and converts the data sequences into corresponding vectors using the Skip-Gram model,and uses the TF-IDF algorithm and LDA algorithm to extract features from the data and reduce the dimensionality of its feature space to facilitate the subsequent testing work.(2)The Char-RNN network and Seq2 Seq model are combined to form a deep learning testing framework and generate high-quality test cases with the relationship between the test cases and their corresponding paths.The Seq2 Seq model first uses the initial unstructured data and its corresponding paths to train the relationship between them,and then predicts test cases covering more paths by the sequences generated by the Char-RNN network.(3)There are flaws in the Seq2 Seq model that cause the model to fail to yield accurate output.When it is applied to the fuzzy testing framework,it reduces the quality of fuzz testing.In this paper,we optimize the Seq2 Seq model by using the Attention mechanism and the new Scheduled Sampling method: we introduce the attention probability distribution of data sequences in unstructured data based on the Attention mechanism so that the network can represent the input sequence information completely;we propose the Scheduled Sampling method consisting of two Decoders to make the prediction more accurate.Sampling method composed of two Decoders makes the input sequence for prediction a mixture of real elements and the output of the model itself.Thus,the Seq2 Seq model is optimized to obtain high-quality test cases.The above work improves the quality of unstructured use cases,triggers more paths to the target program,detects anomalies,and optimizes fuzzy testing for unstructured data. |