1.What is Testing?Testing is the process of checking the functionality of the application whether it is working as per requirements. 2.What is Unit Testing?Unit testing is the testing of single entity classormethod. Unit testing is very essential to every software company to give a quality product to their customers. 3.What is Manual testing?Executing the test cases manually without any tool support is known as manual testing. 4.What is Automated testing?Taking tool support and executing the test cases by using automation tool is known as automation testing. 5.What are the disadvantages of manual testing?Following are the disadvantages of manual testing−
6.What are the advantages of automated testing?Following are the advantages of automated testing−
7.What is JUnit?JUnit is a Regression Testing Framework used by developers to implement unit testing in Java and accelerate programming speed and increase the quality of code. 8.What are important features of JUnit?Following are the important features of JUnit −
9.What is a Unit Test Case?A Unit Test Case is a part of code which ensures that the another part of code method works as expected. To achieve those desired results quickly, test framework is required .JUnit is perfect unit test framework for java programming language. 10.What are the best practices to write a Unit Test Case?A formal written unit test case is characterized by a known input and by an expected output, which
is worked out before the test is executed. The known input should test a precondition and the
expected output should test a postcondition. 11.When are Unit Tests written in Development Cycle?Tests are written before the code during development in order to help coders write the best code. 12.Why not just use System.out.println for testing?Debugging the code using system.out.println will lead to manual scanning of the whole output every time the program is run to ensure the code is doing the expected operations. Moreover, in the long run, it takes lesser time to code JUnit methods and test them on class files. 13.How to install JUnit?
set CLASSPATH=%CLASSPATH%;%JUNIT_HOME%\junit.jar
java org.junit.runner.JUnitCore org.junit.tests.AllTests
14.Why does JUnit only report the first failure in a single test?Reporting multiple failures in a single test is generally a sign that the test does too much and it is too big a unit test. JUnit is designed to work best with a number of small tests. It executes each test within a separate instance of the test class. It reports failure on each test. 15.In Java, assert is a keyword. Won't this conflict with JUnit's assert method?JUnit 3.7 deprecated assert and replaced it with assertTrue, which works exactly the same way. JUnit 4 is compatible with the assert keyword. If you run with the -ea JVM switch, assertions that fail will be reported by JUnit. 16.How do I test things that must be run in a J2EE container e. g. servlets, EJBs?Refactoring J2EE components to delegate functionality to other objects that don't have to be run in
17.What are the core features of JUnit?JUnit test framework provides following important features −
18.What is a fixture?Fixture is a fixed state of a set of objects used as a baseline for running tests. The purpose of a test fixture is to ensure that there is a well known and fixed environment in which tests are run so that results are repeatable. It includes following methods −
19.What is a test suite?Test suite means bundle a few unit test cases and run it together. In JUnit, both @RunWith and @Suite annotation are used to run the suite test. 20.What is a test runner?Test runner is used for executing the test cases. |