The invention belongs to the field of
JavaScript engine testing, particularly relates to a
JavaScript engine
fuzz testing method for an AST generation model based on structure
perception, and aims to solve the problem that an existing neural network
language model NNLM constructed by LSTM is low in accuracy when
syntax and
semantics of a JS
test case are generated. The method mainly comprises the following steps: step 1, preprocessing a JS seed file; 2, a structure sensing AST generation model; step 3, generating a JS
test case; and 3, executing the new JS
test case by adopting the target JS engine to obtain a
vulnerability report, and completing the test. According to the method, an AST generation model based on structure
perception is adopted for learning association between AST sub-trees of JS codes, a JS seed file is converted into an AST sub-tree sequence, the AST sub-tree sequence is mapped into a vector form capable of being learned by the model,
semantic association between codes in the JS seed file is captured more comprehensively, the model is helped to understand the relation between variables, functions and statements, and therefore the
semantic association between the codes in the JS seed file is obtained. Therefore, the accuracy of generating the
syntax and the
semantics of the JS test case is improved.