Collaboration formation has been on the increase among software development firms due to rapid advancement in technology, requirements for diverse skills, and fierce competition. By collaborating with a suitable partner, a firm can benefit from its diversified skills, utilize its experience, share costs, and reduce the product completion span. As a result, a better quality product that offers more profits can be developed. However, forming an alliance with an inappropriate partner or an unfair profit and cost distribution mechanism may result in failure. The existing mechanisms offer poor results either due to inappropriate partner selection criteria or due to unfair profit distribution because of the bargaining power advantage to one of the negotiating firms. To address the aforementioned issues in the criteria for partner selection and profit sharing, this paper formulates the strategic interaction between firms for the partner selection and profit sharing as a Shapley value-based cooperative game theoretic model. Our model enables a firm to not only select a suitable partner but also offer a fair profit distribution mechanism. Our cooperative game model takes into account the knowledge investment, stock of knowledge, knowledge absorption capacity, coordination cost, and development cost of firms. The model is analyzed with various scenarios under which collaboration formation occurs and provides different strategies regarding collaboration such as not collaboration (NC) and collaboration (C). The proposed model provides a better joint payoff as well as a higher and fair share of the joint profit for each firm.