Books can be attributed to "Anonymous" for several reasons:
* They are officially published under that name * They are traditional stories not attributed to a specific author * They are religious texts not generally attributed to a specific author
Books whose authorship is merely uncertain should be attributed to Unknown.
The Second book of Samuel essentially chronicles David's reign as king in Israel. He made some crucial mistakes for example when he slept with Uriah's wife and then basically killed him. When the prophet Nathan confronted him, he repented and was filled with remorse, Psalm 51 documents his prayer for forgiveness for his trespass. He also made a vital error in judgement when he took up a census of the people in Israel, God was very angry because David should know that it is the Lord that gave him the victory not the number or strength of his army.
David was a man of praise, he sought God's council whenever he was to fight or make major decisions. Although he was not perfect, God refereed to him as a man after his own heart. It just goes to show that even if we make mistakes, we just need to repent and God will forgive our sins and we will be back in fellowship with Him.