O'Reilly logo

Test-Driven Java Development - Second Edition by Viktor Farcic, Alex Garcia

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

TestNG

JUnit and TestNG are two major Java testing frameworks. You already wrote tests with JUnit in the previous chapter, Chapter 3Red-Green-Refactor – From Failure Through Success until Perfection,  and, hopefully, got a good understanding of how it works. How about TestNG? It was born out of a desire to make JUnit better. Indeed, it contains some functionalities that JUnit doesn't have.

The following subsections summarize some of the differences between the two of them. We'll try not only to provide an explanation of the differences, but also their evaluation in the context of unit testing with TDD.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required