Bidirectional transformations
workshop at Cargilfield Perdita Stevens
University of Edinburgh
June 2017
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
workshop at Cargilfield Perdita Stevens
University of Edinburgh
June 2017
Perdita Stevens (Robin Bradfield’s mother!) Professor of Mathematics of Software Engineering University of Edinburgh
all the computery stuff you can’t break with a hammer...
all the computery stuff you can’t break with a hammer... Have you written a Scratch program? Like that but bigger...
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<
“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
Lines of code in: A simple game on a mobile phone: about 10,000
Lines of code in: A simple game on a mobile phone: about 10,000 A heart pacemaker: about 80,000
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
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?)
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
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
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
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
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
How do people cope?
Minecraft world built by Robin Bradfield
is when you get rid of details that aren’t important right now to focus on the things that are.
+ =
+ = 1 shoe + 1 shoe = 2 shoes
+ = 1 shoe + 1 shoe = 2 shoes 1 + 1 = 2
From punched cards:
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 ) ) );
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
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.
What can vary? How is it decided?
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?
:Robot :MovementPlanner :Leg
acquireObject() jump() getHeightRequired()
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?
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
What properties should bidirectional transformations have? correctness: they actually should restore consistency!
What properties should bidirectional transformations have? correctness: they actually should restore consistency! hippocraticness: if the models are already consistent, restoring consistency does nothing
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: ???
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 :-)