620 likes | 642 Views
This article discusses the challenges faced in today's multi-language systems, such as complex interfaces and wrong assumptions, and presents potential solutions. The results and team members of the research program, MoSART, are also mentioned.
E N D
On Analysing Multilanguage Systems MoSART 16/05/02
Who? What? How? Results? Logos by Gabriel Chojnacki
9 Ph.D. Graduates in Past Two Year
New Team
Manel Abdellatif. Ph.D. in progress Mouna Abidi. Ph.D. in progress Béchir Bani. M.Sc. in progress Luis Diego Correa Arias. Ph.D. in progress Mana Eskandari. Ph.D. in progress Olivier Grenier-Chenier. M.Sc. in progress Manel Grichi. Ph.D. in progress Zeinab (Azadeh) Kermansaravi. Ph.D. in progress Fábio Petrillo. Ph.D. in progress Théo Rubenach. M.Sc. in progress Anas Shatnawi. Post-doc. in progress Aymen Zalila. M.Sc. in progress Mahdis Zolfagharinia. M.Sc. in progress
What’s with today’s systems?
Challenges with Multi-language Systems • Today’s systems are multi-languages • Facebook • Twitter • … • Even your “regular” software system is now multi-language, typically a Web application
Challenges with Multi-language Systems • New challenges • Different computational models • Complex interfaces (API) • Wrong assumptions • Wrong conversions • …
Challenges with Multi-language Systems • For example, control- and data-flows between Java and “native” C/C++ code • native methods in Java are used by Java classes but (typically) implemented in C/C++
Challenges with Multi-language Systems • Control-flow interactions • Java code calls native code • Native code calls Java methods • Native code can “throw” and must catch exceptions • Data-flow interactions • Java code passes objects (pointers) • Native code creates objects • …
Challenges with Multi-language Systems • Different computational models Gang Tan and Jason Croft ; An Empirical Security Study of the Native Code in the JDK ; Proceedings of the 17th conference on Security Symposium, USENIX, 2008
Challenges with Multi-language Systems • Different computational models static void *xmalloc(JNIEnv *env, size_t size) { void *p = malloc(size); if (p == NULL) JNU_ThrowOutOfMemoryError(env, NULL); return p; } #define NEW(type, n) ((type *) xmalloc(env, (n) * sizeof(type))) static const char *const *splitPath(JNIEnv *env, const char *path) { ... pathv = NEW(char *, count+1); pathv[count] = NULL; ... } Gang Tan and Jason Croft ; An Empirical Security Study of the Native Code in the JDK ; Proceedings of the 17th conference on Security Symposium, USENIX, 2008
No diversion of control flow! Challenges with Multi-language Systems • Different computational models static void *xmalloc(JNIEnv *env, size_t size) { void *p = malloc(size); if (p == NULL) JNU_ThrowOutOfMemoryError(env, NULL); return p; } #define NEW(type, n) ((type *) xmalloc(env, (n) * sizeof(type))) static const char *const *splitPath(JNIEnv *env, const char *path) { ... pathv = NEW(char *, count+1); pathv[count] = NULL; ... } Gang Tan and Jason Croft ; An Empirical Security Study of the Native Code in the JDK ; Proceedings of the 17th conference on Security Symposium, USENIX, 2008
Research Program
Objectives • Objective 1: Definition and modeling of mixed-language patterns from the literature, from developers, and through the mining of real, open-source SIMILAS
Objectives • Objective 2: Automated identification of occurrences of the modelled mixed-language patterns and source-code transformations to introduce/remove these occurrences to improve software quality
Objectives • Objective 3: Characterisation of the modelled patterns and of their occurrences in SIMILAS to assess their prevalence and impact on the systems’ quality and developers’ comprehension
Research Platform Ptidej Tool Suite Software tools Support the analysis of the implementation, design, and architecture of object-oriented programs Support the detection and introduction of patterns at the code, design, and architectural levels
Ptidej Tool Suite Analysis Domain concepts “quality of object-oriented” “promoting the use of idioms, design patterns, and architectural patterns” “analysis of the implementation, design, and architecture of object-oriented programs” “detection and introduction of patterns at the code, design, and architectural levels”
Ptidej Tool Suite Analysis Domain concepts “quality of object-oriented” “promoting the use of idioms, design patterns, and architectural patterns” “analysis of the implementation, design, and architecture of object-oriented programs” “detection and introduction of patterns at the code, design, and architectural levels”
Ptidej Tool Suite Constraint Apply patterns/best practices (existing or new) when developing the tools Architectural Design Implementation Self-imposed but sensible “Eating your own dog food” (http://www.urbandictionary.com/define.php?term=eating%20your%20own%20dog%20food)
Ptidej Tool Suite Related work Various parsers (target languages) e.g., GCCXML Various meta-model (sometimes implicit) Similar to UML meta-model (1997) Before OMG KDM (2003) Before Eclipse EMF (2004) Before OMG MOF (2006) Various tools e.g., Rigi (H. M. Kienle and H. A. Müller: Rigi – An environment for software reverse engineering, exploration, visualization, and redocumentation. Sci. Comput. Program. 75(4): 247-263, 2010)
Ptidej Tool Suite Related work Existing Too low-level e.g., GCCXML No “free” parsers e.g., UML meta-model Difficult to access / to use / to adapt e.g., Rigi
Ptidej Tool Suite What to detect? In what to detect it? How to express it?
Ptidej Tool Suite Design Patterns Models of OO programs PADL meta-model
Ptidej Tool Suite PADL Pattern and Abstract-level Description Language
Ptidej Tool Suite PADL Creators C++, C, Java, JavaScript? PADL Pattern and Abstract-level Description Language
Ptidej Tool Suite • PADL Analyses • Binary Class Relationships • Systematic UML PADL Creators C++, C, Java, JavaScript? PADL Pattern and Abstract-level Description Language
Ptidej Tool Suite PADL Generators XMI… • PADL Analyses • Binary Class Relationships • Systematic UML PADL Creators C++, C, Java, JavaScript? PADL Pattern and Abstract-level Description Language
Ptidej Tool Suite PADL Generators XMI… • PADL Analyses • Binary Class Relationships • Systematic UML PADL Creators C++, C, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language
Ptidej Tool Suite PADL Generators XMI… • PADL Analyses • Binary Class Relationships • Systematic UML PADL Design Motifs Anti-patterns, code smells, and -patterns PADL Creators C++, C, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language
Ptidej Tool Suite PADL Generators XMI… POM Primitives, Operations, Metrics • PADL Analyses • Binary Class Relationships • Systematic UML PADL Design Motifs Anti-patterns, code smells, and -patterns PADL Creators C++, C, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language
Ptidej Tool Suite (Ptidej Solver) Identification of design motifs PADL Generators XMI… POM Primitives, Operations, Metrics • PADL Analyses • Binary Class Relationships • Systematic UML PADL Design Motifs Anti-patterns, code smells, and -patterns PADL Creators C++, C, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language
Ptidej Tool Suite (Ptidej Solver) Identification of design motifs SAD Identification of anti-patterns PADL Generators XMI… POM Primitives, Operations, Metrics • PADL Analyses • Binary Class Relationships • Systematic UML PADL Design Motifs Anti-patterns, code smells, and -patterns PADL Creators C++, C, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language
Ptidej Tool Suite Ptidej UI User interface (using reflection) (Ptidej Solver) Identification of design motifs SAD Identification of anti-patterns PADL Generators XMI… POM Primitives, Operations, Metrics • PADL Analyses • Binary Class Relationships • Systematic UML PADL Design Motifs Anti-patterns, code smells, and -patterns PADL Creators C++, C, Java, JavaScript? PADL Serialisers DB4O, JOS… PADL Pattern and Abstract-level Description Language
Ptidej UI Viewer Standalone Swing displaying PADL (Another example of “Eating your own dog food” )