bidirectional transformations
play

Bidirectional transformations workshop at Cargilfield Perdita - PowerPoint PPT Presentation

Bidirectional transformations workshop at Cargilfield Perdita Stevens University of Edinburgh June 2017 Who am I? Whats my job? Perdita Stevens (Robin Bradfields mother!) Professor of Mathematics of Software Engineering University of


  1. Bidirectional transformations workshop at Cargilfield Perdita Stevens University of Edinburgh June 2017

  2. Who am I? What’s my job? Perdita Stevens (Robin Bradfield’s mother!) Professor of Mathematics of Software Engineering University of Edinburgh

  3. What’s software? opposite of hardware

  4. What’s software? opposite of hardware all the computery stuff you can’t break with a hammer...

  5. What’s software? opposite of hardware all the computery stuff you can’t break with a hammer... Have you written a Scratch program? Like that but bigger...

  6. Almost random example bit of code void SAL_CALL BaseContainerControl::dispose() throw( RuntimeException, std::exception ) { // Tell everything that this container is now gone. // It’s faster if you listen to both the control and the container. // Ready for multithreading MutexGuard aGuard( m_aMutex ); // remove listeners EventObject aObject; aObject.Source.set( static_cast<XControlContainer*>(this), UNO_QUERY ); m_aListeners.disposeAndClear( aObject ); // remove controls Sequence< Reference< XControl > > seqCtrls = getControls(); Reference< XControl > * pCtrls = seqCtrls.getArray(); sal_uInt32 nCtrls = seqCtrls.getLength(); size_t nMaxCount = maControlInfoList.size(); size_t nCount = 0; for ( nCount = 0; nCount < nMaxCount; ++nCount ) { delete maControlInfoList[ nCount ]; } maControlInfoList.clear(); for ( nCount = 0; nCount < nCtrls; ++nCount ) { pCtrls [ nCount ] -> removeEventListener ( static_cast<

  7. Size... “In a Nutshell, LibreOffice... ... has had 452,587 commits made by 1,672 contributors representing 9,087,155 lines of code ... is mostly written in C++ with an average number of source code comments ... has a well established, mature codebase maintained by a very large development team with stable Y-O-Y commits ... took an estimated 2,773 years of effort (COCOMO model) starting with its first commit in September, 2000 ending with its most recent commit 18 days ago ” https://www.openhub.net/p/libreoffice as at 19/6/17

  8. Other examples Lines of code in: A simple game on a mobile phone: about 10,000

  9. Other examples Lines of code in: A simple game on a mobile phone: about 10,000 A heart pacemaker: about 80,000

  10. Other examples Lines of code in: A simple game on a mobile phone: about 10,000 A heart pacemaker: about 80,000 The Hubble Space Telescope: about 2,000,000

  11. Other examples Lines of code in: A simple game on a mobile phone: about 10,000 A heart pacemaker: about 80,000 The Hubble Space Telescope: about 2,000,000 Curiosity Mars Rover: about 2,500,000 (or is it about 5,000,000? Does it matter?)

  12. Other examples Lines of code in: A simple game on a mobile phone: about 10,000 A heart pacemaker: about 80,000 The Hubble Space Telescope: about 2,000,000 Curiosity Mars Rover: about 2,500,000 (or is it about 5,000,000? Does it matter?) A Boeing 787: about 14,000,000

  13. Other examples Lines of code in: A simple game on a mobile phone: about 10,000 A heart pacemaker: about 80,000 The Hubble Space Telescope: about 2,000,000 Curiosity Mars Rover: about 2,500,000 (or is it about 5,000,000? Does it matter?) A Boeing 787: about 14,000,000 Average modern high-end car: about 100,000,000

  14. Other examples Lines of code in: A simple game on a mobile phone: about 10,000 A heart pacemaker: about 80,000 The Hubble Space Telescope: about 2,000,000 Curiosity Mars Rover: about 2,500,000 (or is it about 5,000,000? Does it matter?) A Boeing 787: about 14,000,000 Average modern high-end car: about 100,000,000 All Google’s code, in 2015: about 2,000,000,000

  15. Other examples Lines of code in: A simple game on a mobile phone: about 10,000 A heart pacemaker: about 80,000 The Hubble Space Telescope: about 2,000,000 Curiosity Mars Rover: about 2,500,000 (or is it about 5,000,000? Does it matter?) A Boeing 787: about 14,000,000 Average modern high-end car: about 100,000,000 All Google’s code, in 2015: about 2,000,000,000

  16. Other examples Lines of code in: A simple game on a mobile phone: about 10,000 A heart pacemaker: about 80,000 The Hubble Space Telescope: about 2,000,000 Curiosity Mars Rover: about 2,500,000 (or is it about 5,000,000? Does it matter?) A Boeing 787: about 14,000,000 Average modern high-end car: about 100,000,000 All Google’s code, in 2015: about 2,000,000,000 Sources: http://www.visualcapitalist.com/millions-lines-of-code/ http://www.itworld.com/article/2985099/application-management/ thats-one-big-repository-heres-how-many-lines-of-code-google-has.html

  17. Problem Software is too big and too complicated! How do people cope?

  18. Abstraction

  19. Abstraction Minecraft world built by Robin Bradfield

  20. Abstraction

  21. Abstraction is when you get rid of details that aren’t important right now to focus on the things that are.

  22. Abstraction in maths + =

  23. Abstraction in maths + = 1 shoe + 1 shoe = 2 shoes

  24. Abstraction in maths + = 1 shoe + 1 shoe = 2 shoes 1 + 1 = 2

  25. Abstraction in software engineering From punched cards:

  26. to “high level code” like we saw before void SAL_CALL BaseContainerControl::dispose() throw( RuntimeException, std::exception ) { // Tell everything that this container is now gone. // It’s faster if you listen to both the control and the container. // Ready for multithreading MutexGuard aGuard( m_aMutex ); // remove listeners EventObject aObject; aObject.Source.set( static_cast<XControlContainer*>(this), UNO_QUERY ); m_aListeners.disposeAndClear( aObject ); // remove controls Sequence< Reference< XControl > > seqCtrls = getControls(); Reference< XControl > * pCtrls = seqCtrls.getArray(); sal_uInt32 nCtrls = seqCtrls.getLength(); size_t nMaxCount = maControlInfoList.size(); size_t nCount = 0; for ( nCount = 0; nCount < nMaxCount; ++nCount ) { delete maControlInfoList[ nCount ]; } maControlInfoList.clear(); for ( nCount = 0; nCount < nCtrls; ++nCount ) { pCtrls [ nCount ] -> removeEventListener ( static_cast< XEventListener* >( static_cast< XWindowListener* >( this ) ) );

  27. to models, e.g. like this By Kishorekumar 62 - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=5766927 https://en.wikipedia.org/wiki/Unified_Modeling_Language

  28. Model-driven development

  29. Consistency In the end two models have to be consistent, if they are both to be abstractions of the same software system. What consistent means is very variable... Now you’ll do an exercise in pairs about consistency.

  30. Discussion What can vary? How is it decided?

  31. Discussion What can vary? How is it decided? If you have a definition of consistency, and one model, can you tell what the other model must be?

  32. UML class diagram Robot Head MovementPlanner smile() acquireObject() speak() Leg Arm jump() wave() getHeightRequired()

  33. UML sequence diagram :Leg :Robot :MovementPlanner acquireObject() jump() getHeightRequired()

  34. What if two models are not consistent? This time your task is to make the models consistent, according to the definition on the sheet, by changing the second model if necessary. Discuss: Is there a choice, or just one way to do it? If there’s a choice, which way to restore consistency is best? Why? How can we decide? (Stretch) Can you explain how to restore this notion of consistency for any pair of models?

  35. Writing bidirectional transformations Deciding what kind of consistency we need how we can restore consistency automatically is what the writer of a bidirectional transformation (bx) has to do. We don’t yet have good languages in which to write bx – that’s ongoing research.

  36. More ongoing research What properties should bidirectional transformations have? correctness: they actually should restore consistency!

  37. More ongoing research What properties should bidirectional transformations have? correctness: they actually should restore consistency! hippocraticness: if the models are already consistent, restoring consistency does nothing

  38. More ongoing research What properties should bidirectional transformations have? correctness: they actually should restore consistency! hippocraticness: if the models are already consistent, restoring consistency does nothing least change: ???

  39. About software engineering as a job Today, programming is a big part of software engineering... ... but other parts are just as important, e.g., requirements engineering. Will change a lot in your working lives! Work hard at your maths :-)

  40. Questions? Comments?

Recommend


More recommend