How should I test my code changes?

once you have paid the cost of the the initial build, it won’t matter all that much, making a small change on a lite build won’t be drastically faster/slower than on a full build, both should be in the seconds range.

Strange, I changed very little code last time, but the linking still took me minutes to finish. And sometimes, it just rebuilds the whole project itself. I know it depends on what I have changed, but still.

I would look topics like these on stackoverflow, but under C++ topics, not blender. There are ways to develop test automation so when you add/change code anyone can rerun (regression test) your code to be sure it operates as expected.

Most automated, daily build systems will also automatically run the regression tests to verify no breakage in existing code.