Skip to content
This repository has been archived by the owner on Jul 23, 2023. It is now read-only.

Create regression tests to allow changing your code confidently #17

Closed
maurolepore opened this issue Sep 21, 2018 · 3 comments
Closed

Comments

@maurolepore
Copy link
Contributor

From @maurolepore on September 18, 2018 15:35

One way to improve your functions with confidence that you are not breaking anything is to run regression tests -- tests that automatically compare the result of a computation against a know result. You can do this with testthat::expect_known_output(). It is a fairly advanced topic and I'm happy to help you.

Copied from original issue: ErvanCH/AGBflux_pack#16

@maurolepore
Copy link
Contributor Author

@ervanSTRI, please run data_preparation() with the data in data/ and send me the output. That output will be my reference to ensure I don't change the behavior of your function when I do some change. So far I have been very conservative. I have not made any changes that could affect the output (only changed a bit the style of the code and added some comments). But to really help you I will need to make bigger changes. And I can't do that safely until I have a regression test.

I need your help with this because right now, I fail to fun your function. And I don't want to try fix it because in doing so I may break something else.

@maurolepore maurolepore added the bug Something isn't working label Sep 21, 2018
@maurolepore
Copy link
Contributor Author

@ervanSTRI, I see that you added the folder output/ with some plots and a .csv file. The .csv file contains only what seems to be column-headers. Is that what you expect?

Also, I see the file "barro colorado island_formated_data.Rdata" in data/. When I load it its name is DF. Is this the output of data_preparaiton()?

As you advance in this and other issues, please leave a record here so I can quickly understand what is the state of each issue.

@maurolepore
Copy link
Contributor Author

maurolepore commented Oct 4, 2018

@ervanSTRI, is the object DF (named "barro colorado island_formated_data.Rdata" in data/. ) the one you are refering to when you write data(df): For example:

# data(df)
# correctDBH(df[treeID==240])

If so, notice that one is lowercase and the other one is uppercase. Also, I'm not clear about what DF is and whether it should live in data/ or not.

@maurolepore maurolepore removed the bug Something isn't working label Oct 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant