I am new to automatic testing in Java. Which tool should I use? JUnit or TestNG?

I read several comparisons of JUnit and TestNG , and it looks like TestNG has more configuration options. On the other hand, JUnit is more supported by IDE, construction tools, has more plugins.

I have no experience writing unit tests. Which tool should I use?

PS I think my question is more similar: should I give TestNG a try, or just stick with JUnit like everyone else?

PS We are developing web applications, so I think that the choice should also take into account that we will use Selenium later for functional testing.

+3
source share
7 answers

If this is your first time, I would recommend JUnit.

It was the first, most popular. It is well documented, has excellent tool support, and is a metaphor that has been translated, at least initially, into all languages ​​(see xUnit Implementations). It should work great for most projects, and it's a good tool to learn. This will be a good base for you as a programmer.

There are other features of the β€œalternatives” - why there are alternatives, but often this is a matter of style more than anything else. TestNG may have several different functions, but JUnit is also developing with functions such as annotations, alternative mappings, etc.

, JUnit Selenium, .

+3

TestNG JUnit 3. Cedric TestNG, .

, JUnit 3 TestNG , JUnit.

TestNG JUnit 3 , , JUnit. JUnit 4 , .

TestNG JUnit , TestNG . JUnit .

, . TestNG assertEquals(actual, expected, message), JUnit - assertEquals(message, expected, actual) - .

: . . Selenium. ant. CruiseControl Hudson. , ( ).

TestNG , , , , , .

+7

TestNg Unitils . .

0

" ", : , , jUnit , "-.

0

Junit , ,

0

JUnit TestNG , , .

, TestNG, - . , . , , "fahd", . , . , , , , .

0

I work as a JavaEE developer. We use JUnit extensively to test our business logic modules. It is very powerful, flexible, and we use its html report in official release documents as proof of quality.

0
source

Source: https://habr.com/ru/post/1765951/


All Articles