DEV Community

mpa-LHutchinson
mpa-LHutchinson

Posted on

Week 2: Lab 1 code review

Introduction

This week I started working on my 0.1 release project, which involves creating a command line tool that takes in files and uses an AI model to manipulate it in some way or do something with it. For my project, I chose to have it read a file and ask the AI to write a README file about it, appropriately naming the project "Auto-README".

Even though my project is nowhere near finished, this week for lab 1 I needed to get my own code reviewed by someone else, and I had to review another persons project. In this blog, I'm going to talk about how the code review went for me this week and answer some questions related to what I learned.

How did you go about doing your code reviews? Do you prefer an async or sync approach? Why?

Me and my lab partner decided that we would send each other our repos whenever we were ready to present them (before lab 1 would be due of course). We ended up making working versions of our projects on around the same day, and started making the issues the next day on our own time. While working synchronously with someone has its benefits, it's important to note that not everyone will be able to work at the same pace. My lab partner for instance planned to go to the gym at the time I would be accessing his repo to see his code, and this was perfectly fine. I believe working at your own pace makes the task of code review a much smoother and relaxing process for both ends.

What was it like testing and reviewing someone else's code? Did you run into any problems? Did anything surprise you?

Funny enough, my lab partner decided to make a similar project to me. That is, one that takes a file and uses AI to generate a README file about it. The main difference was he used python to build his project, and I used javascript. So it was interesting to see what their approach to the project was like. I did run into some problems with his code that I thought needed to be fixed, and those will be addressed when I talk about the issues I created in his repo. There wasn't much that surprised me, as the concept and even commands he made were similar to mine.

What was it like having someone test and review your code? Were you surprised by anything?

I liked having someone else review my code overall. I knew there would be problems with it, as I haven't finished all the small features of release 0.1 and mainly focused on getting the big aspect of it to work, that being the feature to generate README files using AI. Other features of the project such as a help command, the ability to work with multiple files, and even a README file for my project are not yet implemented for my project, and I fully intend to make this a complete release by next week.

What kind of issues came up in your testing and review? Discuss a few of them in detail.

One of the main issues when testing my lab partners code was that I couldn't do anything with the code unless I had an API key. I wasn't even able to use simple commands to display information like -version or -help, since the code would make an error if there was no API key regardless of the command line arguments. I pointed this out in one of the issues on their github, even providing a screenshot. Other issues I noticed were just related to missing requirements, like the ability to work with multiple files and another optional feature.

Provide links to issues you filed, and summarize what you found

Here are the links to the issues I filed on my lab partners repo:

In summary, I found:

  • At least one more optional feature needs to be added to be complete
  • The user needs to be able to use some parts of the program without an API key, like the version and help commands
  • The program needs to be able to take in multiple files and have them analyzed by the AI model

Provide links to issues that were filed on your repo, and what they were about

Here are the links to the issues my lab partner filed on my repo:

In summary:

  • My repo is missing a README file for it, which details how to use it
  • The command line does not accept a --help or --h argument
  • Like my lab partners project, it is unable to accept and analyze multiple files

Were you able to fix all your issues? What was that like?

All of the issues my lab partner pointed out in my project are, as of this blog post, not fixed yet. I intend to work over the next week to correct these issues and add all the features needed for the first release. Since my project is about using AI to create README files, I actually intend to use the tool to create a README file for my repo. Of course it won't be 100% AI generated but I believe using the tools of a project to help work on the project itself is a very cool way to go about this.

What did you learn through the process of doing the testing and reviewing?

Throughout testing and reviewing another persons repo, I learned many things and gained more experience. I learned how to work with someone elses command line tool, reading into their code and documentation to figure out how to use it. Since we worked on a similar project, I also got to see how we approached a different problem. I also learned about what I could potentially add to my own project in the upcoming week. Overall, I'm excited to finish my project and see how giving and receiving feedback will be able to push both of us further.

Top comments (0)