Best practices for clean tests

What are your best practices for writing clean and maintainable testing? Any kind of: unit, integration, component, etc

I am not writing the testing, I might adapt a tool or build a script to facilitate my testing.
Testing is a sapient activity. I use my brain to learn through experiments and explorations, in order to find quality threats to the value of the product.

Cem Kaner already wrote something about ‘good tests’ in his Test Design course.
You can access it through http://testingeducation.org/BBST/testdesign/BBSTTestDesign2011pfinal.pdf
Page 339 to 360.
Additional learning materials on http://testingeducation.org/BBST/testdesign/ :
http://testingeducation.org/BBST/testdesign/CollardUsecaseTesting.pdf
http://testingeducation.org/BBST/testdesign/Kaner_GoodTestCase.pdf

Hi Yoni,

For me it’s about trying to make methods as reusable as possible, pulling out any values to be input so they can be easily identified and reconfigured if the SUT changes. Remember that you will probably not work for the same company for the rest of your life and someone will need to take these on when you leave that company.

I have no formal training am self taught I have inherited some really clunky “release tests” which are very hard to read and follow exactly what they do, in some cases they assert on every element on a ui exists, finding the right balance of what to cover and what to exclude is a difficult skill to learn.

Write tests that you would be happy to take on when you start a new role.

1 Like