I spent about 8 hours on this assignment. About 3 hours were spent on writing the REST API, about 3 hours were spent on manually testing, and about 2 hours were spent on writing tests.
I spent the most amount of time designing my API. I focused a lot on the constraints and how to write them.
I struggled the most with querying for authors and books. I found that I had to use %20 instead of spaces to query for author names or book titles.
I found that Typescript helped me catch bugs at compile time. If a variable had an incorrect type or if I was referencing objects that did not exist, I would get an error. However, Typescript did not catch bugs at run time. If I had sent in a request with incorrect types, I did not receive an error and instead had to write my own handling.
I did not struggle to type anything. I wonder if this means I did not type correctly or if I did not add enough typing. Similarly, there were not any Typescript topics that confused me.
I found writing tests to be tedious and boring. It was a lot of repetitive work testing the edge cases. I wrote the tests after I had finished developing so it did not affeect my process.
My tests helped me to find incorrect return statuses and typos in my error messages. Other than this, I did not catch any other bugs.
While testing, I learned that the database did not clear after the tests. In the future, I would add this clearing as it made my tests difficult to write and even worse to maintain. Since this was a homework assignment, I did not refine my testing, but if it were a project, I would.
Back