SlideShare a Scribd company logo
Reverse Engineering as Theory BuildingTony Clark t.n.clark@mdx.ac.ukBalbir Barn b.barn@mdx.ac.ukSchool of Engineering and Information SciencesUniversity Of MiddlesexLondon, UK
OverviewMotivation:Houston, we have a problem.Surely this has been done before?Theory Building:An approach: Old wine in new bottles.Some technology: New wine in old bottles.Case Study:But what might it look like?
Motivation: There is nothing new under the sun.
The business driverSoftware Outsourcing IncHigh value software maintenance contractsOutsourcing of source code maintenance of large scale legacy systemsCritical operational systemsInitial contract is limited length – achievement of maintenance requests will lead to longer contract.IssuesSupport for responding to rapid ad hoc requests for changes to systemLack of documentationOriginal software developers no longer at the customer companyA common scenario facing many Indian IT providers
Naur’s Theory of ProgrammingSeminal paper written in 1985Fundamental assertion:Programmers achieve a certain insight or theory of some aspect of the domain that they are addressingBased on Ryle (1949) – A person who has a theory or facts can do things and explain why and respond to questionsExplains this in the context of the software lifecycleTraditionally software methods are focused on artifact production (explicit knowledge). But should be focussed on techne and phronosis (wisdom derived from practice)
Naur’s Thesis: FeaturesProgramming is Theory Building.Understand the domain as a theory.Theories consist of information bearing statements about a domain that are true (or false).No such thing as the ideal  theory because:many consistent (incomplete) theories.theories are personal.theories consist of information necessary for stakeholder.
Systems lifecycle and theory buildingTheory buildingTheory DecayAnalysis and DesignImplementationMaintenanceDeployed SystemOnce the system is deployed and enters into a maintenance phase, the only way the theory can be retained is by transfer of knowledge between team members.The artifacts represent an incomplete documentation of the theory
Naur’s Thesis: Benefit ClaimsCore IPR is in theories.Theories are more abstract than programs.Maintain system using theories.Introduce new people using theory not code.Theories are reusable (code fails to be).Theories allow questions to be articulated.Theories capture different views of a system.
Understanding is Theory Building
What do we currently do?Program Code:Just look at the code.Misunderstandings because:the domain is weakly represented in the code.unable to articulate questions.UML Models:Weakly expressive:Static models are OK.Dynamic models lack completeness.Meaning is bound up with translations to code.Modularity cannot be applied to understanding: have to state the whole thing – no real views.
Naur’s Thesis Applied to ModellingWhat’s the difference between modelling and programming?If programming is the construction of a theory that is then mapped to an implementation (theory) then: Modelling smells like programming to me.What’s the difference between modelling and domain specific modelling?A theory building framework gives us a context in which this can be analyzed.
Approach: Building theories about an application.
Theory Building ProcessUserInterfaceobservationSystem ExecutionsinteractionSourceCodeModels(static, dynamic, security, etc.)Theorems(aspects)formulationinspectionmodificationgroundingDocumentationcomprehensionabstractionPartialTheoriesExpertKnowledgeacquisitionslicingaggregationTheory
What is a theory?theorem: true or false statements.theory: collections of theorems.axioms: statements that are givens.rules: ways of constructing theorems.mappings: between theories (and theorems)combinations: composing theories (and theorems).initial: an initial theory maps to all the others.terminal: every theory maps to a terminal theory.
Being Concrete: Aspects of a Simple Case Study
Customer RequirementSoftware maintenance contract with a Library.They have software controlling borrowings at multiple terminals.Originally sourced from a third party.They have lost the documentation.They have the source code.Occasionally they have noticed books going missing.Under the contract your company needs to identify and fix the problem.
Library Source Codeclass Library {  Vector<Reader> readers;  Vector<Book> books;Hashtable<Reader,Book[]> borrows;intnextReaderId; public void handle(Messagem) {switch(m.id) {case REGISTER:register(m);break;case ADD_BOOK:add_book(m);break;case BORROW:borrow(m);break;      ...} }  ...}application stateentry pointinterface
Library Operationspublic void register(Messagem) { String name = (String)m.getData(0);if(hasReader(name) == false) {intid = allocateReaderId();readers.add(newReader(name,id));m.reply(id); } else m.fail();}message argsguarddata accessmessage reply
Borrowingpublic voidborrow(Messagem) {int id = (int)m.getData(0); String name = (String)m.getData(1);  Reader reader = getReader(id);  Book book = removeBook(name);  Book[] borrowed = borrows.get(id);if(borrowed.length < BORROW_LIMIT) {    Book[] updated = new Book[borrowed.length+1];Array.copyInto(borrowed,updated);updated[borrowed.length] = book;borrows.put(reader,updated);m.reply(OK);  } else m.reply(FAIL);}data accessdata access
Static Modelling
Commands
Data Access
Results
Partial Theories are Defined by Rulesr = (Reader)[name = n; id = i]not(R->includes(r))---------------------------------------------- [EvalRule]       (Eval)[         data = (AddReader)[name = n];          result = (ReaderAllocated)[id = i];         change = (StateChange)[           pre = (Library)[             readers = R;              books = B;              borrows = X; nextReaderId = i];            post = (Library)[             readers = R->including(r);              books = B;              borrows = X;nextReaderId = i+1           ]        ]      ]
Evaluating More than one Data Access(Evals)[accesses = Seq{}; changes = Seq{}; results = R]  (EvalsRule)       (Eval)[data = a; change = c; result = r]---------------------------------------------------------  (EvalsRule)(Evals)[accesses = Seq{a}; changes = Seq{c}; results = Seq{r}]         (Evals)[accesses = P; changes = C; results = V]         (Evals)[accesses = Q; changes = D; results = W]---------------------------------------------------------- (EvalsRule)(Evals)[accesses = P + Q; changes = C + D; results = V + W
Library Theory
TheoremsCan someone borrow a book without joining the library?Can two people join the library with the same id?Is it possible to construct a situation where a book disappears from the library?
Theorem Development2
Fill in the Blanks2
Hypothesize the Blanks2
DeductionDeduction: Theory tells us there must be two cards for fred.Reality: Fred must have duplicated the library card and an accomplice borrows the second book at the same time when fred borrows the first.Solution: change the theory.
ModifyDefinitionofProject
Borrowing (modified)publicsynchronized void borrow(Messagem) {int id = (int)m.getData(0); String name = (String)m.getData(1);  Reader reader = getReader(id);  Book book = removeBook(name);  Book[] borrowed = borrows.get(id);if(borrowed.length < BORROW_LIMIT) {    Book[] updated = new Book[borrowed.length+1];Array.copyInto(borrowed,updated);updated[borrowed.length] = book;borrows.put(reader,updated);m.reply(OK);  } else m.reply(FAIL);}
ConclusionUnderstanding is theory building.Modelling and programming are essentially the same.Modelling aims to be initial.Programming needs to be terminal.Modelling languages should support theories.Theories need to support:translation through mappings.different views through combination.patterns through parameterization.

More Related Content

PPTX
Algorithm Name Detection & Extraction
PPT
Mining Product Reputations On the Web
PDF
Data Structures and Algorithm - Week 4 - Trees, Binary Trees
PDF
Data Structures and Algorithm - Week 11 - Algorithm Analysis
PDF
Combining IR with Relevance Feedback for Concept Location
PDF
Data Structures and Algorithm - Week 9 - Search Algorithms
PPT
Data structures cs301 power point slides lecture 01
PDF
Semantics2018 Zhang,Petrak,Maynard: Adapted TextRank for Term Extraction: A G...
Algorithm Name Detection & Extraction
Mining Product Reputations On the Web
Data Structures and Algorithm - Week 4 - Trees, Binary Trees
Data Structures and Algorithm - Week 11 - Algorithm Analysis
Combining IR with Relevance Feedback for Concept Location
Data Structures and Algorithm - Week 9 - Search Algorithms
Data structures cs301 power point slides lecture 01
Semantics2018 Zhang,Petrak,Maynard: Adapted TextRank for Term Extraction: A G...

What's hot (20)

PPT
Data Mining and the Web_Past_Present and Future
PPT
Email Data Cleaning
PDF
Spark Solution for Rank Product
PPT
An Integrated Framework on Mining Logs Files for Computing System Management
PDF
Data Structures and Algorithm - Week 8 - Minimum Spanning Trees
PPT
Finding Similar Files in Large Document Repositories
PDF
Data Structures and Algorithm - Week 3 - Stacks and Queues
PDF
The Query Engine: The Life of a Read
PDF
Ranking and Diversity in Recommendations - RecSys Stammtisch at SoundCloud, B...
PPTX
Conformer-Kernel with Query Term Independence @ TREC 2020 Deep Learning Track
PDF
IRJET- Empower Syntactic Exploration Based on Conceptual Graph using Searchab...
PPTX
Document Classification and Clustering
PDF
Data exploration validation and sanitization
PDF
Machine Reading Using Neural Machines (talk at Microsoft Research Faculty Sum...
PPTX
TextRank: Bringing Order into Texts
PPTX
ChemExtractor: Enhanced Rule-Based Capture and Identification of PDF Based Pr...
PDF
Data Structures and Algorithm - Week 5 - AVL Trees
PDF
Data Structures and Algorithm - Week 6 - Red Black Trees
PDF
SF Python Meetup: TextRank in Python
PPT
Cs583 info-retrieval
Data Mining and the Web_Past_Present and Future
Email Data Cleaning
Spark Solution for Rank Product
An Integrated Framework on Mining Logs Files for Computing System Management
Data Structures and Algorithm - Week 8 - Minimum Spanning Trees
Finding Similar Files in Large Document Repositories
Data Structures and Algorithm - Week 3 - Stacks and Queues
The Query Engine: The Life of a Read
Ranking and Diversity in Recommendations - RecSys Stammtisch at SoundCloud, B...
Conformer-Kernel with Query Term Independence @ TREC 2020 Deep Learning Track
IRJET- Empower Syntactic Exploration Based on Conceptual Graph using Searchab...
Document Classification and Clustering
Data exploration validation and sanitization
Machine Reading Using Neural Machines (talk at Microsoft Research Faculty Sum...
TextRank: Bringing Order into Texts
ChemExtractor: Enhanced Rule-Based Capture and Identification of PDF Based Pr...
Data Structures and Algorithm - Week 5 - AVL Trees
Data Structures and Algorithm - Week 6 - Red Black Trees
SF Python Meetup: TextRank in Python
Cs583 info-retrieval
Ad

Similar to Reverse engineering and theory building v3 (20)

PDF
If You Think You Can Stay Away from Functional Programming, You Are Wrong
PDF
A Survey of Concurrency Constructs
PDF
Axiomatic Verification of Memory Models
PDF
ASE02.ppt
KEY
Scala: functional programming for the imperative mind
PDF
UML for Java Developers
PDF
Why we cannot ignore Functional Programming
PPTX
Concurrency Constructs Overview
PDF
Software Frameworks
PDF
SEC5261_SAT_Week08_Spring22.pdf
PDF
Software Engineering : OOAD using UML
PDF
Monads and Monoids by Oleksiy Dyagilev
PPT
uml123 copy
PPTX
Scala, Play 2.0 & Cloud Foundry
PPT
Scala introduction
PDF
Twins: OOP and FP
PPTX
Object Oriented Programming
PPTX
About Functional Programming
PDF
Synthesizing API Usage Examples
ODP
The free lunch is over
If You Think You Can Stay Away from Functional Programming, You Are Wrong
A Survey of Concurrency Constructs
Axiomatic Verification of Memory Models
ASE02.ppt
Scala: functional programming for the imperative mind
UML for Java Developers
Why we cannot ignore Functional Programming
Concurrency Constructs Overview
Software Frameworks
SEC5261_SAT_Week08_Spring22.pdf
Software Engineering : OOAD using UML
Monads and Monoids by Oleksiy Dyagilev
uml123 copy
Scala, Play 2.0 & Cloud Foundry
Scala introduction
Twins: OOP and FP
Object Oriented Programming
About Functional Programming
Synthesizing API Usage Examples
The free lunch is over
Ad

More from ClarkTony (20)

PDF
The Uncertain Enterprise
PDF
Actors for Behavioural Simulation
PDF
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
PDF
LEAP A Language for Architecture Design, Simulation and Analysis
PDF
A Common Basis for Modelling Service-Oriented and Event-Driven Architecture
PDF
Context Aware Reactive Applications
PDF
Model Slicing
PDF
Patterns 200711
PDF
Kings 120711
PDF
Iswim for testing
PPT
Iswim for testing
PPTX
Kiss at oopsla 09
PPTX
Mcms and ids sig
PPTX
Ocl 09
PPTX
Scam 08
PDF
Onward presentation.en
PDF
Hcse pres
PPTX
Formalizing homogeneous language embeddings
PPT
Filmstrip testing
PPTX
Dsm as theory building
The Uncertain Enterprise
Actors for Behavioural Simulation
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
LEAP A Language for Architecture Design, Simulation and Analysis
A Common Basis for Modelling Service-Oriented and Event-Driven Architecture
Context Aware Reactive Applications
Model Slicing
Patterns 200711
Kings 120711
Iswim for testing
Iswim for testing
Kiss at oopsla 09
Mcms and ids sig
Ocl 09
Scam 08
Onward presentation.en
Hcse pres
Formalizing homogeneous language embeddings
Filmstrip testing
Dsm as theory building

Recently uploaded (20)

PPTX
Cloud computing and distributed systems.
PDF
cuic standard and advanced reporting.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Machine Learning_overview_presentation.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
Cloud computing and distributed systems.
cuic standard and advanced reporting.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Machine learning based COVID-19 study performance prediction
MYSQL Presentation for SQL database connectivity
Spectroscopy.pptx food analysis technology
Machine Learning_overview_presentation.pptx
sap open course for s4hana steps from ECC to s4
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
A comparative analysis of optical character recognition models for extracting...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Programs and apps: productivity, graphics, security and other tools
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25-Week II

Reverse engineering and theory building v3

  • 1. Reverse Engineering as Theory BuildingTony Clark t.n.clark@mdx.ac.ukBalbir Barn b.barn@mdx.ac.ukSchool of Engineering and Information SciencesUniversity Of MiddlesexLondon, UK
  • 2. OverviewMotivation:Houston, we have a problem.Surely this has been done before?Theory Building:An approach: Old wine in new bottles.Some technology: New wine in old bottles.Case Study:But what might it look like?
  • 3. Motivation: There is nothing new under the sun.
  • 4. The business driverSoftware Outsourcing IncHigh value software maintenance contractsOutsourcing of source code maintenance of large scale legacy systemsCritical operational systemsInitial contract is limited length – achievement of maintenance requests will lead to longer contract.IssuesSupport for responding to rapid ad hoc requests for changes to systemLack of documentationOriginal software developers no longer at the customer companyA common scenario facing many Indian IT providers
  • 5. Naur’s Theory of ProgrammingSeminal paper written in 1985Fundamental assertion:Programmers achieve a certain insight or theory of some aspect of the domain that they are addressingBased on Ryle (1949) – A person who has a theory or facts can do things and explain why and respond to questionsExplains this in the context of the software lifecycleTraditionally software methods are focused on artifact production (explicit knowledge). But should be focussed on techne and phronosis (wisdom derived from practice)
  • 6. Naur’s Thesis: FeaturesProgramming is Theory Building.Understand the domain as a theory.Theories consist of information bearing statements about a domain that are true (or false).No such thing as the ideal theory because:many consistent (incomplete) theories.theories are personal.theories consist of information necessary for stakeholder.
  • 7. Systems lifecycle and theory buildingTheory buildingTheory DecayAnalysis and DesignImplementationMaintenanceDeployed SystemOnce the system is deployed and enters into a maintenance phase, the only way the theory can be retained is by transfer of knowledge between team members.The artifacts represent an incomplete documentation of the theory
  • 8. Naur’s Thesis: Benefit ClaimsCore IPR is in theories.Theories are more abstract than programs.Maintain system using theories.Introduce new people using theory not code.Theories are reusable (code fails to be).Theories allow questions to be articulated.Theories capture different views of a system.
  • 10. What do we currently do?Program Code:Just look at the code.Misunderstandings because:the domain is weakly represented in the code.unable to articulate questions.UML Models:Weakly expressive:Static models are OK.Dynamic models lack completeness.Meaning is bound up with translations to code.Modularity cannot be applied to understanding: have to state the whole thing – no real views.
  • 11. Naur’s Thesis Applied to ModellingWhat’s the difference between modelling and programming?If programming is the construction of a theory that is then mapped to an implementation (theory) then: Modelling smells like programming to me.What’s the difference between modelling and domain specific modelling?A theory building framework gives us a context in which this can be analyzed.
  • 12. Approach: Building theories about an application.
  • 13. Theory Building ProcessUserInterfaceobservationSystem ExecutionsinteractionSourceCodeModels(static, dynamic, security, etc.)Theorems(aspects)formulationinspectionmodificationgroundingDocumentationcomprehensionabstractionPartialTheoriesExpertKnowledgeacquisitionslicingaggregationTheory
  • 14. What is a theory?theorem: true or false statements.theory: collections of theorems.axioms: statements that are givens.rules: ways of constructing theorems.mappings: between theories (and theorems)combinations: composing theories (and theorems).initial: an initial theory maps to all the others.terminal: every theory maps to a terminal theory.
  • 15. Being Concrete: Aspects of a Simple Case Study
  • 16. Customer RequirementSoftware maintenance contract with a Library.They have software controlling borrowings at multiple terminals.Originally sourced from a third party.They have lost the documentation.They have the source code.Occasionally they have noticed books going missing.Under the contract your company needs to identify and fix the problem.
  • 17. Library Source Codeclass Library { Vector<Reader> readers; Vector<Book> books;Hashtable<Reader,Book[]> borrows;intnextReaderId; public void handle(Messagem) {switch(m.id) {case REGISTER:register(m);break;case ADD_BOOK:add_book(m);break;case BORROW:borrow(m);break; ...} } ...}application stateentry pointinterface
  • 18. Library Operationspublic void register(Messagem) { String name = (String)m.getData(0);if(hasReader(name) == false) {intid = allocateReaderId();readers.add(newReader(name,id));m.reply(id); } else m.fail();}message argsguarddata accessmessage reply
  • 19. Borrowingpublic voidborrow(Messagem) {int id = (int)m.getData(0); String name = (String)m.getData(1); Reader reader = getReader(id); Book book = removeBook(name); Book[] borrowed = borrows.get(id);if(borrowed.length < BORROW_LIMIT) { Book[] updated = new Book[borrowed.length+1];Array.copyInto(borrowed,updated);updated[borrowed.length] = book;borrows.put(reader,updated);m.reply(OK); } else m.reply(FAIL);}data accessdata access
  • 24. Partial Theories are Defined by Rulesr = (Reader)[name = n; id = i]not(R->includes(r))---------------------------------------------- [EvalRule] (Eval)[ data = (AddReader)[name = n]; result = (ReaderAllocated)[id = i]; change = (StateChange)[ pre = (Library)[ readers = R; books = B; borrows = X; nextReaderId = i]; post = (Library)[ readers = R->including(r); books = B; borrows = X;nextReaderId = i+1 ] ] ]
  • 25. Evaluating More than one Data Access(Evals)[accesses = Seq{}; changes = Seq{}; results = R] (EvalsRule) (Eval)[data = a; change = c; result = r]--------------------------------------------------------- (EvalsRule)(Evals)[accesses = Seq{a}; changes = Seq{c}; results = Seq{r}] (Evals)[accesses = P; changes = C; results = V] (Evals)[accesses = Q; changes = D; results = W]---------------------------------------------------------- (EvalsRule)(Evals)[accesses = P + Q; changes = C + D; results = V + W
  • 27. TheoremsCan someone borrow a book without joining the library?Can two people join the library with the same id?Is it possible to construct a situation where a book disappears from the library?
  • 29. Fill in the Blanks2
  • 31. DeductionDeduction: Theory tells us there must be two cards for fred.Reality: Fred must have duplicated the library card and an accomplice borrows the second book at the same time when fred borrows the first.Solution: change the theory.
  • 33. Borrowing (modified)publicsynchronized void borrow(Messagem) {int id = (int)m.getData(0); String name = (String)m.getData(1); Reader reader = getReader(id); Book book = removeBook(name); Book[] borrowed = borrows.get(id);if(borrowed.length < BORROW_LIMIT) { Book[] updated = new Book[borrowed.length+1];Array.copyInto(borrowed,updated);updated[borrowed.length] = book;borrows.put(reader,updated);m.reply(OK); } else m.reply(FAIL);}
  • 34. ConclusionUnderstanding is theory building.Modelling and programming are essentially the same.Modelling aims to be initial.Programming needs to be terminal.Modelling languages should support theories.Theories need to support:translation through mappings.different views through combination.patterns through parameterization.