Teste é amplamente usado para garantir a qualidade em produtos de software. O teste de unidade é realizado na menor parte funcional de um software e visa descobrir defeitos nestas unidades. JUnit é uma ferramenta de apoio ao teste unitário, a qual auxilia desenvolvedores na automação dos testes e verificação dos resultados. Porém, muito tempo e esforço são gastos para codificar os drivers e os stubs de teste necessários a esta ferramenta, minimizando os benefícios esperados. O Perfil de Teste da UML 2.0 (U2TP) permite especificar artefatos de teste em uma notação padronizada, de alto nível, gráfica, e independente de linguagem de programação. Este trabalho aborda a geração totalmente automatizada de drivers e stubs de teste para ferramenta JUnit a partir de especificações de testes modeladas com o U2TP. Os modelos e algoritmos desenvolvidos foram aplicados a um estudo de caso, gerando corretamente todo o código correspondente.