Uncertainty is an inherent property of any measure or estimation performed in any physical setting, and therefore it needs to be taken into consideration when modelling applications that interact with physical systems. Although several modelling languages permit the representation of measurement uncertainty for describing certain system attributes, these aspects are not normally incorporated into their type systems. Thus, operating with uncertain values and propagating uncertainty are normally cumbersome processes and difficult to achieve at the model level.

Furthermore, units are not normally incorporated at the type level. This has been the cause of several critical disaster, since unit compatibility and conversion are not taken care of by most software modelling notations.

This work proposes an extension of the UML and OCL types to incorporate data uncertainty coming from physical measurements or user estimations into the models, as well as units to quality the values of these measurements, together with the set of operations defined for the values of these types.

Project Description

Following the Guide to the expression of uncertainty in measurement (GUM) [2] and the International Vocabulary of Metrology (VIM) [3] we define a new type in UML/OCL, called UReal that can be considered as a superclass of Real. Values of type UReal are pairs of Real numbers X = (x; u) that define the expected value and the associated standard uncertainty of quantity X, respectively. The operations are defined using the GUM [2,4].

Main benefits include: the expression of uncertainty in variables of software models; being able to compute uncertainty at the model level (using the set of operations defined for these types); and permit to transfer the information to standard algorithms and tools to compute complex types of uncertainties. In other words, high-level representation and manipulation of data uncertainty, and platform-independence.

In addition, Quantities are values that incorporate not only uncertainty but also information about the units they are expressed in.


    Java implementations of UReal operations (UReal-Java.zip)
  • OCL implementation of UReal operations (UReal-OCL.zip)
  • Java, OCL and fUML implementation of Quantity types (Github)
  • Case Study - Ozoblockly Language (Robot.zip)


[1] A. Vallecillo, C. Morcillo, P. Orue. "Expressing Measurement Uncertainty in Software Models". In Proc. of QUATIC 2016. (Technical report)
[2] "Evaluation of measurement data -- Guide to the expression of uncertainty in measurement (GUM)". Joint Committee for Guides in Metrology. JCGM 100:2008, 2008.
[3] "International Vocabulary of Metrology -- Basic and general concepts and associated terms (VIM)", 3rd edition. Joint Committee for Guides in Metrology, 2012.
[4] "Evaluation of measurement data -- Supplement 1 to the GUM -- Propagation of distributions using a Monte Carlo method". Joint Committee for Guides in Metrology, JCGM 101:2008, 2008.
[5] Tanja Mayerhofer, Manuel Wimmer, Antonio Vallecillo. "Adding Uncertainty and Units to Quantity Types in Software Models". In Proc. of SLE 2016.
[6] Tanja Mayerhofer, Manuel Wimmer, Loli BurgueƱo, Antonio Vallecillo. "Specifying Quantities in Software Models". Submitted to the IST journal (under review). (Technical Report)