The invention discloses a
software supply chain-oriented code
attack surface reduction method and
system and a storage medium. The method comprises the following steps of: S1, enhancing a test driven by a document; a large
language model is used for understanding program document
semantics, needed function features are extracted, and supplementary test cases covering the functions are automatically generated so as to enhance the integrity of input specifications; step S2, multi-consultant collaborative reduced code
attack surface analysis; the method comprises the following steps: collecting coverage information when a program runs, proposing deletion candidates of unexecuted codes by a function consultant, identifying potential security risks by a security consultant in combination with a
static analysis tool, and generating multi-view deletion suggestions; s3,
decision making and
verification; analysis results of the function consultant and the safety consultant are submitted to a large
language model for comprehensive reasoning. The method has the advantages that the simplification rate is higher, the universality is higher, the significant program scale can be reduced, and the execution efficiency can be improved.