Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Testing Interviews:Analyst TestingAutomationDatabase TestingJSUnitJUnitLocalization TestingManual TestingMobile TestingNetwork TestingQA ConceptsQA TestingQTPQUnitRadar TesterRational TestSuiteSoftware QASoftware TestingTest CasesTest Documents ReportingWebsites Stress TestingWinRunnerWireless Testing
Copyright © 2018. All Rights Reserved
JUnit Interview Question:
How simple is too simple to break?
Submitted by: AdministratorThe general philosophy is this: if it can't break on its own, it's too simple to break.
First example is the getX() method. Suppose the getX() method only answers the value of an instance variable. In that case, getX() cannot break unless either the compiler or the interpreter is also broken. For that reason, don't test getX(); there is no benefit. The same is true of the setX() method, although if your setX() method does any parameter validation or has any side effects, you likely need to test it.
Submitted by: Administrator
First example is the getX() method. Suppose the getX() method only answers the value of an instance variable. In that case, getX() cannot break unless either the compiler or the interpreter is also broken. For that reason, don't test getX(); there is no benefit. The same is true of the setX() method, although if your setX() method does any parameter validation or has any side effects, you likely need to test it.
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.