I spent around 8 hours on this assignment.
I spent the most time debugging request handlers and database interactions. A lot of time went into correctly validating inputs, matching the tests’ expected HTTP statuses and JSON shapes, and dealing with subtle issues around how pub_year is stored and compared in SQLite.
I struggled the most with setting up the initial project structure and ensuring that all dependencies were correctly installed. A more detailed starter guide or template could have improved my experience.
Typescript helped me catch issues related to type mismatches, such as passing incorrect types to functions or accessing properties that didn't exist on certain objects. However, it didn't catch some runtime errors, such as logic errors in my request handlers where the code would run but give incorrect results.
I had to be careful typing the SQLite Database and asynchronous operations that return rows vs arrays of rows.
Writing tests was a rewarding experience as it helped me ensure that my code was functioning as expected. It made the development process easier and ensured that I caught bugs early on.
Yes, my tests helped me find a few bugs related to incorrect handling of edge cases in my request handlers, such as missing parameters and invalid input types.
In the future, I would've started writing tests earlier in the development process as I wrote them afterwards which lead to have to refactor some bits of my code. I learned the importance of writing tests early in the development process to catch issues sooner and ensure my code targeted the proper requirements.
Yes, I used an LLM as a coding assistant to review failing tests, propose fixes, and suggest small refactors.
Using LLMs made coding more enjoyable and efficient. They saved me time by providing quick suggestions and solutions to problems I encountered because looking at code for long periods of time I found myself overlooking easy errors that LLMs spots for me. However, I made sure to understand the suggestions fully to ensure I learned from the assignment rather than relying solely on the LLM. LLMs are very helpful when working with existing code and not to write code from scratch.