Presentation is loading. Please wait.

Presentation is loading. Please wait.

Program Comprehension for Domain-Specific Languages Maria João Varanda 1, Marjan Mernik 2, Daniela da Cruz 3, Pedro Henriques 3 1 Polytechnic Institute.

Similar presentations


Presentation on theme: "Program Comprehension for Domain-Specific Languages Maria João Varanda 1, Marjan Mernik 2, Daniela da Cruz 3, Pedro Henriques 3 1 Polytechnic Institute."— Presentation transcript:

1 Program Comprehension for Domain-Specific Languages Maria João Varanda 1, Marjan Mernik 2, Daniela da Cruz 3, Pedro Henriques 3 1 Polytechnic Institute of Bragança, Dep. of Computing and Communications, Portugal 2 University of Maribor, Fac. of Electrical Engineering and Computer Science, Slovenia 3 University of Minho, Dep. of Computer Science, Portugal

2 Context Program Comprehension (PC) is really an hard and complex task, requiring : cognitive models, data extraction, information representation, knowledge exploration, sw visualization, sw metrics …

3 Context In order to reach a full understanding of software systems, it is crucial to relate problem and program domains. Program Visualization and Program Animation are important aids to make this process easier, more effective!

4 Context The outcome of existing tools for General Purpose Languages (GPL) is far away from being as good as desirable !

5 CoRTA'08 - Bragança, 2008-July-115 Motivation To introduce a research project aimed at understanding how the standard approaches for the comprehension of GPL can be adapted for the comprehension of domain specific languages (DSL).

6 CoRTA'08 - Bragança, 2008-July-116 Motivation We believe that specific visualizations could be defined to improve the comprehension of the descriptions in that particular domain !

7 CoRTA'08 - Bragança, 2008-July-117 Outline DSLs DSLpc Project Cognitive Dimensions Framework Methods and Techniques for PC User-centric visualization for DSL ◦ Case-studies Conclusion

8 CoRTA'08 - Bragança, 2008-July-118 Domain Specific Languages Languages tailored to specific application domain that offer to users more appropriate notations and abstractions. DSLs are more expressive and are easier to use than GPLs for the domain in question, with gains in productivity and maintenance costs.

9 CoRTA'08 - Bragança, 2008-July-119 Domain Specific Languages Some specific goals behind the design of DSLs are: to make programming more accessible to end-users, to improve correctness of the written programs, and to improve the program developing time. to make maintenance easier.

10 CoRTA'08 - Bragança, 2008-July-1110 DSLpc Project In this project we have the following objectives: ◦ to measure how easy is to use DSLs (comparing with the use of GPLs), ◦ to understand which one of the existing PC approaches are applicable to DSLs and how could they be improved, ◦ to propose a set of techniques to improve the PC of DSLs, and ◦ to allow the enhancement of DSL program comprehension by enabling user-centric visualization.

11 CoRTA'08 - Bragança, 2008-July-1111 DSLpc Project how easy is to understand DSLs prgs As it does not exists any formal study on advantges of DSLs, our purpose is to identify the aspects among the CDF that are enhanced in the context of DS Languages

12 CoRTA'08 - Bragança, 2008-July-1112 DSLpc Project how easy is to understand DSLs prgs Cognitive dimensions framework (CDF) – a set of 13 guidelines – provides relevant aspects to be used to determine how easy is: ◦ to learn the language, ◦ to develop a program, ◦ to evolve a program, ◦ to comprehend a program.

13 CoRTA'08 - Bragança, 2008-July-1113 DSLpc Project PC Approaches

14 CoRTA'08 - Bragança, 2008-July-1114 DSLpc Project PC Approaches -- Data Extraction Data necessary for DSL comprehension, that must be extracted, is specific and should be identified case-by-case.

15 CoRTA'08 - Bragança, 2008-July-1115 DSLpc Project PC Approaches -- Data Extraction We will consider 2 families of extraction methods: ◦ Non-invasive: that does not modify the source program and uses abstract interpretation techniques. ◦ Invasive: program instrumentation modifies the source code (inserting inspector functions) to be able to collect dynamic information at runtime.

16 CoRTA'08 - Bragança, 2008-July-1116 DSLpc Project PC Approaches -- Data Extraction The development of both approaches completely rely on traditional grammar-oriented techniques for compiler writing and implementation. We use Translation Grammars or Attribute Grammars, and resort to Compiler Generators to automatically produce the code of the desired processors.

17 CoRTA'08 - Bragança, 2008-July-1117 DSLpc Project PC Approaches -- Data Extraction If DSLs processing is supported by grammars technology we can affirm that existing PC approches (methods and techniques) for extraction, are reusable in that specific context.

18 CoRTA'08 - Bragança, 2008-July-1118 DSLpc Project PC Approaches – Information Rep. We also believe that traditional PC methods and techniques for Information Representation and storage are reusable in that specific context.

19 CoRTA'08 - Bragança, 2008-July-1119 DSLpc Project PC Approaches -- Knowledge Exploration Inference mechanisms, metrics, and visualization/navigation over the information so far collected, may also be inherited from generic PC approaches. That intuition comes directly from the previous slide --- the same IR schema is used for GPL/DSL contexts.

20 CoRTA'08 - Bragança, 2008-July-1120 DSLpc Project PC Approaches -- Knowledge Exploration Working with DSLs, we can take total profit of the inherent speciality, and look for more expressive and adequate visual representations for each domain and also metrics and visual interaction and querying.

21 CoRTA'08 - Bragança, 2008-July-1121 DSLpc Project PC Approaches -- Knowledge Exploration Program and Problem comprehension can be achieved easily because it is easier to present a conceptual mapping between both.

22 CoRTA'08 - Bragança, 2008-July-1122 DSLpc Project User-centric Visualization It would be useful to construct visualization tools where end-users, not language designer or developer, can easily specify their own visualization---problem and person specific.

23 CoRTA'08 - Bragança, 2008-July-1123 DSLpc Project User-centric Visualization Concerning the implementation, we think that we can rely upon the approach followed in Alma, a system for program visualization and animation that deals easily with different programming languages and allows the construction of the most appropriate visualizations for each domain.

24 CoRTA'08 - Bragança, 2008-July-1124 DSLpc Project User-centric Visualization The core of Alma is similar to a compiler's Back-End that takes as input an abstract representation, a DAST (Decorated Abstract Syntax Tree), and implements the visualizer and the animator components in a systematic way.

25 CoRTA'08 - Bragança, 2008-July-1125 DSLpc Project User-centric Visualization This is achieved by means of two rule bases, one for the visualization of tree nodes,and another for tree rewriting.

26 CoRTA'08 - Bragança, 2008-July-1126 DSLpc Project User-centric Visualization We plan to build a graphical editor that will provide to the end-user the chance to associate to each node of the DAST: ◦ a geometric figure (a square, circle, etc), or an image. ◦ an external (end-user defined) drawing function.

27 CoRTA'08 - Bragança, 2008-July-1127 DSLpc Project User-centric Visualization This will permit to build specific drawings parameterized to fit well in each particular DSL. The external function will be called using the attributes available in the DAST nodes to tune the picture to each concrete situation.

28 CoRTA'08 - Bragança, 2008-July-1128 DSLpc Project User-centric Visualization We can include that functionality, keeping the tree visualizer engine generic and unchanged; also the animator system, based on a tree rewriting engine, will be kept unchanged.

29 CoRTA'08 - Bragança, 2008-July-1129 Case-study 1: Programming a Cleaning Robot A sample program to move Roby: xi= 0 yi= 0 DOWN 3 RIGHT 7 UP 2 LEFT 4

30 CoRTA'08 - Bragança, 2008-July-1130 Case-study 1: Programming a Cleaning Robot A Program Domain View (operational)

31 CoRTA'08 - Bragança, 2008-July-1131 Case-study 1: Programming a Cleaning Robot A Problem Domain View (behavioral)

32 CoRTA'08 - Bragança, 2008-July-1132 Case-study 2: FDL – Feature Description Language An FDL Description Car: all(carBody,Transmission,Engine,HorsePower, pullsTrailer?) Transmission: one_of (automatic, manual) Engine: more_of (electric, gasoline ) HorsePower: one_of(lowPower, mediumPower, highPower)

33 CoRTA'08 - Bragança, 2008-July-1133 Case-study 2: FDL – Feature Description Language A Program Domain View (operational)

34 CoRTA'08 - Bragança, 2008-July-1134 Case-study 2: FDL – Feature Description Language A Problem Domain View (behavioral)

35 CoRTA'08 - Bragança, 2008-July-1135 Conclusion We have introduced the 2 main directions of our new bilateral (Portugal/Slovenia) project for joint research: ◦ to understand and measure how easy is to comprehend and handle programs written in DSLs; ◦ to addapt and improve Program Comprehension Tools for DSLs programs.

36 CoRTA'08 - Bragança, 2008-July-1136 Conclusion In the first case, we believe that DSL concept implies that a DSL program should be more natural and clearer than the equivalent solution expressed in a General Purpose Language (GPL), but we intent to prove it analyzing DSL actual impact according to the aspects defined in the Cognitve Dimension Framework

37 CoRTA'08 - Bragança, 2008-July-1137 Conclusion We feel that some of the cognitive dimensions (like hidden dependencies, hard mental operations, secondary notation, visibility, role expressiveness) can benefit from DSL program visualization and program comprehension tools, and we intend to prove that!

38 CoRTA'08 - Bragança, 2008-July-1138 Conclusion In the second case, we have to directions: to corroborate our statement that classic approaches for GPLs Program Comprehension, can be reused for DSLs; to enhance DSL program comprehension tools, by enabling user-centric visualization.

39 CoRTA'08 - Bragança, 2008-July-1139 Conclusion We made a concrete proposal: to improve the program understanding tool Alma with extra functionality to allow the user to specify the visual representation he wants to apply for each particular DSL. This allows a better visualization of the Problem Domain, making it closer to Program Domain.


Download ppt "Program Comprehension for Domain-Specific Languages Maria João Varanda 1, Marjan Mernik 2, Daniela da Cruz 3, Pedro Henriques 3 1 Polytechnic Institute."

Similar presentations


Ads by Google