Open Sourcing Dtective

Sofia Vistas
Catena Media RnD
Published in
6 min readSep 16, 2019

It was a very hot and humid afternoon of July 2018 when I walked home with my mind boiling with the possibilities and — heck! — craziness of my colleague’s suggestion: “Let’s open source our test framework!”

Start with Why.

Why do we think that this is a good idea given that there are plenty of test automation frameworks out there? Why being afraid to be proud of our work? Why is this important for us, as part of the tech innovation ecosystem and as engineers?

Each and every one of us has different motivations, set of values and experiences that we bring to a creative endeavour. When we sat down to discuss the possibility of open sourcing we started with commonality though — why do we believe in what we do.

Solving common problems.

To answer those questions we took a step back to reflect on our personal experiences.

I had the feeling of reinventing the wheel every time I designed and implemented a test automation framework at a new job, even for different business domains. Assembling parts of the tech stack more efficiently was a result of previous experience, yet spending time on its setup had its costs.

How many of us have implemented the logic that tests a user login? A GET request to an API? Why do I even have to use a tool for backend and another for frontend? And another for visual regression testing? And another for non functional stuff?

A common denominator we all shared was the communication issues regarding what a piece of software is supposed to do. Agreeing on user flows for features before diving right into the development phase, saving countless wasted hours on pointless requirements, was material for legends and myths.

By having product owners, designers, developers, QAs and other stakeholders talking a simple and universal language that describes these flows, we enable the understanding of potential pitfalls and challenge initial assumptions. Behaviour Driven Development is a great technique to bring acceptance criteria back in fashion, but why aren’t we having those conversations together still?

In conferences, meetups, talks, sessions, coffee breaks, water coolers, you can hear the echoes of these common problems. Couldn’t there be a generic layer in our frameworks that helps solving these recurrent issues that are domain agnostic and driven by the need for quality to grow in our organisations?

The Nash Equilibrium and Open Source.

Many companies nowadays continue to feel that their employees should not be contributing to the open source community since they pay the employee and therefore own their work. This mentality is not the most viable and profitable in the long run, according to game theory’s Nash Equilibrium.

The Nash Equilibrium, named after the mathematician John Nash — famously represented by Russell Crowe in the Oscar winning film A Beautiful Mind — attempts to determine mathematically and logically the actions that participants of a game should take to secure the best outcomes for themselves. In the Nash Equilibrium, each player’s strategy is optimal when considering the decisions of other players. Every player wins because everyone gets the outcome they desire.

A representation of such optimal equilibrium in the software industry is when all companies both use and contribute to the open source community. If all companies attempt to only use open source software without con­tribut­ing, other companies will not see the advantage to con­tribut­ing and everyone will suffer. Whereas, if all companies who use open source software also contribute, all companies will benefit and profit.

When it is about to solve common problems, participation of all companies is not only beneficial to all, but also necessary for the leap that innovation requires. Catena Media, our employer, does not only believe in open source but goes great lengths to foster innovation. So, are we choosing to reinvent the wheel every time or join common efforts and start focusing on what is important to bring our businesses forward?

Learn as you go. Have fun.

We had conversations that would have probably not sparked otherwise. The responsibility of producing high quality code is increased when we are publicly exposed. Suddenly we were talking about what code quality standards meant for us and the outcome helped to improve a lot our own abilities to develop clean, consistent and documented code.

To achieve this, we integrated checkstyle with Maven and used Jekyll and GitHub Pages to support a minimal, reader friendly documentation hosted together with our source code.

It is also very important to focus on the infrastructure around the code. We put a lot of thought into how people can easily contribute and get involved in ways that aren’t just code. One way to accomplish this was by integrating Dtective with TravisCI (free for open source projects) where our framework set of tests are run once a pull request is open by a contributor. This offers an almost immediate feedback on how the contribution is a) meeting the code standards criteria b) is not breaking existing functionality.

We laughed a lot too. Our team went for a weekend in Gozo where we spend time writing documentation, laughing at our own code from ages ago (seriously, who wrote that?!), agreeing on code quality standards over grilling and dancing to our maintenance song. Yes, we do have a maintenance song when we are setting up projectors and other technicalities. 😬

Community.

To use a favourite metaphor of mine I’ll introduce you the cake:

The first impression of this cake is probably a very visual one. The layers, the colours, some sprinkles… But what ultimately makes this cake truly delicious (it was featured in Netflix’s Chef’s Table — it should be!) is the quality of the ingredients and the ability in its preparation.

That is how we see this project. The features — like the appealing visuals of this cake — are plenty: support for codeless automation (more than 170+ steps implemented), low setup cost, same tool for backend and frontend testing, collaborative-friendly language, easy to integrate with CI/CD pipelines, extensible and much more, but it is truly the commitment of the community and support behind it that will eventually “make or break” the project.

We were very aware of this from the beginning, so our decisions were and will continue to be pretty much community-centric. Without a community there is no thriving in open source. We took special care in setting up several forms of engagement such as our Gitter channel or the template and label system in Dtective’s GitHub issue tracker, both places respecting our Code of Conduct. We also prepared a Cheatsheet and a thorough Contribution Guide, either for people who just want to quickly start writing tests or to those who want to engage with the project a bit deeper by giving back, too.

An Eternal bond.

Eternal sounds dramatic. Nevertheless, maintaining an open source project requires effort, commitment and emotional involvement. With lots of rewards, of course. The fact that we use Dtective internally means that we will continue anyhow to ideate, implement and grow the existing code base, keeping the project with higher chances of staying “fresh” while enforcing open source code quality standards.

Me and my fellow QA colleague Mat, have a quote we both like very much from T.Roosevelt:

It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming; but who does actually strive to do the deeds; who knows great enthusiasms, the great devotions; who spends himself in a worthy cause; who at the best knows in the end the triumph of high achievement, and who at the worst, if he fails, at least fails while daring greatly, so that his place shall never be with those cold and timid souls who neither know victory nor defeat.

Absolutely worth it.

Sherlock, Watson, Poirot, Dupin and the Maintainers at Dtective

Join our community @ 👉 https://gitter.im/Dtective/community

--

--