For the archaeological cadastre project thesis, I set up integration tests for key services. It seemed to have the most value, since we interact with the database and service layer, and some services, such as the one responsible for taxonomies, were relying a lot on SQL queries for hierarchy relationships.

After doing this, I decided that to expand that module, I will use a TDD approach: write the tests I need, think of edge cases and what I want to have returned, then proceed to work on it; “red-green-refactor” style.

In case of refactoring, I can easily validate if the new approach has broken some functionality or not.

I finally saw the light when it comes to testing and its importance. In my defense, I haven’t worked at such a back-end project at this scale, and on front-end I’m still thinking what is the best approach.

I do not tests controllers yet, just the service layers, but for now this seems to be enough.

It is not ideal - writing tests from the start without actually exploring the implementation may be naive. Some the tests need to be refined themselves, after some changes I have to add new tests to validate what I just have written.