[Rd] How to test impact of candidate changes to package?

Stephanie Locke stephanie.locke at optimumcredit.co.uk
Wed Sep 10 09:55:23 CEST 2014


I use a package to contain simple functions that can be handled by unit tests for correctness and more complex functions that combine the simple functions with business logic.  Where there are proposals to change either the simple functions or the business logic, a sample needs to be run before the change and then after it to understand the impact of the change.

I do this currently by
1. Using Rmarkdown documents
2. Loading the package as-is
3. Getting my sample
4. Running my sample through the package as-is and outputting table of results
5. sourceing new copies of functions
6. Running my sample again and outputting table of results
7. Reloading package and sourceing different copies of functions as required

I really don't think this is a good way to do this as it risks missing downstream dependencies of the functions I'm trying to load into the global namespace to test.

Has anyone else had to do this sort of testing before on their packages? How did you do it? Am I missing an obvious package / framework that can do this?

Cheers,
Steph

--
Stephanie Locke
BI & Credit Risk Analyst




The contents of this e-mail and of any attachments transmitted with it are confidential and intended solely for the use of the individual(s) to whom they are addressed. If you are not an intended recipient or the person responsible for delivering this e-mail to the intended recipient(s), you have received this e-mail in error, and access to it by you is not authorised. You may not use, copy, distribute, disclose or rely on it or any attachment, or any part of it or any attachment in any way. If you have received this e-mail in error please notify Optimum Credit Ltd by email on webmaster at optimumcredit.co.uk or phone on 03330 143125 and then delete it.

All reasonable precautions have been taken to ensure that no viruses are present in E-mail. As we cannot accept responsibility for loss or damage arising from the use of E-mail or any attachment we recommend you subject these to your usual virus checking procedures prior to use. Any opinions expressed in this e-mail are those of the person sending it and not necessarily those of Optimum Credit Ltd.

Optimum Credit Ltd, Haywood House South, Dumfries Place, Cardiff, CF10 3GA

Authorised and regulated by the Financial Conduct Authority

Optimum Credit Ltd. Registered office: Haywood House South, Dumfries Place, Cardiff, CF10 3GA. Registered in England and Wales No. 08698121

Calls may be monitored or recorded for training, compliance and evidential purposes.



More information about the R-devel mailing list