It looks like your Alexander Cumming was baptised in Fintray on 31 Aug 1840 - both Margaret Brodie and James Cumming are named in the index on Scotland's People, so having a look at the record should confirm whether this Alexander was illegitimate or not, and may also confirm the occupation of father James.
There's a James Cumming, aged 30, farmer in the 1841 census at Castle Hunger, Fintray, with presumably his mother Catherine Cumming and sister Mary - this James Cumming looks like he was baptised in Fintray on 20 Oct 1806, son of William Cumming and Katherine Connan. He's still there, unmarried, in 1851, just with sister Mary, and again in 1861, also with Mary.
By 1871, he's aged 64 and married to a 31 year old Mary Cumming. There's a marriage in Fintray in 1865 between James Cumming and Mary Mackenzie which looks a likely match. There's a death for a James Cumming, aged 68, in Fintray in 1875, which seems likely to be this James Cumming.
Ruth