Tag Archives: variable

Better Test Code Principles: #6 Don’t create a new variable for a value you will only use once

If you are an automation tester, you will need to write a lot of code to cover the required test scenarios and test cases. Your code base will grow and grow, but some of the code will not be really needed and thorough code reviews should be done, to avoid unnecessary code.

Such unneeded code might include forgotten and unused imports, duplicate code that should have been extracted in a separate method or variables that are declared only to be used in one place. Continue reading Better Test Code Principles: #6 Don’t create a new variable for a value you will only use once