Home Assignments
Homework 1 Reflection
1. Coding
How long did you spend on this assignment?
I spent about 5 to 7 hours on this assignment.
Where did you spend the most time?
I spent most of my time fixing configuration issues, writing tests, and debugging request handlers, as well as figuring out how to properly create the tests.
What did you struggle with the most? What would’ve improved your experience on this assignment?
I struggled the most with changing the project from using Widgets to using Books and Authors. After completing the Books portion, much of the remaining work became easier through copy and paste. A big part of the process was understanding what each piece of code did and implementing the required changes. I also found it inconvenient to scroll back and forth between the Homework 1 website to find instructions, so having the instructions better organized would have improved my experience.
2. Typescript
What bugs did Typescript help you catch? What issues did it prevent, and what are some holes in the type system?
Typescript helped catch bugs when writing tests, such as preventing the deletion of required keys. I had to use Partial<> in order to delete only part of a key for testing. It also prevented issues like accidentally passing strings instead of numbers for values such as author_id. I am not entirely sure about the holes in the type system.
What kinds of values did you struggle to type correctly? Are there any Typescript topics that are still confusing?
I struggled most with typing values involving Partial<>. I also find Zod to still be somewhat confusing.
3. Testing
What was your experience writing tests? How did they affect your development process?
Writing tests felt repetitive, especially when I was confident the code worked as intended, which made it somewhat boring. Some tests were difficult to write, such as deleting authors/:id when an author still has books. The tests affected my development process by revealing real bugs that required fixing even when I thought I was finished. Writing tests also took more time than implementing the API itself.
Did your tests help you find any bugs?
Yes, the tests helped me find bugs such as needing to make my bodySchema strict so that extra data would correctly return an error.
How would you structure your testing differently in the future? What did you learn?
In the future, I would plan test cases ahead of time so they can guide my development and make writing tests easier later on. Testing helped me learn that there were errors in my code that I would not have noticed otherwise.
4. LLMs
Did you use LLMs to help you write your code?
Yes, I used LLMs when debugging difficult-to-understand Typescript errors such as keyof, Partial<>, and unknown types. I also used them to validate logic, create multiple filters for GET /books, and ensure SQL queries used proper AND conditions to avoid client issues. LLMs also helped explain error messages when tests failed or when syntax errors occurred.
How did using LLMs change your experience?
Using LLMs made the experience smoother and less frustrating, especially when I was stuck debugging errors. They helped save time, such as identifying issues with SQL syntax like using single quotes instead of double quotes. LLMs helped explain what went wrong and why, which allowed me to learn from my mistakes and better understand how to improve my code.