Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MODULARITY:aosd•13 Keynote Talk by Prof. Reiss

MODULARITY:aosd•13 Keynote Talk by Prof. Reiss

The keynote talk of MODULARITY:aosd•13 titled with "Motherhood and Apple Pie: Modularity in Modern Applications and Tools to Support It" by Steven P. Reiss http://aosd.net/2013/keynotes.html#Reiss

B0c380d80ff4b3c077aa562309a069e7?s=128

Yoshiki Sato

March 29, 2013
Tweet

Transcript

  1. Motherhood and Apple Pie: Modularity in Modern Applications and Tools

    to Support it Steven P. Reiss Brown University March 22, 2013 Page 1
  2. Motherhood and Apple Pie Motherhood and apple pie :: (US)

    Principles or values with which few disagree. 3/22/13 Page 2
  3. Motherhood and Apple Pie 3/22/13 Page 3

  4. What is Modularity Modularity is the ability to view everything

    related to a particular task on one screen 3/22/13 Page 4
  5. What is Modularity The division of a system into a

    set of independent modules Where modules Represents a set of related concerns Communicate in a loosely-coupled fashion 3/22/13 Page 5
  6. Claim True Modularity is Impossible 3/22/13 Page 6

  7. Code Bubbles Demo Demonstration 3/22/13 Page 7

  8. 3/22/13 Page 8

  9. Problem The squiggle is sometimes out of place after a

    character is typed 3/22/13 Page 9
  10. Character Input • Update editor(s) • For the character and

    other effects • Compile and report errors • Update underlying AST structure • Repaint the screen • Handle layout and reflow • Handle reformatting 3/22/13 Page 10
  11. Character Input 3/22/13 Page 11 Event Dispatch Update Selection Auto

    Indent Repaint Request Document Dispatch Auto Completion Update Other Editors Repaint Text Compute Layout Update Eclipse Eclipse AST Update Update Error Set Eclipse Errors Update Annotations Error Notification Update elements Update Elements
  12. Squiggle Code • On ProblemsUpdatedEvent • Lock file { Update

    Problems } Unlock • In update AST structure • { Clear problems } Update tree { Update problems } • Update Problems • Maintain the set of active problems • Remove styles for nonexistent problems • Add squiggle styles for new/cleared problems • When drawing text w/ squiggle style • Use squiggle paint to underline text 3/22/13 Page 12
  13. What Really Happens Type In Display 3/22/13 Page 13

  14. Is This Modularity? The code is modular ? The dynamics

    of the code are not Which is more important? 3/22/13 Page 14
  15. What are the Problems Black box code (Swing, Eclipse) Separate

    interacting processes Unknown control flow • Multiple threads running at once • Callback orders Our issues are dynamic • We want modularity to reflect the dynamics 3/22/13 Page 15
  16. Smart Sign Current Status 3/22/13 Page 16

  17. Smart Sign Code 3/22/13 Page 17 Controller Picture Frame (?)

    Calendar Checker Arduino (C) Bluetooth (C) Arduino Monitor Event Adder Events (Data)
  18. Is this Modular? In terms of code? Adding new events

    (NOTIN) was easy Adding calendar was so-so Adding a new sensor is messy 3/22/13 Page 18
  19. What Are The Problems Externally imposed modularity • Multiple languages

    • Multiple processes • Multiple machines • External code (calendar, obexftp) Part of the program is data • Passed between applications • Representing the rule set 3/22/13 Page 19
  20. Twitter Data Access Twitter Web Site 3/22/13 Page 20

  21. 3/22/13 Page 21

  22. Twitter Data Access 3/22/13 Page 22 Streamer Data Insertion Zip/District

    Encoder Web Server HTML Script CSS Data Database Twitter
  23. Is This Modular? What happens when we want to optionally

    normalize the tweet counts? What happens if we want to add author names? 3/22/13 Page 23
  24. Problems Multiple programs Messages (data) are part of the system

    Database is a system component Web application has its own constraints • Front end: HTML, JavaScript, CSS • Back end: JavaScript (Node.JS) 3/22/13 Page 24
  25. S6 Code Search • Code Search 3/22/13 Page 25

  26. 3/22/13 Page 26

  27. S6 Transforms 3/22/13 Page 27 TransformBase JavaTransform T1 T2 T3

    Tn …
  28. Transforms Are Modular Easy to write • Average 300 lines

    each (135-941) Independent • Automatic configuration • Automatic application/detection • Adding a new transform is trivial 3/22/13 Page 28
  29. Problem Transform sequence blows up Transform process isn’t modular 3/22/13

    Page 29
  30. Difficulties Here We need heuristics to guide transforms • While

    keeping transforms simple to write • While keeping transforms independent • While keeping it easy to add transforms We must modularize transform dynamics • Not their coding 3/22/13 Page 30
  31. What Have We Learned I have lots of fun coding

    3/22/13 Page 31
  32. What Have We Learned Modularity is in the eye of

    the beholder 3/22/13 Page 32 Modularity
  33. What We Have Learned Modularity is Difficult in Today’s Systems

    3/22/13 Page 33
  34. Challenge There is no static modular view of a system

    3/22/13 Page 34
  35. Challenge Modularity depends on the circumstances 3/22/13 Page 35

  36. Challenge True Modularity is Impossible 3/22/13 Page 36

  37. Solutions If we can’t achieve modularity in the code, can

    we achieve it in the view? 3/22/13 Page 37
  38. Multiple View Systems Can we view a system in different

    modular ways 3/22/13 Page 38
  39. Pecan 3/22/13 Page 39

  40. Garden 3/22/13 Page 40

  41. Field 3/22/13 Page 41

  42. Desert 3/22/13 Page 42

  43. Multiple View Systems • Scott Myers: SPG-based representation • CMU

    Sheets • IBM Visual Age • UML editors • Grundy’s & Hosking’s Mviews • Hon’s Fluid AOP • Taivalsaari’s Multidimensional Browsing • Microsoft’s Intentional Programming • … 3/22/13 Page 43
  44. Why These Don’t Work Database View-Update Problem • View updates

    are ambiguous in general • No single representation supports all views 3/22/13 Page 44
  45. What Can Be Done Severely restrict allowed editable views •

    Predetermined set, limited restrictions Explicitly define editing operations • Making view creation prohibitive Use read-only views • Limiting their uses and applicability 3/22/13 Page 45
  46. Virtual Modularity Construct a modular view from the original source

    for a particular task 3/22/13 Page 46
  47. Code Bubbles 3/22/13 Page 47

  48. Code Bubbles Modularity Code Bubbles Working Sets • Are static

    modular views of a system • That can be build dynamically Modularization Techniques • Show individual functions or components • Use elision within the components • Include all types of software artifacts • Allow save/restore of working sets 3/22/13 Page 48
  49. Dynamic Modularity Show the proper modularization for a particular dynamic

    problem 3/22/13 Page 49
  50. Dynamic Software Visualization Visualization for Program Understanding • Needs to

    be done in the programmer’s terms • Needs to be done using proper abstractions Requires dynamic modular views 3/22/13 Page 50
  51. JIVE 3/22/13 Page 51

  52. Jove 3/22/13 Page 52

  53. Dyper Performance Analysis 3/22/13 Page 53

  54. Dymem 3/22/13 Page 54

  55. Dylock 3/22/13 Page 55

  56. Dynamic Visualizations Generic tools only solve generic problems • They

    don’t solve specific problems • Generic views aren’t modular 3/22/13 Page 56
  57. VELD 3/22/13 Page 57

  58. VUIT: Setting Up VELD 3/22/13 Page 58

  59. VUIT Events 3/22/13 Page 59

  60. Why This Doesn’t Work The set of thread states is

    not intuitive nor is the set of events. The whole process is too complex. 3/22/13 Page 60
  61. Automating the Process Can we build these models automatically •

    In general? For particular classes of problems • Threads, Tasks, and Transactions 3/22/13 Page 61
  62. Threads, Tasks, Transactions Automatically • Find event handlers • Find

    significant subtasks • Find Threads and tasks • Find Thread Queues • Based on programmer’s problem definition Provide customized time-based views 3/22/13 Page 62
  63. Dyvise on S6 Server 3/22/13 Page 63

  64. Dyvise on Web Crawler 3/22/13 Page 64

  65. This is Only a Start • Virtual Modularizations • Dynamic

    Modularizations 3/22/13 Page 65
  66. Challenges Paper titles for Modularity 201x • Automatic creation of

    modular views • Dynamic modularity • Programmer-specified editable modular views • Static views of a program’s dynamic behavior • Behavioral modularity • Dynamic modularity across threads • Modular views of a multilingual web application • Automatic creation of dynamic modular views 3/22/13 Page 66
  67. Questions / Suggestions March 22, 2013 67

  68. What is Modularity? • Modularity refers to the compartmentalization and

    inter-relation of the parts of a software package • Modularity is designing a system that is divided into a set of functional units (named modules) that can be composed into a larger application. A module represents a set of related concerns. It can include a collection of related components, such as features, views, or business logic, and pieces of infrastructure, such as 3/22/13 Page 68
  69. Defining Modularity • What is a module? • Source code,

    documentation, design notes, requirements, … • What is a concern? • Whatever we need to look at • For coding, debugging, understanding, … 3/22/13 Page 69
  70. Measuring Modularity • Various measures of metrics for dependencies and

    relationships • How much work to add, modify, or understand a concern • Can you fit the code for one concern on one screen 3/22/13 Page 70
  71. S6 Input Flow 3/22/13 Page 71 SVIWEB (GWT) Firewall XML

    Engine Request Servlet Test Builder Ant Script Test Prototype File Tester Output Generator Solution Set
  72. Problem • Adding a new input test feature • Contracts,

    security constraints • Requires Changing • GWT code, XML, Servlet code, Request structure, Engine, Test builder, test prototype, Ant script 3/22/13 Page 72
  73. Difficulties • Modularity constrained by system • Separate programs are

    needed • Communications protocols are part of code • Multiple languages • Including non-languages (ant) • Including data languages 3/22/13 Page 73