From 4da5c47e4d6e95bd74f832c3d94d55489b8d171f Mon Sep 17 00:00:00 2001 From: MohitGupta121 Date: Sat, 22 Apr 2023 20:38:53 +0530 Subject: [PATCH 1/3] Added approach for debugging --- wiki/Debugging.md | 11 +++++++++++ wiki/_Sidebar.md | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 wiki/Debugging.md diff --git a/wiki/Debugging.md b/wiki/Debugging.md new file mode 100644 index 00000000000..9fcf39dd7b9 --- /dev/null +++ b/wiki/Debugging.md @@ -0,0 +1,11 @@ +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. These guides will help you get started debugging and offer useful tips: + +## How to approach Bugs? +1. First try to find the exact reasons of the bugs. +2. Once you have identified the reason, write a test case which actually fails because of the bug. (This will be needed in future). +3. Now work towards solution. +4. Now, the test cases which were written in step 2 should pass and that way we can be sure that the bug has been fixed. +So at this stage you should focus on step 1. + +Unless the bug you are trying to fix is trivial, we recommend creating a debugging doc to organize your work: +- [Debugging Docs](https://github.com/oppia/oppia-android/wiki/Get-Help#before-you-ask-a-general-question) \ No newline at end of file diff --git a/wiki/_Sidebar.md b/wiki/_Sidebar.md index a3f7c429b7b..4e47a74783f 100644 --- a/wiki/_Sidebar.md +++ b/wiki/_Sidebar.md @@ -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 to approach bugs](https://github.com/oppia/oppia-android/wiki/Debugging#how-to-approach-bugs) * [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) From 161b66012b2a424e6e77aea27720348864af1701 Mon Sep 17 00:00:00 2001 From: MohitGupta121 Date: Tue, 25 Apr 2023 20:01:40 +0530 Subject: [PATCH 2/3] Updated Sean review changes --- wiki/Debugging.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/wiki/Debugging.md b/wiki/Debugging.md index 9fcf39dd7b9..09a91fa6857 100644 --- a/wiki/Debugging.md +++ b/wiki/Debugging.md @@ -1,11 +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. These guides will help you get started debugging and offer useful tips: +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 to approach Bugs? -1. First try to find the exact reasons of the bugs. -2. Once you have identified the reason, write a test case which actually fails because of the bug. (This will be needed in future). -3. Now work towards solution. -4. Now, the test cases which were written in step 2 should pass and that way we can be sure that the bug has been fixed. -So at this stage you should focus on step 1. +## How do I find the root cause of a bug? -Unless the bug you are trying to fix is trivial, we recommend creating a debugging doc to organize your work: -- [Debugging Docs](https://github.com/oppia/oppia-android/wiki/Get-Help#before-you-ask-a-general-question) \ No newline at end of file +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. \ No newline at end of file From 2b0d9e4b2800047fa6f0a91860400e1ec69f669f Mon Sep 17 00:00:00 2001 From: MohitGupta121 Date: Tue, 25 Apr 2023 20:03:27 +0530 Subject: [PATCH 3/3] sidebar updated --- wiki/_Sidebar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/_Sidebar.md b/wiki/_Sidebar.md index 4e47a74783f..a5bfa0aaf0e 100644 --- a/wiki/_Sidebar.md +++ b/wiki/_Sidebar.md @@ -36,7 +36,7 @@ * [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 to approach bugs](https://github.com/oppia/oppia-android/wiki/Debugging#how-to-approach-bugs) + * [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)