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

Fix #1820 : How to approach Bugs? - Documentation #4957

Merged
merged 5 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions wiki/Debugging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
We do a lot of debugging at Oppia-Android, whether because tests are failing on a PR or because of a tricky bug that was found during release testing. This guide will help you get started with debugging and offer useful tips:

## How do I find the root cause of a bug?

Generally, finding the root cause of a bug is a question of strategically checking various things so that you can narrow down the "search space" of its possible causes. Here is an approach that you can use to get started:

1. First, try to reproduce the bug. If you can, that's great; that means you have a way to check whether your fix works. Otherwise, see if you can figure out what circumstances cause the bug to appear (is it on a particular device, does it happen only on either the prod or dev build, etc.). This is important because you will need to find a way to reliably reproduce the bug, in order to test whether your fix worked.
2. If this issue arose in your PR, then check whether the bug appears in develop. If so, then you know that it's not due to changes in your PR, and can do further investigation directly on develop. Otherwise, you can narrow down the cause to a change in your PR.
3. Based on the environment you've identified in steps 1 + 2, write a test case which the bug causes to fail (if one doesn't already exist). This gives you an automatic way to check whether or not the bug is fixed.
4. Then, work towards the solution, until the test case you wrote in step 3 passes.

Unless the bug you are trying to fix is trivial, we strongly recommend creating a debugging doc to organize your work. You can use this debugging doc to write down any pertinent information about the issue and to organize your debugging process, and it will make it much easier to ask for help from others since all the necessary information is there. You can find more guidance [here](https://github.com/oppia/oppia-android/wiki/Get-Help#before-you-ask-a-general-question) on how to write a debugging doc.
2 changes: 2 additions & 0 deletions wiki/_Sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
* [Ktlint Guide](https://github.com/oppia/oppia-android/wiki/Ktlint-Guide)
* [Static Analysis Checks](https://github.com/oppia/oppia-android/wiki/Static-Analysis-Checks)
* [Accessibility Guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide)
* [Debugging](https://github.com/oppia/oppia-android/wiki/Debugging)
* [How do I find the root cause of a bug?](https://github.com/oppia/oppia-android/wiki/Debugging#How-do-I-find-the-root-cause-of-a-bug)
* [Background Processing](https://github.com/oppia/oppia-android/wiki/Background-Processing)
* [Kotlin Coroutines](https://github.com/oppia/oppia-android/wiki/Kotlin-Coroutines)
* [DataProvider & LiveData](https://github.com/oppia/oppia-android/wiki/DataProvider-&-LiveData)
Expand Down