Nowadays, effort estimation in software projects is turned to one of the key concerns for project managers. In fact, accurately estimating of essential effort to produce and improve a software product is effective in software projects success or fail, which is considered as a vital factor. Lack of access to satisfying accuracy and little flexibility in existing estimation models have attracted the researchers’ attention to this area in last few years. One of the existing effort estimation methods is COCOMO (Constructive Cost Model) which has been taken importantly as an appropriate method for software projects. Although COCOMO has been invented some years ago, it has still got effort estimation ability in software projects. Many researchers have attempted to improve effort estimation ability in this model by improving COCOMO operation; but despite many efforts, COCOMO results are not satisfying yet. In this research, a new compound method is presented to increase COCOMO estimation accuracy. In the proposed method, much better factors are gained using combination of invasive weed optimization and COCOMO estimation method in contrast with basic COCOMO. With the best factors, the proposed model’s optimality will be maximized. In this method, a real data set is used for evaluating and its operation is analyzed in contrast to other models. Operational parameters improvement is affirmed by this model’s estimation results.