Refactoring de Monólitos em Java para Aplicações Baseadas em Microsserviços ExecutáveisNos últimos anos assistiu-se a uma mudança drástica na forma como o software é desenvolvido. Os projectos de software de grande escala estão a ser construídos através de uma composição flexível de pequenos componentes possivelmente escritos em diferentes linguagens de programação e com os processos de deploy independentes -as chamadas aplicações baseadas em microsserviços. Isto tem sido motivado pelos desafios associados ao desenvolvimento, manutenção e evolução de grandes sistemas de software, mas também pelo aparecimento da cloud e pela facilidade que trouxe em termos de escalabilidade horizontal, reutilização e flexibilidade na propriedade e no deploy. O crescimento dramático da popularidade dos microsserviços levou várias empresas a aplicar grandes refactorings aos seus sistemas de software. Contudo, esta é uma tarefa desafiante que pode demorar vários meses ou mesmo anos.Esta dissertação propõe uma metodologia capaz de transformar automaticamente aplicações desenvolvidas em Java sob uma arquitetura monolítica em aplicações baseadas em microserviços. A metodologia proposta é direccionada para as aplicações que tiram partido da técnica ORM para relacionar classes com as entidades da base de dados, através de anotações no código fonte. A nossa abordagem recebe como input o código fonte e uma proposta de microsserviços, e aplica técnicas de refactoring às classes para tornar cada microsserviço independente. Esta metodologia cria uma API para cada chamada de métodos de classes que se encontram noutros serviços, e as entidades da base de dados também sofrem refactoring para serem incluídas no serviço correspondente. A metodologia proposta foi implementada através da construção de uma ferramenta que suporta o refactoring de aplicações desenvolvidas em Java Spring e que utilizam as anotações da JPA para o mapeamento entre as classes e as entidades.Realizou-se um análise quantitativa e qualitativa em 120 projetos open-source aleatoriamente recolhidos do GitHub. Na avaliação quantitativa procurou-se perceber a aplicabilidade da metodologia e na analise qualitativa, através da execução de testes unitários, procurou-se avaliar se aplicação original e a aplicação baseada em microserviços gerada são funcionalmente equivalentes.Os resultados são promissores sendo a metodologia capaz de realizar o refactoring em 69% dos projetos, sendo o resultado da execução dos testes unitários igual em ambas as versões dos projetos.