This website stores cookies on your computer. These cookies are used to collect information about how you interact with our website and allow us to remember your browser. We use this information to improve and customize your browsing experience, for analytics and metrics about our visitors both on this website and other media, and for marketing purposes. By using this website, you accept and agree to be bound by UVic’s Terms of Use for web and social media privacy.  If you do not agree to the above, you can configure your browser’s setting to “do not track.”

Skip to main content

Mohsen Gilanilarimi

  • BSc (University of Science and Technology of Mazandaran, 2022)

Notice of the Final Oral Examination for the Degree of Master of Science

Topic

Specification-Driven Generation of Type-Safe Python Configuration Classes for JSON Inputs

Department of Computer Science

Date & location

  • Wednesday, April 22, 2026

  • 9:00 A.M.

  • Engineering Computer Science Building

  • Room 468

Reviewers

Supervisory Committee

  • Dr. Teseo Schneider, Department of Computer Science, University of Victoria (Supervisor)

  • Dr. Neil Ernst, Department of Computer Science, UVic (Member) 

External Examiner

  • Dr. Issa Traoré, Department of Electrical and Computer Engineering, University of Victoria 

Chair of Oral Examination

  • Dr. Astrid Brousselle, School of Public Administration, UVic

     

Abstract

Modern scientific and engineering libraries often use JSON configuration files to run simulations and workflows. JSON is readable and widely supported, but real configuration files can be hard to write correctly because they may have deep nesting, lists, optional and required fields, fixed choices, and numeric limits. In many libraries, these rules are described in a separate input specification file, but developers usually create the type-safe interface and validation code by hand. This can repeat the same logic, become inconsistent when the specification changes, and lead to unclear error messages. This thesis introduces a system that takes the JSON input specification as the main reference and automatically generates strongly typed Python configuration classes from it. The generated classes are organized in the same structure as the specification using nested classes, and users can set values with normal attribute access to ensure each value is placed in the correct part of the specification. Validation is built into both the constructors and the property setters. This means whenever a value is given, the system checks its type and rules (for example, valid ranges, allowed options, or required file extensions). It also allows complex parts of the configuration to be filled step by step by setting their child properties. The system shows which fields are required using the generated documentation, and it also provides a report method that finds any missing required values before saving. After the configuration is complete, the objects are converted back into JSON-compatible output that matches the specification by design and can be used by other libraries. Internally, the approach builds an intermediate tree from specification pointers and then generates the class from it. It supports heterogeneous lists with wildcard routing and polymorphic variables with multiple allowable shapes. Robustness is tested by making controlled changes to the specification and running failure-case tests. The results show that the system reliably works with realistic patterns and clearly detects unsupported types and problems when the specification hierarchy is in the wrong order.