Successful identification of the fractures in fractured reservoirs is important to guarantee an effective development. Considering that the production performance of fractured reservoirs contains important information of the distribution of fractures, the production performance can be applied for the inversion of fractures. However, the inversion of fractures is difficult to achieve because it is an inverse problem with an inherent defect of multiplicity of solutions. In order to alleviate the defect, we estimate the possible distribution ranges of fractures which can be obtained by analyzing the correlation of fractures and in-situ stress, and the ranges are used as constraint conditions when the production performance is applied for obtaining the accurate distribution of fractures. Firstly, we choose the geometric parameters of fractures such as midpoint coordinate, azimuth and extension length of fractures as inversion parameters and use production data as inversion indexes. Secondly, we simulate the flow behavior in fractured reservoirs based on the Discrete Fracture Matrix (DFM) module of Matlab Reservoir Simulation Toolbox (MRST) to explicitly describe the effect of fractures on the flow behavior of fluid. Thirdly, the possible distribution ranges of fractures which can be obtained by analyzing the correlation between fractures and in-situ stress based on Griffith failure criterion are used as the constraint conditions of inversion parameters. Finally, Simultaneous Perturbation Stochastic Approximation (SPSA) algorithm is adopted to minimize the inversion objective function to obtain the accurate distribution of fractures. Theoretical cases verify that the method is effective for the accurate inversion of fractures while the inversion results of more fractures become worse because more fractures make the sensitivities of production performance to individual fractures decrease greatly.