“Programs should be written for people to read, and only incidentally
for machines to execute.”

— from “Structure and Interpretation of Computer Programs” by Abelson and Sussman

UI is just another piece of “” hence all the best practices applies in the same way.

Having said that, If I have to pick one thing, I would say code shouldn’t read like code, it should read like a natural language in the business domain on higher layers(test scripts/page object public methods in the automation framework). All the statements inside a function should be on the same level of abstraction. All the ‘code’ semantics(loops/if/switch) should be deeply buried in the lowest layers of the framework.

If NOT, it is one of most obvious code smells to me that code is not structured properly in different layers in the framework which makes code maintenance a hell due to multiple reasons on multiple levels in the long term.

Source link https://sqa.stackexchange.com/questions/32628/automation-code-what-to-look-for-in-code---


Please enter your comment!
Please enter your name here