Mohsen Gilanilarimi
-
BSc (University of Science and Technology of Mazandaran, 2022)
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.