A lot of people have been asking for an analysis on North Korea. From what I've been reading, there's a lot of half-hearted attempts to explain Kim's behavior as a strategic brinksmanship to try to extract concessions from the West. But this essentially hasn't worked for years, unless you count the South Korean "sunshine policy," which has been criticized as appearing to be in response to North Korean aggression. But this current flurry of missiles is obviously not going to lead to more money in NK's wallet, and Kim should know that.
Some have said that he's just flying off the handle. My first thought is: wrong tense. He flew off the handle years ago. It's unlikely he has gone significantly more crazy than before. And further, he is not actually all-powerful, especially in the inner military circles. He must manage a group of influential military oligarchs that spend a great deal of time creating personally-loyal cadres of crack troops. And he's doing a fine job, but he wouldn't be testing nukes and firing missiles without them.
Which brings me to my hypothesis: The very ideological/conservative factions of the military are probably twisting Kim's arm: he wants his son to take over, and needs their support. They probably want to test the international waters, as it were: how will the world respond? If North Korea can make a push to arm itself with nuclear weapons and ICBMs (though combining the two of this is much more difficult than it might seem at first--nukes are heavy and complicated), then it can not only plausibly threaten massive destruction of Seoul, but of Tokyo, and eventually Los Angeles. And if that's the case, then North Korea becomes pretty free to do a whole lot of things it would like to do--possibly including invading South Korea. Already, it's clear that North Korea likes to take risks, doesn't care about world opinion, etc. But if they had a nuclear deterrent, they'd be pretty terrifying--because they would be willing to put up with far more domestic casualties than approximately anyone else on earth, any military operation against them would be potentially disastrous.
And so, with Kim's arm possibly twisted, the hardliners in the military may simply be trying to rush through their testing and keep the world off-balance with threats of war with South Korea as they do so, so that they come out of this "crisis" much better prepared for the real crisis that at least some hardliners are surely planning.