This would be an interesting stackexchange post to read. Not much legal content here but probably the same situation.
For the sake of a good legal argument:
Focussing on work for hire, since employer-employee relationship is clear and under no controversy here.
It is well settled law that employer own's the work product and can't have any claim on personal projects. In US, UK or common law the employer is treated as the first owner, but not deemed to be the author. Whereas in Civil law jurisdiction like Germany the ownership rights are firstly linked with the author and employer gets the ownership rights by assignment or contract.
Common law policy cites reason for first ownership to employers because employers provide infrastructure and facilities so that creative works can take place. This is seen as contribution of employers towards production of new works. Also they are in better position to market and exploit the product. And further to cut the transaction cost for assignment of rights like in civil law. Employees are rewarded by pay, continued employment, promotion etc. [Source: Bentley & Sherman]
The only test for this proposed question is to see whether a work is produced in the course of employment.
It does not necessarily means the office working hours or produced at home with personal resources.
Missing Link Software v. Magee [1991] FSR 14:
An employee wrote software outside work time and on his own equipment. Court found
it to be in the course of employment and employer was given the ownership rights.
Reasoning: Employee was hired to write programs of the kind in dispute. It fell within the scope of tasks he was employed to carry out and he was employed at the time of writing it.
As I also said the area/project for which you are writing program, its proximity with the employer's business and your duties at employment are going to be a major factor.