Help me identify this caterpillar

Last week, i found them already fat and still eating. They are green. But now, they turned brown and do not eat any more leaves. Instead, they went under the stones. Are they going to pupate? What kind of insect will they be?