Wednesday, January 31, 2018

Testing Tour Stop #2: Pair Automating with Thiago

My testing tour had started out this year by pair exploring with Maaret Pyhäjärvi. After taking time to reflect, I moved on to my next stop as a testing traveler. Today the tour led me to pair with my colleague Thiago Amanajás on test automation. I was really looking forward to this session, as I've planned to initiate cross-team pair testing within our company's testing community for quite some time now, but never found the right moment to get it started. My testing tour experiment felt like a perfect fit to make it finally happen!

Diving Into Automation

Thiago is currently working on an automation project to cover the most critical scenarios through the UI of his team's web application. We both agreed to pair on this topic as he wanted to get some feedback and input from a different perspective, and I wanted to improve my automation knowledge and skills.

We planned to have a session of 90 minutes, being collocated in the same small meeting room, having one laptop and one further screen in front of us. Thiago started out with an introduction to their product and the current status of the automation project. He showed and explain the tools used, problems encountered, scenarios covered so far. I used the time to ask questions and compare the situation with what I've experienced in my current product team to gain a better understanding of what there is to build on.

Having set the stage, we wanted to extend the project by another scenario. We chose a feature which was easy to understand but also introduced a new complexity: checking that the mobile website for Android displays a certain banner on the first visit, but not anymore for the next page visits due to a stored cookie. Using Selenium for browser automation, this meant we needed to introduce an Android driver.

Being highly focused on the task at hand, we noticed a bit too late that we already breached our timebox of 90 minutes. As we were eager to find a solution for the current problem we faced, we agreed to go for full 120 minutes, wrapping it up with a short retrospective.

Either Learning or Contributing

One of the principles I really like about mob programming, or any activity done in a mob, is that you should be either learning or contributing. If one of both is true, the mob is valuable. From my point of view, the same proves to be true for pairing. In this session, I learned some interesting things.
  • I finally saw testNG running in action and learned quite a bit about this testing framework in combination with Selenium.
  • The problems around test automation Thiago solved or still encounters were quite familiar, comparing them to those my product team faced when implementing automated checks through the UI. How to integrate them in a build pipeline or build a pipeline for them? How to structure the test runners and which parameters to let the user provide when running the tests manually? How to work around authentication via single sign-on? Which test data and database to use? How to collaborate on test automation together with the developers and raise testability issues? How to select web elements in case we don't have IDs available?
  • The Chrome extension Katalon Automation Recorder was completely new to me, but proved to be a really interesting tool to quickly discover how to select elements best. It's a bit like Selenium IDE for Chrome, but its best feature is that after recording you can export the result in e.g. Java and make use of the snippet without many adaptions!
  • Another plugin I did not know of yet and came in quite handy was the User-Agent Switcher for Chrome. It does not only allow you to switch between the predefined user agents, but also let's you define your custom ones to test against.
Furthermore, I was happy to not only learn but also contribute myself to the progress of the automation project, as well as share the one or other tip.
  • Speed up commenting of code blocks by using the related IDE shortcut instead of manually doing it (one of my favorite shortcuts!).
  • Googling is a skill we use every day. Improve your searches by not only getting better at finding good search terms, but also by getting aware of other search options. For example you can exclude certain terms (like "appium") by just adding a minus right before it ("-appium").
Just before the end of our session we both discovered Selendroid, a Selenium-based test automation framework for Android. I'm curious to learn more about it!

Observations & Reflections

What else did we learn? First of all, that the session was both fun and really valuable to both of us. We both appreciated the constant feedback from the other, keeping us on track what's still to do as well as giving guidance what to do next. Four eyes simply see more, and two brains trigger more ideas. At no point we had a problem where we could not agree where to go next, or even got stuck. There was always one of us who came up with the next step.

Having two persons sitting together in front of the problem also created the opportunity to discuss different approaches, find good names together, or think about how to best structure the project. We were glad to finally have someone to share our thoughts with and get them challenged! As Thiago said: "it made him think". I can't express it better.

Our collaboration went really smoothly, even though none of us addressed the topic of how to pair. Shall we have one of us stay at the keyboard? Or switch roles? And which approach would we use, traditional or strong-style pairing? When reflecting, we learned from each other that we both thought of the topic at the beginning of the session, but didn't address it with the intention of seeing where it would lead us. Thiago started out with the keyboard in front of him, and he even tried to move it towards me once, but I didn't realize his intention at all. Meanwhile I made up my mind and decided to try out that we both navigate but he stayed at the keyboard. And interestingly, it worked really well. Still, some experiments cannot be run twice with the same conditions, so I cannot tell how it would have been in case I would have either asked him upfront to pair strong-style, or requested the keyboard during the session. We both agreed that it would be interesting to see our dynamics in case I would get the keyboard, or if we even place two keyboards in front of us. In any case we would both love to do further pair testing sessions and experiment with different collaboration styles, while constantly improving the automation project and thus providing additional value to our company.

My thanks go to Thiago for becoming part of my testing tour, sharing his knowledge with me and the great collaboration. I'm already looking forward to our next sessions, curious what we might learn then!

No comments:

Post a Comment