Academia.eduAcademia.edu

Outline

Managing Quantities and Units of Measurement in Code Bases

Updates on Software Usability [Working Title]

https://doi.org/10.5772/INTECHOPEN.108014

Abstract

Quantities in engineering and the physical sciences are expressed as units of measurement (UoM). If a software system fails to maintain the algebraic attributes of a system’s UoM information correctly when evaluating expressions then disastrous problems can arise. However, it is perhaps the more mundane unit mismatches and lack of interoperability that over time incurs a greater cost. Global and existential challenges, from infectious diseases to environmental breakdown, require high-quality data. Ensuring software systems support quantities explicitly is becoming less of a luxury and more of a necessity. While there are technical solutions that allow units of measurement to be specified at both the model and code level, a detailed assessment of their strengths and weaknesses has only recently been undertaken. This chapter provides both a formal introduction to managing quantities and a practical comparison of existing techniques so that software users can judge the robustness of th...

References (39)

  1. Hanisch R et al. Stop squandering data: Make units of measurement machine-readable. Nature. 2022;605: 222-224
  2. Arthur Stephenson, Lia LaPiana, Daniel Mulville, Frank Bauer Peter Rutledge, David Folta, Greg Dukeman, Robert Sackheim, and Peter Norvig. Mars Climate Orbiter Mishap Investigation Board Phase 1 Report, 1999. NASA Headquarters, Washington D.C., USA: NASA Press Release; [Last Accessed: May 19, 2022]
  3. James Clerk Maxwell. A Treatise on Electricity and Magnetism [Microform] / by James Clerk Maxwell. Oxford: Clarendon Press; 1873
  4. NIST. International System of Units (SI): Base and Derived. 2015. [Last Accessed: May 19, 2022]
  5. Karr M, Loveman DB. Incorporation of units into programming languages. Communications of the ACM. 1978; 21(5):385-391
  6. Gehani N. Units of measure as a data attribute. Computer Languages. 1977; 2(3):93-111
  7. Dreiheller A, Mohr B, Moerschbacher M. Programming pascal with physical units. SIGPLAN Notes. 1986;21(12):114-123
  8. Hilfinger PN. An Ada package for dimensional analysis. ACM Transactions on Programming Languages and Systems. 1988;10(2):189-203
  9. Fowler M. Analysis Patterns: Reusable Objects Models. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.; 1997
  10. McKeever S, Paçaci G, Bennich- Björkman O. Quantity checking through unit of measurement libraries, current status and future directions. In: Model-Driven Engineering and Software Development, MODELS WARD. Portugal: SciTePress; 2019 [11] Mayerhofer T, Wimmer M, Vallecillo A. Adding uncertainty and units to quantity types in software models. In: Software Language Engineering, SLE 2016. NY, USA: ACM; 2016. pp. 118-131
  11. Allen E, Chase D, Luchangco V, Maessen J-W, Steele GL Jr. Object- oriented units of measurement. In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA '04. NY, USA: ACM; 2004. pp. 384-403
  12. McKeever S, Bennich-Björkman O, Salah O-A. Unit of measurement libraries, their popularity and suitability. Software: Practice and Experience. 2020; 51(4):711-734
  13. Cooper J, McKeever S. A model- driven approach to automatic conversion of physical units. Software: Practice and Experience. 2008;38(4):337-359 [15] Antoniu T, Steckler PA, Krishnamurthi S, Neuwirth E, Felleisen M. Validating the unit correctness of spreadsheet programs. In: Proceedings of Software Engineering, ICSE '04. Washington, DC, USA: IEEE Computer Society; 2004. pp. 439-448
  14. Ore J-P, Detweiler C, Elbaum S. Lightweight detection of physical unit inconsistencies without program annotations. In: Proceedings of International Symposium on Software Testing and Analysis, ISSTA 2017. NY, USA: ACM; 2017. pp. 341-351
  15. Marcus Foster and Sean Tregeagle. Physical-Type Correctness in Scientific Python, CoRR, arXiv; 2018
  16. McKeever S. Discerning quantities from units of measurement. In: Proceedings of the 10th International Conference on Model-Driven Engineering and Software Development - MODELSWARD. Portugal: INSTICC, SciTePress; 2022. pp. 105-115
  17. Stevens SS. On the theory of scales of measurement. Science. 1946;103(2684): 677-680
  18. Hall B. The problem with 'dimensionless quantities'. In: Proceedings of the 10th International Conference on Model-Driven Engineering and Software Development -MODELSWARD. Portugal: INSTICC, SciTePress; 2022. pp. 116-125
  19. Ore J-P, Elbaum S, Detweiler C, Karkazis L. Assessing the type annotation burden. In: Automated Software Engineering, ASE 2018. NY, USA: ACM; 2018. pp. 190-201
  20. Wand M, O'Keefe P. Automatic dimensional inference. In: Computational Logic -Essays in Honor of Alan Robinson. Cambridge Massachusetts, USA: MIT Press; 1991. pp. 479-483
  21. Milner R. A theory of type polymorphism in programming. Journal of Computer and System Sciences. 1978; 17:348-375
  22. Kennedy A. Dimension types. In: Sannella D, editor. Programming Languages and Systems-ESOP'94. Vol.
  23. Edinburgh, U.K.: Springer; 1994. pp. 348-362
  24. TIOBE. The Importance of Being Earnest Index. 2022. Available from: https://www.tiobe.com/tiobe-index/ [Last Accessed: July 6] [26] Apple. Swift open source. 2022. [Last Accessed: May 19, 2022]
  25. Microsoft. F# software foundation, 2020. [Last Accessed: May 19, 2022] [28] Salah O-A, McKeever S. Lack of adoption of units of measurement libraries: Survey and anecdotes. In: Proceedings of Software Engineering in Practice, ICSE-SEIP '20. NY, USA: ACM; 2020 [29] Dieterichs Henning. Units of Measurement Validator for C#. [Last Accessed: May 19 2022]
  26. Jiang L, Zhendong S. Osprey: A practical type system for validating dimensional unit correctness of C programs. In: Proceedings of the 28th International Conference on Software Engineering, ICSE '06. New York, NY, USA: ACM; 2006. pp. 262-271 [31] Hills M, Feng C, Grigore R. A rewriting logic approach to static checking of units of measurement in C. Electronic Notes in Theoretical Computer Science. 2012;290:51-67
  27. Xiang T, Luo JY, Dietl W. Precise inference of expressive units of measurement types. Proceedings of the ACM on Programming Languages. 2020; 4:1-28. (OOPSLA)
  28. Garny A, Nickerson D, Cooper J, dos Santos RW, Miller A, McKeever S, et al. Cellml and associated tools and techniques. Philosophical Transactions of the Royal Society, A: Mathematical, Physical and Engineering Sciences. 2008; 366:3017-3043
  29. Bennich-Björkman O, McKeever S. The Next 700 Unit of Measurement Checkers. In Proceedings of Software Language Engineering, SLE 2018. NY, USA: Association for Computing Machinery; 2018. pp. 121-132
  30. Bekolay T. A comprehensive look at representing physical quantities in python. Scientific Computing with Python. Proceedings of the 11th ACM SIGPLAN International Conference on Software Language Engineering. 2013. pp. 121-132
  31. Krisper M, Iber J, Rauter T, Kreiner C. Physical quantity: Towards a pattern language for quantities and units in physical calculations. In: Proceedings of Pattern Languages of Programs, EuroPLoP '17. NY, USA: ACM; 2017. p. 9:1-9:20
  32. Ore J-P, Elbaum S, Detweiler C. Dimensional inconsistencies in code and ROS messages: A study of 5.9m lines of code. In: 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). Manhattan, NY, USA: IEEE; 2017. pp. 712-718
  33. Damevski K. Expressing measurement units in interfaces for scientific component software. In: Proceedings of Component-Based High Performance Computing, CBHPC '09. NY, USA: ACM; 2009. p. 13:1-13:8
  34. Ore J-P, Detweiler C, Elbaum S. Phriky-units: A lightweight, annotation- free physical unit inconsistency detection tool. In: Software Testing and Analysis, ISSTA 2017. NY, USA: Association for Computing Machinery; 2017. pp. 352-355
  35. Alessandra Cavarra, Charles Crichton, Jim Davies, Alan Hartman, Thierry Jeron, and Laurent Mounier. Using UML for Automatic Test Generation. Proceedings of ISSTA. NY, USA: ACM SIGSOFT International Symposium on Software Testing and Analysis; 2002
  36. Hartmann J, Vieira M, Foster H, Ruder A. A UML-based approach to system testing. Innovations in Systems and Software Engineering. 2005;1:12-24 [42] Ali S, Hemmati H, Holt NE, Arisholm E, Briand LC. Model transformations as a strategy to automate model-based testing-a tool and industrial case studies. In: Simula Research Laboratory, Technical Report (2010-01). Norway: Technical Report, Simula Research Laboratory and University of Oslo; 2010. pp. 1-28
  37. Mussa M, Ouchani S, Sammane W, Hamou-Lhadj A. A Survey of Model- Driven Testing Techniques. Proceedings - International Conference on Quality Software. QSIC. 2009. Manhattan, NY, USA: IEEE; pp. 167-172 [44] Kasurinen J, Taipale O, Smolander K. Software test automation in practice: Empirical observations. Advances in Software Engineering. 2010;2010:01 [45] McKeever S. From quantities in software models to implementation. In: Proceedings of the 9th International Conference on Model-Driven Engineering and Software Development - MODELSWARD. Portugal: INSTICC, SciTePres; 2021. pp. 199-206
  38. Wilkinson MD, Dumontier M, Aalbersberg IJJ, Appleton G, Axton M, Baak A, et al. The fair guiding principles for scientific data management and stewardship. Scientific Data. 2016;3:1-9
  39. Selic B. Beyond mere logic: A vision of modeling languages for the 21st century. In: Pervasive and Embedded Computing and Communication Systems (PECCS). Portugal: SciTePress; 2015. p. IS09