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
Read Online JUnit Job Interview Questions And Answers
Top JUnit Questions
☺ | What Is JUnit? |
☺ | Why Does Poeple Import org.junit.Assert Statically? |
☺ | How To Wirte a Simple JUnit Test Class? |
☺ | Why Do You Use JUnit to Test Your Code? |
☺ | How Do You Launch a Debugger When a Test Fails? |
Top Testing Categories
☺ | Manual Testing Interview Questions. |
☺ | Rational TestSuite Interview Questions. |
☺ | QTP Interview Questions. |
☺ | Database Testing Interview Questions. |
☺ | Software QA Interview Questions. |