2022-05-19 –, Main Hall
RF is missing something.
It is something that has irritated me since day one of embracing it.
We all talk about it when writing scripts.
In recent years tools have emerged to support it.
The problem is we do not have it.
A Robot Framework Style Guide.
When I have introduced Robot Framework to a test automation team or been asked to review existing projects, I try to be open minded. Maybe this time the robot files will be well organized, maybe the casing will be consistent, maybe the keywords will be meaningful, maybe, maybe, maybe.
There was one project that I reviewed that I could tell the test writer clearly loved Java and TestNG. I could tell- the variables were all camel cased, there was deep layers of over abstraction, the folders were organized like a Java project. The only things Robot Framework-like about the project were the sections and the keywords. When I suggested to use Robocop and Robotidy to clean up the code I was met with resistance and skepticism. They wanted their project to look and feel like Java. (For the record they did not write any custom libraries in Java, that would have made more sense.)
My problem was that even though I was hired for my Robot Framework expertise I had no clear documentation of tool best practices. I ended up writing the Robot Framework style guide for the company, and that is when it hit me: Python has PEP8, Java has Code Conventions, C# has Code Conventions.
Robot Framework has no official style guide other than the examples in the user guide and what can be enforced through Robocop.
From my adventures through the internet of assembling the “way of the robot”- I realized this is not just a single company issue, it is a Robot Framework problem. Outside of functional syntax Robot Framework allows for the most horribly organized, ill formatted, and happenstance code to successfully execute. Sure- other languages have these problems too, but it seems amplified in RF because it is often a tool of non-coders to write automated tests. I have seen test cases that were 30 steps long, all the keywords were lower cased, and all the variables were too. It was similar to reading a book by Herman Mellville. The script worked but was very difficult to read, which in my mind is dangerous.
Whenever I start a presentation about Robot Framework, I always state that it is both awesome and baneful because it is incredibly flexible.
So, after some forum/slack conversations I want to use my style guide notes and begin creating something for the community: RF-8 (why not steal from PEP 8)
Okay maybe we can call it something else but let us start somewhere familiar. Considering that most Robot Framework projects are riddled with python, it does not seem like a stretch to use the PEP 8 guide as a template. Combine the good examples found in the user guide with clear examples based on the Robocop user guide; creation of a core style guide can be quickly assembled.
Music Composer with a passion for technology (and a decent paycheck). I have been working for software development companies for 14 years. Automation has been my core focus for the last 8 years utilizing various scripting tools and languages for tests and other processes.
I am an avid sourdough break baker (even pre-pandemic), home brewer, and Raspberry Pi tinkerer. I am an active musician in my area playing Horn (French Horn) and British Tenor Horn. My happy place is writing and arranging music for the groups I play.
While not officially diagnosed, I am a gnome-a-holic and do not plan to go into any recovery program for the malady.