A Chapter 13 bankruptcy may seem like a bad idea, after all it's a repayment plan and not a debt discharge program like a Chapter 7 bankruptcy . But there are many reasons to choose a Chapter 13 bankruptcy over a Chapter 7, the main reason being that you want to protect some of your assets from seizure. Another reason is that you just don't pass the means test and a Chapter 7 bankruptcy is not an option. The first thing you should realize is that a Chapter 13 is a repayment but it doesn't mean that you'll be required to repay all of your debts. Your priority claims will require payment in full but the rest of your secured debts will be put on a payment plan that is set up by the bankruptcy court to be affordable and pass the best interest test and the best efforts test.
Best Interest Test
Unsecured creditors must receive as much as they'd get if you'd filed a Chapter 7 bankruptcy. If you have no assets or it's all exempt then a best interest test doesn't apply. But if you have assets you're looking to keep and protect, then the best interest test is important, the amount that those assets would have garnered in sale is taken into consideration when determining how much your unsecured creditors get.
Best Efforts Test
Obviously you cannot afford to pay your unsecured debt in full, if you would you wouldn't be filing for bankruptcy, but the courts do expect you to make an effort, your best effort. Your payment plan will be arranged with this in mind so you can afford the payments but also continue to hold onto your assets.