kiwix-android icon indicating copy to clipboard operation
kiwix-android copied to clipboard

Add more Unit Tests to the project

Open macgills opened this issue 5 years ago • 13 comments

Is your feature request related to a problem? Please describe. Kiwix's coverage is at 33%~ right now and we want that to be a lot higher. If you want to contribute to the project but are finding it diffcult to find a suitable ticket of a manageable size then this is for you!

Describe the solution you'd like Comment here that you want to test a class (I recommend starting with small ones) with the class name to claim it. Then make a ticket and start working on it. Use ctrl+shift+t to automatically create the test class. You can check our codecov report to find classes without tests, ctrl+shift+t also navigates to a test class if it already exists.

Additional context Our unit testing strategy is based on this article which is a recap of KotlinConf talk on the topic, linked in the article. Mockk is the one of the more important libraries to know about and that link has several articles on the topic. As always kiwix team members can help if you open a PR in Draft.

macgills avatar Feb 27 '20 09:02 macgills

@macgills I'd also like to work on tests starting with HistoryDao/HistoryEntity if that's ok.

Frans-Lukas avatar Mar 04 '20 15:03 Frans-Lukas

Hi, I'd like to work on this too! Interested in starting with the NewRecentSearchDao.kt module.

deborahlow97 avatar Mar 05 '20 02:03 deborahlow97

@deborahlow97 @Frans-Lukas Please, carry on.

kelson42 avatar Mar 05 '20 05:03 kelson42

Hi, I'm new here and I would like to work on this issue. Can I start by writing tests for LocalFileTransferActivity?

TejusR avatar Mar 06 '20 11:03 TejusR

@TejusR I would avoid Unit Testing any activity but please look for any other class

macgills avatar Mar 11 '20 16:03 macgills

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar May 10 '20 17:05 stale[bot]

I would like to add some instrumentation tests for navigation. As the current test that tests navigation(MainActivityTest.java) contains tests for lesser components as now the app has been revamped with some new features so i would like to complete that MainActivityTest.java via adding missing tests

s-ayush2903 avatar Aug 24 '20 20:08 s-ayush2903

@s-ayush2903 this ticket is for unit tests

macgills avatar Aug 25 '20 08:08 macgills

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar Dec 04 '20 20:12 stale[bot]

I would like to add test for NewBookmarkDao.kt class

s-ayush2903 avatar Mar 04 '21 21:03 s-ayush2903

i would like to add test for HistoryDao.kt class

bhaktideshmukh avatar Apr 04 '21 05:04 bhaktideshmukh

@bhaktideshmukh Please go ahead!

gouri-panda avatar Apr 04 '21 06:04 gouri-panda

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar Sep 03 '21 02:09 stale[bot]

This is the kind of ticket which never get closed because no clear boundaries. I obviously agree with the princiole but will close it because of this weakness. We should lead this effort based on Codecov feedback on CI. If someone has a clear wish regarding a precise piece of code, a dedicated ticket shoukd be open.

kelson42 avatar Jan 27 '23 06:01 kelson42