TestNG : Java Testing Next Generation :: Introduction
TestNG Intro |
TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionalities that make it more powerful and easier to use, such as:
- Annotations.
- Run your tests in arbitrarily big thread pools with various policies available (all methods in their own thread, one thread per test class, etc…).
- Test that your code is multithread safe.
- Flexible test configuration.
- Support for data-driven testing (with @DataProvider).
- Support for parameters.
- Powerful execution model (no more TestSuite).
- Supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc…).
- Default JDK functions for runtime and logging (no dependencies).
TestNG is designed to cover all categories of tests:
- unit,
- functional,
- end-to-end, (test whether the flow of an application is performing as designed from start to finish)
- integration, etc…
Note: End-to-end testing is a methodology used to test whether the flow of an application is performing as designed from start to finish. The purpose of carrying out end-to-end tests is to identify system dependencies and to ensure that the right information is passed between various system components and systems.
About TestNG Creator
- Cédric Beust, TestNG’s creator, and leading Java developer Hani Suleiman, present powerful, flexible testing patterns that will work with virtually any testing tool, framework, or language.
- Cédric Beust, a senior software engineer at Google, is an active member of the Java Community Process who has been extensively involved in the development of the latest Java release. He is the creator and main contributor to the TestNG project.
- Hani Suleiman is CTO of Formicary, a consulting and portal company specializing in financial applications. He is one of two individual members who has been elected to the Executive Committee of the Java Community Process.
Understanding Testing Framework
TestNG Vs JUnit |
TestNG Vs JUnit
JUnit 4 and TestNG are both very popular unit test framework in Java technology. Both frameworks look very similar in functionality. Which one is better? Which unit test framework should I use in Java project?
Now You decide!!!
Understanding Unit Test |
Unit Testing
- Unit testing is intended to check the functionality of a particular class.
- Unit testing is done by programmers
- Tests other than unit testing are done by testers.
-
Unit testing has to be completed before :
- Module testing,
- Functional testing,
- System testing, etc…
Types of Unit Test
- XUnit architecture introduced automated unit testing
- There are many Unit testing frameworks for different programming languages
-
Few of the units testing frame works are:
- JAVA – Junit, TestNG
- C – CUnit,
- C++ – CppUnit, Python (PyUnit), Fortran (fUnit),
- .Net -.NUnit etc…
- xUnit Architecture was first implemented for java
- It is known as JUnit.
Understanding JUnit |
What is JUnit
- JUnit supports Unit testing for Java Programming Language
- JUnit is an open source, simple and provides a testing frame work for Java.
- The framework establishes relationship between Development and Testing
- JUnit is a freeware
- JUnit is integrated with IDEs (Eclipse, JBuilder, etc…) and Ant
- Sun Microsystems has not yet included a separate package for JUnit in JDK.
- JUnit uses “junit.jar” file
History of JUnit
- In mid-90’s, Kent Beck developed xUnit automated test tool for Smalltalk.
- It was known as SUnit
- Erich Gamma and Kent Beck developed JUnit.
- JUnit is one of the xUnit testing frameworks.
- JUnit 2.0 was the first effective release with 14 classes in it
- Most popularly used JUnit version is version 3.8.1
- Latest version of JUnit is 4.1 with 41 classes.
Uses of JUnit
- JUnit automates the developer’s work
- Automated tests will improve the performance
- JUnit reduces human error and propagation of errors.
Recent Comments