Java - Interview Questions and Answers for 'Testing' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Testing' - 24 question(s) found - Order By Newest

 Q1. How should we ignore or avoid executing set of tests ?
admin
info@buggybread.com
Ans. We can remove @Test from the respective test so as to avoid its execution. Alternatively we can put @Ignore annotation on the Junit file if we want to ignore all tests in a particular file.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     junit   @test   @ignore   unit tests   unit testing   testing


 Q2. How can we test methods individually which are not visible or declared private ?
admin
info@buggybread.com
Ans. We can either increase their visibility and mark them with annotation @VisibleForTesting or can use reflection to individually test those methods.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     junit   reflection api   @visiblefortesting   white box tester


 Q3. What are the steps to be performed while coding Junit with Mocking framework ?
admin
info@buggybread.com
Ans. Initialize required objects for working with mocks and tested method
Set the mock behaviour on dependent objects
Execute the tested method
Perform assertions
Verify if a method is invoked or not

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     junit   mocking frameworks   mock   unit testing   java   white box testing


 Q4. What is assert keyword used for ?
Anonymous
Ans. The assert keyword is used to make an assertion—a statement which the programmer believes is always true at that point in the program. This keyword is intended to aid in testing and debugging.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   junit.assert   testing   white box testing


 Q5. Which load testing tools have you used ?
Anonymous
Ans. Rational Robot, JMeter, LoadRunner

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     testing   load testing   rational robot   jmeter   loadrunner   software tester      basic        rare


 Q6. What are use cases?Process
Admin
info@buggybread.com
Ans. It is part of the analysis of a program and describes a situation that a program might encounter and what behavior the program should exhibit in that circumstance.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     use cases   design   high level design   testing   test driven development   software system analyst   project lead      basic        frequent


 Q7. Difference between Assert and Verify ?
admin
info@buggybread.com
Ans. Assert works only if assertions ( -ea ) are enabled which is not required for Verify.

Assert throws an exception and hence doesn't continue with the test if assert evaluates to false whereas it's not so with Verify.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     assert   junit   mockito   verify   testing   unit testing   barclays


 Q8. Name few Java Mocking frameworks ?
admin
info@buggybread.com
Ans. Mockito, PowerMock, EasyMock, JMock, JMockit

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     junit   mocking frameworks   mock   architecture   white box testing


 Q9. How to perform a clean install without executing Tests ?Maven
Admin
info@buggybread.com
Ans. mvn clean install -Dmaven.test.skip=true

or

mvn install -DskipTests

or


org.apache.maven.plugins
maven-surefire-plugin

true



within parent POM file.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     maven   maven install   unit testing   unit tests



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q10. How to access a Web Element if there are many elements with the same XPath ?
admin
info@buggybread.com
Ans. By specifying the Index like

//button[@class='button'])[2]

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     selenium   selenium webdriver   automation testing


 Q11. Which of the following annotation is used to avoid executing Junits ?

a. @explicit
b. @ignore
c. @avoid
d. @NoTest
Anonymous
Ans. @ignore

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   testing   junit   unit testing


 Q12. Which of the following is not the advantage of Mocking frameworks ?

a. It helps testing the module independently
b. It helps in faster unit testing
c. It helps in testing code even when external dependencies like service calls are not working
d. It helps in doing end to end Integration Testing
Anonymous
Ans. It helps in doing end to end Integration Testing

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     mocking frameworks   mockito   unit testing   junits


 Q13. Which of the following are usually manual ?

a. Unit Test
b. Integration Test
c. Load Test
d. Both a and c
Anonymous
Ans. Integration Test

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     testing   manual testing   automated testing


 Q14. Which of the following nearly involves same Test execution plan ?

a. Unit and Integration tests
b. Unit and Regression Tests
c. Integration and Performance Tests
d. Performance and Load Tests
Anonymous
Ans. Performance and Load Tests

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     testing


 Q15. What are the phases in Software Testing process ?Process2016-10-17 12:03:16

Ans. Test Planning -> Test Design -> Test Execution -> Evaluating Exit Criteria and Closure

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     testing   testing phases   process


 Q16. Write a Test Case using Mock ?Testing2016-11-04 08:13:38

Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?keyword=mock&category=code

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Junit  Mock     CapitalOne


 Q17. Have you ever tried mocking static methods ?Testing2016-12-07 16:13:30

Ans. Yes, that can be done using Power Mock. Mockito doesnt provide a way to mock static methods.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Mockito  junit  powermock


 Q18. What is a Webdriver ?Testing2017-02-02 08:25:41

Ans. Selenium WebDriver is a tool for automating web application testing.It helps in replicating the manual tester behavior like keyboard entry, mouse events etc and then matching the output against the expected.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     selenium  webdriver     Global Software Resources  FICO Software  Walt Disney  Softcrylic  Sky  23andMe  Endurance Group  CitiusTech  Hitachi Consulting  Crest Premedia  LivingSocial  TEKSystems  Jabong.com  Think Future Technologies  Dollar Shave Club  Zendesk  Five9  Aptify  Symphony Teleca  Collabera  Xpanxion  Fourth Technologies  Freedom Financial  Aurigo Software Technologies  Forte Group  Wipro  Infosys  Pearson  Overstock  Elsevier  Capgemini  Cognizant (CTS)  Tech Mahindra  OLA Software  Mphasis  GrayLocus  Bhavna


 Q19. What could be the Use Cases for an Elevator system ?Testing2017-03-27 08:37:11

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     use cases  testing



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q20. Which type of testing involves use of mocking frameworks ?Testing2017-08-10 17:07:10

Ans. Unit Testing

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     


 Q21. Can and Should we mock calls in integration tests ?Testing2017-08-10 17:07:28

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     


 Q22. Can we mock static methods ?Testing2017-08-17 19:32:01

Ans. Yes we can use PowerMock. With Mockito , we cannot mock static methods.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     mocking fraeworks  mocking static methods


 Q23. How do you use Mock frmaework to test webservices in any of your previous project ?Testing2017-08-24 14:06:46

Ans. We were having client methods to call web services and were mocking the client method call using Mockito.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     mocking  testing


 Q24. Which of following annotation is used to initialize objects before executing set of tests ?Junit
a. @Test
b. @Ignore
c. @After
d. @Before

Ans.d. @Before



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: