The Wayback Machine - https://web.archive.org/web/20200521103009/https://github.com/neherlab/covid19_scenarios/issues/19
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests #19

Open
ivan-aksamentov opened this issue Mar 17, 2020 · 8 comments
Open

Add tests #19

ivan-aksamentov opened this issue Mar 17, 2020 · 8 comments

Comments

@ivan-aksamentov
Copy link
Member

@ivan-aksamentov ivan-aksamentov commented Mar 17, 2020

In order to perform refactoring and to add new features with more confidence, we need unit, integration and end-to-end tests for:

  • algorithm parts. Seesrc/algorithms

  • React parts - components and pages. See src/components and src/pages

  • State management: redux reducers and sagas. See src/state

The infrastructure:

  • jest and @testing-libraryare already set up. Unit and integration tests can be ran with yarn test or yarn test:watch

  • cypressis planned for e2e tests

  • We plan either Travis CI or CircleCI for continuous integration

Any help is appreciated!

@Joluma
Copy link
Contributor

@Joluma Joluma commented Mar 21, 2020

@ivan-aksamentov did you already start implementing e2e with cypress? I can help with that.

@ivan-aksamentov
Copy link
Member Author

@ivan-aksamentov ivan-aksamentov commented Mar 21, 2020

@Joluma
Hi Joël, I haven't started yet. But the e2e testing is probably one of the most valuable things to contribute.

It may be tricky, because many parts of the project are changing rapidly. For example, I have a huge Redux revamp coming soon(ish). We are in process of changing how some of the widgets behave. So the tests will have to be adjusted frequently.

Also, Plots might be somewhat hard to operate automatically. If you have app testability improvements in mind (for the app source code itself), it is very welcome too.

Feel free to try it out!

@ivan-aksamentov
Copy link
Member Author

@ivan-aksamentov ivan-aksamentov commented Mar 21, 2020

Some more thoughts on unit and integration tests:

  • The goal is to bring confidence that refactors and new features don't break the results.

  • Most importantly, care should be taken to not produce wrong science in the end! That's people's lives counts, not just numbers we are juggling there.

  • Focusing on testing run() function is somewhat pointless, I think. It's an entry point of the algorithm and it has too many parameter combinations and too many possible results to cover.

  • Instead, we should focus on writing slightly more granular tests for everything in the src/algorithms/ directory.

  • Overall, in terms of testing, I am in the same camp as Guillermo Rauch (@rauchg) and Kent C. Dodds (@kentcdodds): "Write tests. Not too many. Mostly integration." .

Adding more tests and improving the app testability will ensure that we can expand the app's usability and add more interesting algorithmic features.

Contributions are desperately needed!

@szonjajakab
Copy link

@szonjajakab szonjajakab commented Mar 21, 2020

I could do the CI building if its not taken.

@owais-eng
Copy link

@owais-eng owais-eng commented Mar 21, 2020

abrie added a commit to abrie/covid19_scenarios that referenced this issue Mar 21, 2020
gj262 added a commit to gj262/covid19_scenarios that referenced this issue Mar 22, 2020
@gj262 gj262 mentioned this issue Mar 22, 2020
gj262 added a commit to gj262/covid19_scenarios that referenced this issue Mar 22, 2020
abrie added a commit to abrie/covid19_scenarios that referenced this issue Mar 22, 2020
ivan-aksamentov pushed a commit that referenced this issue Mar 22, 2020
related: #19
ivan-aksamentov pushed a commit that referenced this issue Mar 22, 2020
Related to #19 

* Add granular tests for all functions in TimeSeries module.

These tests assume that the current algorithms are correct.

* Adjust import paths and file location for new repository layout.

* Add updateTimeSeries() test for case when TimeRange is changed.
gj262 added a commit to gj262/covid19_scenarios that referenced this issue Mar 23, 2020
ivan-aksamentov added a commit that referenced this issue Mar 23, 2020
abrie added a commit to abrie/covid19_scenarios that referenced this issue Mar 23, 2020
abrie added a commit to abrie/covid19_scenarios that referenced this issue Mar 23, 2020
abrie added a commit to abrie/covid19_scenarios that referenced this issue Mar 23, 2020
abrie added a commit to abrie/covid19_scenarios that referenced this issue Mar 23, 2020
ivan-aksamentov pushed a commit that referenced this issue Mar 23, 2020
Related to: #19 

* Add granular tests for all functions in TimeSeries module.

These tests assume that the current algorithms are correct.

* Adjust import paths and file location for new repository layout.

* Add updateTimeSeries() test for case when TimeRange is changed.

* Fix (most) linter warnings in TimeSeries tests.
nnoll added a commit that referenced this issue Apr 1, 2020
add India state-level data
@davihans
Copy link
Contributor

@davihans davihans commented Apr 9, 2020

Hi all,

My partner shijurodhaz and I are cs students who would like to help contribute to this project. Is the area most in need of tests still src/algorithms/, or is there another area we should focus on first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
7 participants
@Joluma @ivan-aksamentov @davihans @szonjajakab @owais-eng and others
You can’t perform that action at this time.