TCCgrad
Testrunner: um framework para o desenvolvimento de testes automatizados baseado na tecnologia Selenium/Webdriver com enfoque na eficiência de execução
Fecha
2019-06-28Autor
Ferreira, Odilon Alho
Institución
Resumen
O alto tempo das suites de teste é um dos fatores que pode ajudar no fracasso da implantação de testes automatizados no processo de desenvolvimento de software de qualquer empresa. Este alto tempo de execução pode ser ocasionado de várias formas, como por exemplo o baixo desempenho da execução dos testes automatizados, tanto pela parte de hardware como pela parte computacional.
Para melhorar a eficiência de execução dos testes automatizados com selenium foi criado o Testrunner, um projeto para o desenvolvimento de testes automatizados de sistema baseado na ferramenta Selenium. Este framework utiliza funcionalidades do JUnit para execução dos testes e controle dos resultados obtidos e ainda possibilita o reuso de execuções entre testes através do estado do sistema deixado pelo teste anterior em sua execução. Em contrapartida, é necessário avaliar se o estado deixado pelo primeiro teste é necessário e suficiente para início do segundo teste. Isso torna complexa a refatoração do primeiro teste, pois cada alteração na definição dos suas ações, é necessário rever se essa alteração não implica na validação do segundo teste.
Ao utilizar o Testrunner para a execução de testes automatizados, é possível diminuir o tempo das suites de teste em torno de 65%. Porém, o tempo de construção dos testes aumentou em 25% devido a complexidade que o Testrunner acaba incrementando no processo de desenvolvimento dos testes. The high time of test suites is one of the factors that can help in the failure of automated testing deployment in the software development process of any company. This high execution time can be caused in several ways, such as the poor performance of the automated tests, both hardware and computing.
To improve the execution efficiency of automated tests with selenium, Testrunner was created, a project for the development of automated system tests based on the Selenium tool. This framework uses JUnit functionalities to execute the tests and control the obtained results and also allows the reuse of executions between tests through the state of the system left by the previous test in its execution. In contrast, it is necessary to evaluate whether the state left by the first test is necessary and sufficient to start the second test. This makes complex the refactoring of the first test, since each change in the definition of its actions, it is necessary to review if this change does not imply the validation of the second test.
By using Testrunner to run automated tests, it is possible to shorten test suite time by around 65%. However, test build time increased by 25% due to the complexity that Testrunner eventually increases in the test development process.