refactoring

What I edit when refactoring a test file

This post was featured on the R Weekly highlights podcast hosted by Eric Nantz and Mike Thomas. I’m currently refactoring test files in a package. Beside some automatic refactoring, I am also manually updating lines of code. Here are some tips (or pet peeves, based on how I look at it / how tired I am 😁) Prequel: please read the R packages book The new edition of the R Packages book by Hadley Wickham and Jenny Bryan features three chapters on testing, all well worth a read.

Automate code refactoring with {xmlparsedata} and {brio}

Once again a post praising XML. 😇 These are notes from a quite particular use case: what if you want to replace the usage of a function with another one in many scripts, without manual edits and without touching lines that do not contain a call to replace? The real life example that inspired this post is the replacement of all calls to expect_that(..., equals(...)), like expect_that(a, equals(1)), in igraph tests with expect_equal().