Skip to main content

Better Understanding Your Tools Choices with Online Book HTTP Testing in R

By May 15, 2023Blog

Working with internet sources can be a tricky subject. In order to deal with modern packages and workflows, a resource for testing online packages can be very useful. R Consortium talks to Maëlle Salmon about the online book, HTTP Testing in R, which she co-authored with Scott Chamberlain.

Photo of Maëlle: ©Photo Julie Noury Soyer 

Maëlle Salmon is a R(esearch) Software Engineer, part-time with rOpenSci. She regularly contracts for other organizations, often to develop or strengthen R packages. She also enjoys blogging about R, in particular R package development (on her personal blog, rOpenSci blog, and the R-hub blog). She is a volunteer software review editor for rOpenSci and a R-Ladies Global team member. She lives in Nancy, France.

Why is it so important to have this reference book?

For people writing packages that interact with internet sources, testing a package is always a challenge: for instance, you don’t want your tests to burden the online resource, you can’t trigger an API error to test how your package behaves in that case, etc. Before this book, there was no central place for learning about the tools one can use to help this process: vcr and webmockr, httptest, httptest2, webfakes. Also, since we compare the tools used in HTTP testing, it allows people to make a choice.

Who should use the HTTP Testing in R book? Is it aimed at developers, or does it have applications for individual users?

It is aimed at people writing packages, but these days there are many people who are writing packages as modern tools and guidance lower the barrier to package development. 

How responsive are you to new content and packages that may affect your book?

If someone opens a new issue in the book repository I try to respond quickly. I can add content based on these issues, if or when I have time. I also try to follow the changes to the packages that are explained in the book. Since the first update of the book, I added a chapter about httptest2, for example, a package for testing packages that use the more modern httr2 rather than httr. 

What format and languages is the book available in?

It is an online book. There is a website, a pdf book, and an ePub version. There is no current aim to publish in other languages. I am not against the idea, but the issue is that you would have to both translate and maintain the various versions. At this point, I do not think it would be a good idea to do this if there wasn’t a plan to maintain it in the language(s) that it has been translated. 

However, because of the work I’ve been doing for rOpenSci multilingual publishing project, including some funded by the R Consortium, I’m more open to the idea! For instance, we have a package for rendering a Quarto book in several languages and another one for getting an automated translation via DeepL API, that humans can build upon: 

How did you get involved?

The first version of the online book was created by my former rOpenSci colleague Scott Chamberlain. He started the book to document his packages vcr and webmockr, and I was interested in that, as it related to my work maintaining rOpenSci dev guide. I applied for funding to dedicate more time to the project and decided it would also be interesting to cover other packages that provide the same functionalities. Scott reviewed and contributed to all the new chapters.

What do you do for your day job?

I am a part-time research software engineer for rOpenSci, which supports open and reproducible science through tooling and community building. I also have different missions. For instance, I received funding from R Consortium to work on developer advocacy for R-hub a few years ago, and more recently consolidating R Ladies global guidance for advisors and wisdom, an online book. My work is often related to package development.

What was your experience working with the R Consortium? Would you recommend applying for a grant to others?

I’ve now received funding from the R Consortium several times, for which I am very grateful. Getting funding for an idea really helps with being able to focus on its execution!

I’d recommend getting feedback from collaborators or less close contacts, especially those who got proposals funded or those who’d be the target audience of a proposal, as they might help you clarify your ideas. I’m indebted to all those who reviewed my own proposals!

About ISC Funded Projects

A major goal of the R Consortium is to strengthen and improve the infrastructure supporting the R Ecosystem. We seek to accomplish this by funding projects that will improve both technical infrastructure and social infrastructure.