Aspects


vs


Junit

Popular unit testing framework for Java and Scala

Testng

TestNG is a testing framework focused on providing both unit and functional testing abilities in the Java programming language

Better easier

Quality Example
Easier

"I know this can be achieved with junit but in my experience it is easier with testng"

from question "How can I parallelize multiple instances of the same Selenium suite using Junit?"

"If you are familiar of using junit it is easier to switch into testng"

from question "Is TestNG enough as a web test framework?"

Better

"Isn t testng supposed to a better than junit"

from question "Why does Android use JUnit over TestNG even if Cedric Beust created TestNg and was part of Android team?"

Others

Quality Example
More flexible

"Testng is more flexible than junit and have multiple advantages like support for parallel testing for example"

from question "What are some good Java web development tools (across the board)"

Better solution

"If there is a junit extension or similar framework that provides a better solution than testng then please let me know"

from question "Solution for Parameterized Tests"

Much friendlier

"Testng is much friendlier to this paradigm than junit though"

from question "Where should I put my JUnit tests?"

Better option

"If you re doing non-unit testing testng might be a better option than junit"

from question "Configuring system tests in junit"

More direct

"Junit is more direct and simpel to use if you start to learn java testng has more features but maybe is more complex"

from question "How to test java code?"

Bigger

"In case if you have flexibility to choose another testing framework you can try with testng which has bigger feature set than junit"

from question "Running multiple test in parallel with Multithreading"

More contrived

"Here is what it would look like with testng it s a little more contrived with junit since you can t pass parameters directly to test functions"

from question "How to write junit tests for interfaces?"

More

"Edit it seems junit has more printed books as references compared to testng on amazon"

from question "Which UnitTest framework to learn for Java now?"

"If you have to do a lot of this honestly testng is more flexible but you can absolutely get it done in junit"

from question "Data-driven tests with jUnit"

More options

"Testng offers you more options and possibilites how to run your tests and in which order especially something junit can t"

from question "First steps with Selenium and jUnit - any good tutorials?"

More popular

"To be perfectly honest i junit is way more popular than testng at least here where i work and live"

from question "Which UnitTest framework to learn for Java now?"

Better results

"Firstly i am not sure how to properly use multi-thread with junit last time i tried i had no success anyway i have had better results with testng"

from question "TimeoutException when running Selenium tests in parallel"

More configurable

"Testng strives to be much more configurable than junit but in the end they both work equally well"

from question "JUnit vs TestNG"

More capabilities

"Testng has more capabilities and can be helpful with integration tests junit is more focused on unit tests"

from question "How to introduce tests in an underway Java project?"

Back to Home
Data comes from Stack Exchange with CC-BY-SA-3.0