The invention relates to a method and device based on 
reverse engineering for automatically generating 
software documents. The method and device based on the 
reverse engineering for automatically generating the 
software documents comprises scanning source programs, obtaining function comments, function detail information and a mutual call relation and a mutual 
inclusion relation among functions, identifying and abstracting function information of functions through a 
natural language, generating a 
global function call 
relation graph and a 
global function inclusion relation graph respectively based on the function information of the functions and the mutual call relation and mutual 
inclusion relation among functions, automatically generating 
software design description documents based on the function information of the functions, the function detail information and the 
global function call 
relation graph, generating a 
system function 
graph based on the function information of the functions and the global function inclusion 
relation graph, and generating software requirement specification documents automatically based on the 
system function graph. According to the method and device based on the 
reverse engineering for automatically generating the software documents, the software requirement specification documents and the 
software design description documents are generated automatically, the reverse 
engineering from codes to documents is achieved, and the method and device based on the reverse 
engineering for automatically generating the software documents is wide in application and strong in adaptability.