"Why test your code? So you know it can work, and have a way to quickly verify it still works as it evolves." - some engineer on Quora.
For more info: https://en.wikipedia.org/wiki/Test-driven_development
The overriding thought for testing should be "What tests need to pass in order to ensure my code works as expected?". For both services and libraries, arguably the highest priority are interface tests since they are the specific contract between an application and its end-users.