CS 102 · Year 1 · Semester 2 · 4 credits · Computer Science
Programming II & Object-Oriented Design
From ad-hoc actuarial scripts to robust, type-safe, and production-grade financial software engines.
Code and Solvency: Engineering the Actuarial Engine
A junior actuarial developer at a growing annuity provider must replace a fragile legacy pricing script with a robust, production-grade actuarial software library before a multi-million-pound bulk purchase annuity deal faces regulatory scrutiny.
It is 8:14 PM on a Tuesday. Maya stares at a four-thousand-line single-file Python script called pricing_final_v12.py. When she updates the discount rate curve for a simple immediate annuity portfolio, the entire script crashes with a global variable mutation error, producing negative policyholder liabilities.
Transcript
It is 8:14 PM on a Tuesday. Maya stares at a four-thousand-line single-file Python script called pricing_final_v12.py. When she updates the discount rate curve for a simple immediate annuity portfolio, the entire script crashes with a global variable mutation error, producing negative policyholder liabilities.
- Model actuarial cash flow engines using encapsulation, polymorphism, and composition over inheritance.
- Implement the Strategy pattern to decouple cash flow projections from discounting mechanisms.
- Apply the Factory pattern and SOLID principles to build extensible insurance policy architectures.