2019 – Test Optimization
Improving build time requires optimizing tests which can achieved with modifying existing tests or migrating to modern framework or newer version which provides better performance.
What are some ways we can optimize tests written in Java & JS:
Java:
Junits:
Run in parallel: https://examples.javacodegeeks.com/core-java/junit/junit-run-tests-in-parallel/
– Use parallelcomputer class
– Use surefire plugin
https://www.baeldung.com/maven-junit-parallel-tests
BDD using cucumber?:
Parallel execution is supported natively by cucumber: 4.0
https://cucumber.io/blog/announcing-cucumber-jvm-4-0-0/
https://github.com/cucumber/docs.cucumber.io/issues/298
Spring boot testing:
- https://reflectoring.io/spring-boot-web-controller-test/
- https://github.com/thombergs/code-examples/tree/master/spring-boot/spring-boot-testing
JS:
Unit tests:
Existing frameworks (jasmine, karma) have ability run tests in parallel and optimize existing run:
https://blog.angularindepth.com/angular-unit-testing-performance-34363b7345ba