At BrowserStack, we rely on various open source projects in order to build world class products. In this series, we bring you the stories of stand-out developers who have made amazing contributions to the world of technology through open source.
Featured in this edition of Spotlight is Leonardo Balter, one of the core contributors to QUnit—a popular JS unit testing framework capable of testing any generic JavaScript code (including its own).
Leo is a senior Open Web engineer at Bocoup, and represents the company at TC39—the committee that oversees the development of JavaScript itself.
Q: How did your open source begin? What got you started with QUnit?
Leo: I started my journey with open source back in the mid-90s when I wrote with my dad—also a programmer—the first CEP search tool in Brazil. CEP is the equivalent to the zip code in the USA. All we had were huge text files cataloging the codes and addresses and no easy way to search through them.
After we finished it, my dad explained to me that it needed a GNU license to make sure it would always be distributed for free. I was impressed by the value of sharing public information for free and not taking control of these things.
I started using QUnit somewhere around 2009, but since then I started finding small issues or things I'd like to improve, including new features I wanted to add. Somewhere around 2011, my coworkers told me that I should spare some work-time on these improvements and bug fixes, as they would reflect the usage of the tool for the company's product. It became a hobby and I learned a lot from the jQuery team at the time.
Q: What are your favorite development tools? What do you like about them?
Leo: I like a pretty simple setup and I avoid having anything overkill in my tools. A simple text editor without extensions works pretty well. Anything that lets me see a file tree, search through the files and save them will do the trick. I currently use the Visual Code editor for projects, but I still have Sublime Text for quick edits. I use Vim for very quick updates and commit messages.
Git and GitHub are probably the tools I don't want to replace with anything else these days. I tried several version control systems, but honestly, I like my comfort zone. Beyond that, I only need a bash terminal with Node and some browsers installed. Specific computers are just comfort and some add-ons can become too much information for my daily usage.
Q: How do you wear dual-hats of open source contribution and a day job at Bocoup? Can you share some of your productivity secrets?
Leo: The biggest challenge in working in different projects is knowing how to handle context switching. It's hard and might be stressful if not organized. My big secret is working with great project managers that help me stay on track. They also keep me from going too deep into rabbit holes, like focusing on something different from my current goals that won't have a big, immediate impact.
Syncing priorities is key to keep a good pace in multiple projects. I'm able to define some priorities in many of the projects I work at, but experience allows me to manage estimation and making sure my work is matching the project goals as well.
"My big secret is working with great project managers that help me stay on track. They also keep me from going too deep into rabbit holes, like focusing on something different from my current goals that won't have a big, immediate impact."
Q: Which open source projects do you rely on (outside your own)?
Leo: So many! My work as a TC39 delegate, representing Bocoup, is based on a discovery of what reflects each web developer's everyday work. I like to learn how things work in different ways—maybe to form an opinion on how they should be specified or extended.
Q: How’d you describe your JavaScript coding pattern?
Leo: Intentionally chaotic. Part of my TC39 work is maintaining the Test262 tests, the official test suite for ECMAScript. This means I need to write tests that cover every aspect described in the spec. I need to think of the most bizarre usage someone could ever make of the language, way beyond the beautifully formatted code. This helps the language get implemented consistently and without many surprises if users have different browsers. Cross-browser compatibility is probably my career goal or the holy grail of every front end developer.
Q: What’s the peskiest bug you’ve come across? How did you fix it?
Leo: Most of them are related to the most ridiculous typos. Naming things is hard. I remember a case where I had some tests causing a false positive, passing when they should be failing. A specific function call should throw a TypeError if called with a given argument, but I typo-ed its name—from something like ‘doSomething’ to ‘dosomething’ and they were throwing a TypeError because of the classic "undefined is not a function" error. This is the sort of bug that might take a while, until we finally understand why it’s passing even with the feature off.
Most other pesky bugs relate to cross-browser problems. Back in 2010, I was working on a private task, trying to control a payment form that could only be used as a popup window. If I had it fixed for Chrome, it wouldn't work on Internet Explorer. The proper fix for Internet Explorer would make it stop working on Chrome. When I finally fixed both I had Firefox breaking. It was hard to find any solution. Most people told me: "don't use popups". But it was a business requirement, already contracted.
At some point I had it working. Fortunately, the company was able to plan a non-popup plan in the following months.
“Most other pesky bugs relate to cross-browser problems. Back in 2010, I was working on a private task trying to control a payment form that could be only used as a popup window. If I had it fixed for Chrome, it wouldn't work on Internet Explorer. The proper fix for Internet Explorer would make it stop working on Chrome. When I finally fixed both I had Firefox breaking. It was hard to find any solution.”
Q: What’s your advice to developers who are on the fence about contributing to open source? How can one 'sustain the momentum' once they’ve started?
Leo: Open Source projects are pretty helpful for learning things you won't be able to learn in closed groups. You connect with other people, who eventually help you improve your work. Be ready to fail, listen and learn.
Also, improving an existing open source project will allow you to carve out the path you want a project to take, like implementing a feature that you might find useful for your own products/projects in future.
Q: What would you want to change about the programming community?
Leo: There is still work to be done towards an inclusive and diverse programming community. We can only grow if we learn to be inclusive.
One of the biggest values of open source projects is to connect with people of different backgrounds, with different knowledge, experiences and vision. If we block that, we limit ourselves to what we already know. Being inclusive is an opportunity to learn and become better professionals.
“One of the biggest values of open source projects is to connect with people of different backgrounds, with different knowledge, experiences and vision. If we block that, we limit ourselves to what we already know. Being inclusive is an opportunity to learn and become better professionals.”
Q: What do you do in your spare time?
Leo: I play guitar and video games, but I'm currently spending most of my spare time on parenting.
My love for guitars is directed to actually modding them—changing and experimenting with things. It's a development of better builds and modifications to match my preferences.
Being a parent also requires me to find better ways to communicate with my child, understand signals, corporal language, and make sure everyone is happy.
Q: The people / projects / books / habits that changed your life.
Leo: I wouldn't be here without my partner, who supported me at every step in my career.
As for habits, playing video games and modding guitars eventually got me interested in writing software. Traveling abroad gave me another push towards programming. It was a privilege that made me reflect on why I wanted to do something that would connect me with other people. It showed me my bubble and the whole world beyond it that I had to see.
Check out QUnit on GitHub.
(Responses are edited for clarity).
We ❤️ open source. Fill out this form to get free, lifelong access to BrowserStack for your project's testing needs.