Best practices for application alerts

As a developer, I'm always confused about the three basic values of any application's alert:

  1. Title
  2. Message
  3. Dismiss button

What should be placed in those 3 values? FAQ for myself:

  • Should the title be a resume of what happened or where the message came from?
  • Should messages use exclamations?
  • Should messages be complete sentences (ending with a full stop)?
  • How much detail should the message contain?

Well, as a single question: there is some basic rules while writing alert/notification messages? Bonus if these basic rules answer my minor questions.

Please share your thoughts...