April 10th 2020 -Developing on existing codebase.
These past few days I have been doing my development basing it on my teammate's code. Over the years I have gathered a few tips to help anyone who is set to work on an existing codebase. I had to consume the API to create a tic-tac-toe frontend game, host it so that anyone can play it at any time or place. It's intimidating to figure out where to start from because you know nothing about the codebase.
So the first thing I did was to look at the readMe file to find out more about the project. This helped me set up the project and got more insight into how to use the API. Then I had to run the tests to ensure everything is working. The API was developed using TDD so with the tests passing, this proves that everything works as expected. The tests also helped to explain more about the code and how it works. I used to rely on doc-strings and comments but of late I have learned that if the tests are properly structured and given the appropriate names, there can work as documentation. After this, I had to test out the endpoints on postman.
There were times when I needed to tweak things a little by adding more functionality or change a few lines of code. For this, I had to write new tests and ensure that existing ones don’t break for the case of adding new functionality. For the case of changing implementations of existing functions, I had to fix the tests. I also reached out to the developer who worked on the API to let him know about the new changes, we then had a chat then I proceeded with development.