Validation of Data Invariants in the OutSystems Platform - Silva, Michael Simões (2019)
Software systems collect information from multiple sources, both internal and exter nal. Therefore, it is indispensable that the data should be validated according to data invariants, in all untrusted frontiers of a system. Developers need to define the validation logic for each of those constraints and to write the actual validation code. To safeguard data integrity throughout the entire system, the developers also need to ensure validation in different layers. This obligation can easily head to a problem since it usually leads to duplication of the validation code and contributes to more complex and less structured software architecture, which consequently leads to systems harder to maintain. The OutSystems platform enables visual development of enterprise Web and Mobile applications, providing an abstraction layer that allows developers to handle the inherent complexity of application development more easily. Still, developers need to write the code responsible for validating data explicitly. We propose an invariant propagation mechanism capable of propagating data con straints across the various layers of a system, that materialises into the automatic gen eration of validation code that properly ensures the data integrity in the entire system. Given a set of data constraints, or invariants, defined in the data layer that constrain entities’ attributes, our mechanism propagates and manipulates their specification. The propagation is done using a path-sensitive data flow analysis technique, specified in Dat alog and that uses a Prolog engine as the resolution engine. This solution ensures that the developer only needs to define the data invariants and their logic once in the entire application, and also ensures that it will generate validations whenever necessary. Thus, we remove the programmer’s obligation of writing and maintaining validation code, plus ensuring data integrity and providing faster error feedback to users. We evaluated our results in a prototype of the OutSystems platform.