A method of parametric modeling composite microstructure is proposed. It can be used for composite microstructure virtual testing and optimization procedure. Considering the fiber random distribution features of composite microstructure and the flaw distribution in the fibers, a three dimensional parametric model has been built in this paper. Then, the sizes of the composite representative volume element (RVE) generated by the method are determined by moving-window function method. These models are close to reality and can be used for further virtual testing. Finally, numerical experiment is presented by the secondary development of the finite element packages (ABAQUS) via Python language programming to verify the proposed method. The following conclusions are obtained: (i) fiber volume fraction of the composite structure model reaches 65% by the modeling method, which meets the majority engineering demands; (ii) stress distribution feature of RVE generated by using moving-window function method coincides with general prediction.