Automating JUnit tests

Chapter 2, Automating JUnit Tests, covered the importance of test automation, CI, and test automation with Gradle, Maven, and Ant. This section reiterates the benefits of test automation.

The following are the benefits of test automation:

  • Assumptions are continually verified. We refactor the code (change the internal structure of the code without affecting the output of the system) to improve code quality such as maintainability, readability, or extensibility. We can refactor the code with confidence if automated unit tests are running and providing feedback.
  • Side effects are detected immediately. This is useful for fragile, tightly coupled systems when a change in one module breaks another module.
  • Test automation saves time ...

Get Mastering Unit Testing Using Mockito and JUnit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.