Update simple product programmatically in magento1

There are some steps to update a simple product through code.
1) Firstly include the Mage.php file.
2) after that load product id into the product model.
3) now put the updated product value information like name, price, description, etc.


require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
$productId=24; //product id
$product = Mage::getModel('catalog/product')->load($productId);
try{
$product->setName('Product test data') //product name
->setSku('product-test-data') //SKU
->setWeight(250.00)
->setStatus(1) //product status (1 - enabled, 2 - disabled)
->setPrice(300.00) //price
->setDescription('product test long description')
->setShortDescription('product test short description')
->setCategoryIds(array(2)); //assign product to categories
$product->save();
}catch(Exception $e){
Mage::log($e->getMessage());
}