Hacktoberfest Last Pull Request – Writing Test

The last pull request that I worked on was to add a test to Math Worksheet Generator, which is posted in this issue. As opposed to bug fixing and adding new feature in my previous pull requests, this time I focused on writing the test itself, which may…


This content originally appeared on DEV Community and was authored by DenisC

The last pull request that I worked on was to add a test to Math Worksheet Generator, which is posted in this issue. As opposed to bug fixing and adding new feature in my previous pull requests, this time I focused on writing the test itself, which may not have an immediate impact, but would definite improve maintainability of the project in the long run.

Finding the missing test

A comprehensive test set helps identify bugs and allows re-testing in the future to ensure that the program runs normally after updates, therefore, we should identify the missing piece in the current test set. I first went through the current test cases in the project, and spotted that there was no test case to check for the option of mix question type, which generates math questions with random operator (+,-,x,/). It would be a good idea to add a test to check if question and answer are generated properly with the mix type.

Writing the test

Now that I had decided what test to be written, I could go ahead and write the test. Similar to adding new feature, I also have to stick to original coding style when writing the test, which I have become more proficient after weeks of practice working on open source projects. A minor problem arose when I tried to push my codes after writing the test, I found that I've included the codes related to another issue that I worked on in the same repo. Then I realized that I had created a new branch from the branch for another issue instead of from the main branch. I had to re-creating a branch from the main branch, add the new test in the right branch, and eventually made a pull request.

Lesson learnt and future planning

In this pull request, I've gained experience examining existing test set, and writing test that improve the comprehensiveness of the test set. Additionally, I'm more aware of branching in git, especially when working on multiple issues on the same repo at the same time. Now I've built a habit of using git status to check the current branch first before creating new branch. Though this is my last pull request for Hacktoberfest, I will continuously look for open source projects that I'm interested in, and try my best to contribute to the open source community in the future.


This content originally appeared on DEV Community and was authored by DenisC


Print Share Comment Cite Upload Translate Updates
APA

DenisC | Sciencx (2025-10-30T21:31:41+00:00) Hacktoberfest Last Pull Request – Writing Test. Retrieved from https://www.scien.cx/2025/10/30/hacktoberfest-last-pull-request-writing-test/

MLA
" » Hacktoberfest Last Pull Request – Writing Test." DenisC | Sciencx - Thursday October 30, 2025, https://www.scien.cx/2025/10/30/hacktoberfest-last-pull-request-writing-test/
HARVARD
DenisC | Sciencx Thursday October 30, 2025 » Hacktoberfest Last Pull Request – Writing Test., viewed ,<https://www.scien.cx/2025/10/30/hacktoberfest-last-pull-request-writing-test/>
VANCOUVER
DenisC | Sciencx - » Hacktoberfest Last Pull Request – Writing Test. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/10/30/hacktoberfest-last-pull-request-writing-test/
CHICAGO
" » Hacktoberfest Last Pull Request – Writing Test." DenisC | Sciencx - Accessed . https://www.scien.cx/2025/10/30/hacktoberfest-last-pull-request-writing-test/
IEEE
" » Hacktoberfest Last Pull Request – Writing Test." DenisC | Sciencx [Online]. Available: https://www.scien.cx/2025/10/30/hacktoberfest-last-pull-request-writing-test/. [Accessed: ]
rf:citation
» Hacktoberfest Last Pull Request – Writing Test | DenisC | Sciencx | https://www.scien.cx/2025/10/30/hacktoberfest-last-pull-request-writing-test/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.