I found TestNG failing occasionally and when I started to investigate I found it has little test coverage. It looks like the test framework itself is poorly tested.
Which other test execution frameworks for Java are better tested with unit tests?
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.Sign up to join this community
I have never used it but I would be surprised to find out that the popular test framework TestNG is actually the source of your intermittent results.
That being said, if you want to use a different one I would recommend JUnit. The interface is similar to TestNG (Annotation based) and I've never had a problem with it.
When talking about unit testing with java, then no one beats JUnit.
JUnit is the awesome unit testing framework and widely used in software companies. As compare to TestNG, JUnit is lightweight and faster. But almost same as TestNG.
TestNG itself is extension of JUnit, and it has just added new features to JUnit. But much powerful then Junit.
I will suggest to go for JUnit, but still it is as same as TestNG.
Another framework combination can be using JTest with JUnit.
Jtest complements and extends JUnit. Jtest not only runs JUnit test cases, but also automatically designs and executes additional test cases that verify the code and increase test coverage. Moreover, Jtest automatically creates JUnit test class templates into which you can easily enter test cases, and exports Jtest test cases in JUnit-compatible format. It even enforces best practices for JUnit test classes.