Abstract:During recent years, DevOps gains its popularity. As the support of DevOps, microservices architecture has become a hot spot of software industry for its agility, flexibility, and scalability. However, finding the adequate granularity of microservices is a big challenge. Microservices architecture still lacks the criteria for evaluating its granularity. To cope with this problem, this paper designs four evaluation metrics based on several principles of best microservices practice to quantitatively measure the rationality of microservice decomposition. Based on that, a granularity evaluation approach of microservices based on bounded context is proposed. By implementing a tool prototype, evaluation results can be automatically calculated. A case study is used to evaluate the decomposition of a microservices-oriented system and compare the results with the architects' expectations. The results prove that the proposed approach can be applied to evaluate the granularity of microservices-oriented system.