The invention discloses a communication protocol automatic analysis and
test data generation method and
system, and the method comprises the steps: analyzing an unstructured protocol document, recognizing a
fixed field and a variable field in the document, and outputting structured data; automatically generating
test data based on the structured data, dynamically calculating a
checksum according to a specified check
algorithm type in the structured data, and filling the
checksum into the original message to form a complete test message; and generating a standardized
test data set according to the complete test message. According to the method, manual intervention is not needed from
document analysis to
test data generation, the analysis efficiency is improved, and most protocol scenes are covered through the boundary value, the abnormal value and the orthogonal
combination strategy. The method supports various document formats, data types and
verification algorithms, adapts to protocol standards of different industries, facilitates problem positioning and
regression testing through standardized output documents, and reduces the maintenance cost.