Tre Olson | CS 499 Milestone Two | September 20, 2026
Artifact Background
My artifact is the Python AnimalShelter CRUD module originally developed during CS 340 for the Austin Animal Center and Grazioso Salvare project, before this capstone. The original source is included in this portfolio as original/CRUD_Python.py. It connects to MongoDB and performs create, read, update, and delete operations. I selected it because it combines useful database behavior with clear opportunities to improve maintainability and testability. The September 2026 enhancement preserves that source unchanged and provides a separate redesigned package.
Why This Artifact Belongs in My ePortfolio
The artifact demonstrates how I can move from a working course module toward a more structured software component. The original class constructs its own database connection and handles all four operations. The enhancement separates configuration, validation, service behavior, repository access, results, and errors. A repository interface allows the service to receive either the MongoDB adapter or an offline adapter, so its behavior can be tested without a running database. This demonstrates separation of concerns and dependency injection through working code.
The redesigned API also makes results more informative. A failed read raises a controlled error instead of looking like an empty result. Updates preserve both matched and modified counts, which distinguishes an unchanged record from a missing one, consistent with PyMongo’s result semantics (MongoDB, n.d.-b). These changes show software design skills relevant to my software engineering career goals.
Course Outcomes and Enhancement Scope
This enhancement provides evidence toward the four outcomes identified in my Module One plan. For Outcome 2, the README, migration table, design explanation, and narrative communicate the implementation and its limitations. For Outcome 3, I evaluated the trade offs between a small single class and a layered package, between unrestricted filters and validated inputs, and between bulk mutations and targeted changes. This is design evaluation; I am not claiming a measured algorithmic speedup.
For Outcome 4, the submission includes executable Python code, a PyMongo adapter, typed result objects, and automated tests. The recorded run passed 31 tests covering CRUD behavior, boundaries, errors, and cleanup. For Outcome 5, the service rejects unapproved fields and nested query operators, limits returned records, and requires a unique MongoDB record ID for updates and deletes. Configuration comes from environment variables, and application logs contain operation metadata rather than record values or driver error text. The original source already accepted credentials as arguments; the improvement is separating configuration rather than removing a hard coded password.
The outcome targets remain unchanged. The final portfolio review guide and migration instructions support review under Outcome 1 by making implementation choices and compatibility changes explicit. This was individual coursework. The API is deliberately narrower: callers must migrate to typed results and record-ID mutations. Indexes, aggregation, and full pagination are presented separately in the database enhancement; the thermostat remains the algorithms artifact. The professional self-assessment connects these materials at the portfolio level.
Reflection on the Enhancement Process
A key lesson is that maintainability depends on responsibility boundaries. Moving methods into separate files would not help if the service still created its database client. Injecting a repository makes the boundary testable. Another challenge was distinguishing no matches, unchanged records, and failures; typed results and custom exceptions make these differences explicit.
Narrowing mutations required a compatibility trade off: callers must now select a unique MongoDB _id. Resource ownership also needed attention. The service closes its repository on context exit, and failed initialization closes the partially created client. PyMongo’s connection guidance informed this design (MongoDB, n.d.-a).
The offline demo and tests exercise successful workflows and failure paths. The final verification on October 18, 2026 again passed all 31 tests. These checks cannot verify live credentials, permissions, or server behavior. The separate database category includes the later MongoDB verification on generated data, while deployment-specific checks remain future work.
References
MongoDB. (n.d.-a). Create a MongoClient. https://www.mongodb.com/docs/languages/python/pymongo-driver/current/connect/mongoclient/
MongoDB. (n.d.-b). Update documents. https://www.mongodb.com/docs/languages/python/pymongo-driver/current/crud/update/