12 research outputs found

    A Test-Driven Approach to Developing Pointcut Descriptors in AspectJ

    Get PDF
    International audienceAspect-oriented programming (AOP) languages introduce new constructs that can lead to new types of faults, which must be targeted by testing techniques. In particular, AOP languages such as AspectJ use a pointcut descriptor (PCD) that provides a convenient way to declaratively specify a set of joinpoints in the program where the aspect should be woven. However, a major difficulty when testing that the PCD matches the intended set of joinpoints is the lack of precise specification for this set other than the PCD itself. In this paper, we propose a test-driven approach for the development and validation of the PCD. We developed a tool, AdviceTracer, which enriches the JUnit API with new types of assertions that can be used to specify the expected joinpoints. In order to validate our approach, we also developed a mutation tool that systematically injects faults into PCDs. Using these two tools, we perform experiments to validate that our approach can be applied for specifying expected joinpoints and for detecting faults in the PCD

    Modeling and Testing of Aspect-Oriented Systems

    Get PDF
    Aspect-Oriented programming modularizes crosscutting concerns into Aspects, which are automatically weaved to the specified points of a program. Although Aspect-Oriented programming improves program maintainability and the encapsulation of crosscutting concerns, it also breaks some traditional programming rules due to the weaving mechanism. Therefore, a new software testing approach has to be developed to rigorously test Aspect-Oriented programs. In this thesis, we introduce the concept of Aspect modeling and Aspect testing and then proceed to our investigation of a model-based incremental approach for testing Aspect-Oriented programs. First, a state machine model in UML is created for each Aspect and each base class, which is the class to be weaved with the aspect. Then each individual aspect or base class is tested using the test cases generated from state machine models. A combined state machine model is established by weaving the aspect model into the base class model. Finally, we perform a test on the woven program using test cases generated from the combined state machine model. Because the number of scenarios for weaving aspects and base classes could be very large, it may require a huge number of test cases to effectively test the program. To speed up the process, we propose a prioritizing strategy for selecting test cases in order to find errors sooner since different test cases have different capacity for tracking errors. We demonstrate that the test cases generated from the state machine model have to satisfy the adequacy of the transition coverage, the round-trip coverage, and the state coverage in the state machine model. Furthermore, the prioritizing strategy is developed based on the number of changes brought by weaving of an aspect and its base classes. The test case including more changes will have a higher priority. The effectiveness of the investigated strategy is evaluated through the case study and the mutation testing. The result of case study shows that the model-based incremental approach integrated with prioritizing test case selection provides an effective tool for testing large-scale Aspect-Oriented systems.  M.S

    Reverse Engineering Aspects to Derive Application Class Models

    Get PDF
    Aspects provide a nice way to modify behavior and implement cross-cutting concerns in object-oriented systems. As such, aspects do not have an existence of their own the application classes that the aspects refer to must be present in order to instantiate the aspects. In this research, we present a reverse engineering approach to generate a minimal class model that has all the structural elements necessary in order to complete exercise a set of aspect

    Reverse Engineering Aspects to Derive Application Class Models

    Get PDF
    Aspects provide a nice way to modify behavior and implement cross-cutting concerns in object-oriented systems. As such, aspects do not have an existence of their own the application classes that the aspects refer to must be present in order to instantiate the aspects. In this research, we present a reverse engineering approach to generate a minimal class model that has all the structural elements necessary in order to complete exercise a set of aspect

    ACRE: un générateur automatique d'aspect pour tester des logiciels écrits en C++

    Get PDF
    RÉSUMÉ La qualitĂ© d'un logiciel est une notion trĂšs importante de nos jours. Un des moyens de s'assurer de la bonne qualitĂ© d'un logiciel est de le tester afin d'en dĂ©tecter, et de corriger, le plus grand nombre de bogues possible. L'approche proposĂ©e dans ce mĂ©moire de maĂźtrise consiste Ă  utiliser la programmation orientĂ©e aspect (AOP, pour Aspect Oriented Programming) afin de tester des programmes ecrit en C++. Elle consiste de plus en la crĂ©ation d'un langage dĂ©die (DSL, pour Domain Specific Language) et d'un logiciel capable de le lire, ACRE (Automatic aspeCt cREator). Ces deux outils permettent la gĂ©nĂ©ration automatique d'aspects Ă©crits en AspectC++, aspects permettant d'effectuer des tests de mĂ©moire, d'invariants ou d’interfĂ©rence dans des programmes Ă©crits en C++. La programmation orientĂ©e aspect est un paradigme basĂ© sur le principe de la sĂ©paration des prĂ©occupations, qui veut que chaque module d'un programme s'occupe uniquement d'une prĂ©occupation et ne s'implique pas dans les autres. L'AOP a dĂ©jĂ  Ă©tĂ© utilisĂ©e afin de tester des logiciels, mais uniquement pour des programmes Ă©crits en Java et pour des programmes embarques Ă©crits en C++. De plus trĂšs peu de solutions ont Ă©tĂ© proposĂ©es afin d'automatiser la crĂ©ation des aspects et leur utilisation. Lorsque de telles solutions ont Ă©tĂ© proposĂ©es, elles l’étaient uniquement pour des programmes Ă©crits en Java. Notre approche permet donc la gĂ©nĂ©ration automatique d'aspects pour des programmes Ă©crits en C++. Ceci est fait grĂące au DSL non-intrusif (dans le sens qu'il ne modifie pas le comportement du code source) introduit sous forme de commentaires dans le code source du programme Ă  tester. L’écriture des lignes de DSL au plus prĂšs du code Ă  tester est par ailleurs la seule modification requise Ă  effectuer dans le code source du programme. Les aspects gĂ©nĂ©rĂ©s sont Ă©crits dans des fichiers sĂ©parĂ©s et sont ensuite tisses au moment de la compilation avec le code source du programme. Notre approche permet ainsi aux dĂ©veloppeurs de pouvoir tester un programme sans avoir Ă  en modifier le comportement. Une premiĂšre Ă©tude de cas pour notre approche est son application afin de tester NOMAD, logiciel d'optimisation de fonctions de type boite noire, utilisĂ© tant en recherche qu'en industrie. Nous avons donc gĂ©nĂ©rĂ© automatiquement des aspects permettant la dĂ©couverte de bogues dans NOMAD. Un test de mĂ©moire nous a permis de dĂ©tecter une fuite mĂ©moire importante, rapportĂ©e par un relevĂ© de bogues d'un utilisateur, grĂące Ă  un aspect gĂ©nĂ©rĂ© automatiquement. Une deuxiĂšme Ă©tude de cas nous a permis de rassurer l’équipe de dĂ©veloppement de NOMAD. Nous avons en effet pu vĂ©rifier la validitĂ© d'un point mathĂ©matique crucial de l'algorithme implĂ©mentĂ©. Ce test d'invariant a Ă©tĂ© lĂ  encore effectuĂ© grĂące Ă  un aspect gĂ©nĂ©rĂ© automatiquement et sans modifier le comportement du code source de NOMAD. Une troisiĂšme Ă©tude de cas concerne la dĂ©tection de bogues de type interfĂ©rence dans des programmes parallĂšles Un bogue de type interfĂ©rence se produit lorsque qu'au moins deux fils d’exĂ©cution d'un programme tentent d’écrire en mĂȘme temps dans une mĂȘme variable. Ce type de bogue fait partie des bogues affectant les programmes parallĂšles les plus difficiles Ă  dĂ©tecter et peu de logiciels actuels permettent de les dĂ©couvrir Ă  coup sĂ»r. Notre approche permet l'obtention, grĂące Ă  des aspects, des temps d’accĂšs en lecture et en Ă©criture d'attributs du programme, ces temps Ă©tant ensuite utilisĂ©s par une approche mathĂ©matique qui aide les logiciels actuels dans leur dĂ©tection de ce type de bogue. Il y a cependant des limites Ă  l'utilisation de notre approche, notamment dues Ă  des limitations inhĂ©rentes Ă  AspectC++, limitations dont nous discutons.----------ABSTRACT In the modern era, software quality is very important. In order to have high software quality, we can test it to find and remove the maximum number of bugs. Our approach uses Aspect-Oriented Programming (AOP) to test software written in C++. We propose a Domain Specific Language (DSL) and ACRE, an Automatic aspeCt cREator that can read our DSL. From these two tools we can automatically generate aspects written in AspectC++ to perform memory, invariant and interference testing for software written in C++. Aspect-Oriented Programming is a paradigm based on the concept of separation of concerns. In this concept, each module deals with one and only one concern, and does not deal with the concerns of other modules. AOP has already been used in testing, but only for software written in Java or embedded software written in C++. Few of these approaches allow an automatic generation of aspects, and to date, it was only to test software written in Java. Our approach allows automatic aspect generation for software written in C++ thanks to our non-intrusive DSL (in the sense that it does not change the behavior or the source code). Our DSL is inserted in the source code of the tested software as comments and this is the only modification made in the source code. Generated aspects are then written to dedicated files and woven within the source code at compile time. Our approach allows developers to test software without having to modify its behavior. Our first case study is to apply our approach with the intent of testing NOMAD, a black box optimization software used both in research and industry. Using automatically generated aspects, we are able to do memory testing in NOMAD and locate an important memory leak mentioned in a bug report. Our second case study is to do invariant testing in NOMAD. We are able, still using a generated aspect, to verify a crucial mathematical point of the implemented algorithm without modifying the behavior of the source code of NOMAD. The third case study concerns interference testing in multi-threaded programs. An interference bug occurs when at least two threads try to write to the same shared variable at the same time. This kind of bug is one of the most difficult to detect and no software is able to them with 100% accuracy. Our approach is used to get both read and write access times for the attribute of the tested software using aspects. These times are then used in a mathematical approach that helps the actual software find interference bug patterns. However there are some limitations to our approach, due to inherent limitations of AspectC++. These limitations are discussed in this thesis

    A framework and tool supports for generating test inputs of aspectj programs

    No full text
    Aspect-oriented software development is gaining popularity with the wider adoption of languages such as AspectJ. To reduce the manual effort of testing aspects in AspectJ programs, we have developed a framework, called Aspectra, that automates generation of test inputs for testing aspectual behavior, i.e., the behavior implemented in pieces of advice or intertype methods defined in aspects. To test aspects, developers construct base classes into which the aspects are woven to form woven classes. Our approach leverages existing test-generation tools to generate test inputs for the woven classes; these test inputs indirectly exercise the aspects. To enable aspects to be exercised during test generation, Aspectra automatically synthesizes appropriate wrapper classes for woven classes. To assess the quality of the generated tests, Aspectra defines and measures aspectual branch coverage (branch coverage within aspects). To provide guidance for developers to improve test coverage, Aspectra also defines interaction coverage. We have developed tools for automating Aspectra’s wrapper synthesis and coverage measurement, and applied them on testing 12 subjects taken from a variety of sources. Our experience has shown that Aspectra effectively provides tool supports in enabling existing test-generation tools to generate test inputs for improving aspectual branch coverage

    Impacts de l'AOP sur les tests dans un environnement Agile : utilisation de Mocks pour les tests unitaires d'aspects

    Get PDF
    Bien que l’AOP soit prĂ©sent dans le paysage informatique depuis quelques annĂ©es, son adoption industrielle reste relativement timide malgrĂ© les bĂ©nĂ©fices architecturaux promis et espĂ©rĂ©s. L’objectif principal de nos travaux est de favoriser l’adoption de l’AOP auprĂšs des dĂ©veloppeurs oeuvrant dans l’industrie. Nous voulons proposer des solutions adaptĂ©es qui permettent Ă  ces professionnels d’embrasser l’AOP sans avoir Ă  sacrifier leur processus, mĂ©thodologie et outils actuels qui leur permettent d’atteindre des objectifs de performance, de qualitĂ©, de dĂ©ploiement et de maintenabilitĂ©. Afin de nous permettre d’identifier des besoins rĂ©els, nous avons centrĂ© nos travaux sur des Ă©quipes employant un processus Agile. En effet, les processus Agiles prĂ©conisent gĂ©nĂ©ralement diverses pratiques et principes qui risquent d’ĂȘtre affectĂ©s par un changement de paradigme de programmation. C’est notamment le cas des tests qui tiennent une place trĂšs importante au sein des mĂ©thodes agiles, car ils permettent l’acceptation du changement sur le long terme. Dans un premier temps, nous avons menĂ© une Ă©tude exploratoire dont l’objectif Ă©tait de mieux dĂ©finir quels seraient les irritants pour des dĂ©veloppeurs dĂ©butants avec l’AOP et qui travaillent dans un environnement Agile. À la lumiĂšre des rĂ©sultats de cette Ă©tude, nous avons amorcĂ© la partie maĂźtresse de nos travaux qui consistent Ă  Ă©laborer une solution pour faciliter les tests unitaires d’aspects. Pour ce faire, nous avons conçu et rendu disponible un cadre d’applications (framework) permettant la crĂ©ation et le tissage de Mocks avec des aspects, facilitant ainsi l’isolation des aspects. Ce cadre a Ă©tĂ© dĂ©veloppĂ© de maniĂšre Ă  s’arrimer avec les pratiques et outils rĂ©pandus en industrie pour des Ă©quipes Agiles.Although the fact that AOP has been proposed since quite a few years, the industrial adoption of this paradigm is not widespread in spite of the benefits hoped and promised for software architectures. The main goal of our work is to promote the adoption of AOP by industrial developers. We want to provide adapted solutions allowing those professionals to embrace AOP without having to sacrifice their processes, practices and tools. We seek practical solutions to allow them to reach their performance, quality, deployment and maintainability goals. To better identify and understand the real needs of teams using Agile processes, our work is focus on Agile environments. In fact, Agile processes encourage numerous practices and principles that could be affected by the usage of AOP in such projects. For instance, this is the case for software testing who is largely embraced the Agile community as a way of sustaining the acceptation of change over time. Our first step was to conduct an exploratory study to identify what could be the irritants for Agile teams who want to use AOP for the first time. Considering those results, we undertook our main contribution consisting to produce a solution to help unit testing of aspects. To do so, we developed and made available a framework to create and weave Mocks with aspects to help isolate aspects for testing purposes. The framework was designed to integrate easily with practices and tools commonly used in the industry by Agile teams

    Prévention et détection des interférences inter-aspects : méthode et application à l'aspectisation de la tolérance aux fautes

    Get PDF
    La programmation orientĂ©e aspects (POA) sĂ©pare les diffĂ©rentes prĂ©occupations composant un systĂšme informatique pour amĂ©liorer la modularitĂ©. La POA offre de nombreux bĂ©nĂ©fices puisqu'elle permet de sĂ©parer le code fonctionnel du code non-fonctionnel amĂ©liorant ainsi leur rĂ©utilisation et la configurabilitĂš des systĂšmes informatiques. La configurabilitĂ© est un Ă©lĂ©ment essentiel pour assurer la rĂ©silience des systĂšmes informatiques, puisqu’elle permet de modifier les mĂ©canismes de sĂ»retĂ© de fonctionnement. Cependant le paradigme de programmation orientĂ©e aspect introduit de nouveaux dĂ©fis pour le test. Dans les systĂšmes de grande taille oĂč plusieurs prĂ©occupations non fonctionnelles cohabitent, une implĂ©mentation Ă  l'aide d'aspects de ces prĂ©occupations peut ĂȘtre problĂ©matique. Partageant le mĂȘme flot de donnĂ©es et le mĂȘme flot de contrĂŽle les aspects implĂ©mentant les diffĂ©rentes prĂ©occupations peuvent Ă©crire dans des variables lues par d'autres aspects ou interrompre le flot de contrĂŽle commun aux diffĂ©rents aspects empĂȘchant ainsi l'exĂ©cution de certains d'entre eux. Dans cette thĂšse nous nous intĂ©ressons plus spĂ©cifiquement aux interfĂ©rences entre aspects dans le cadre du dĂ©veloppement de mĂ©canismes de tolĂ©rance aux fautes implĂ©mentĂ©s sous forme d’aspects. Ces interfĂ©rences sont dues Ă  une absence de dĂ©claration de prĂ©cĂ©dence entre les aspects ou Ă  une dĂ©claration de prĂ©cĂ©dence erronĂ©e. Afin de mieux maĂźtriser l’assemblage des diffĂ©rents aspects composant un mĂ©canisme de tolĂ©rance aux fautes, nous avons dĂ©veloppĂ© une mĂ©thode alliant l'Ă©vitement Ă  la dĂ©tection des interfĂ©rences au niveau du code. Le but de l'Ă©vitement est d'empĂȘcher l'introduction d'interfĂ©rences en imposant une dĂ©claration de prĂ©cĂ©dence entre les aspects lors de l'intĂ©gration des aspects. La dĂ©tection permet d'exhiber lors du test les erreurs introduites dans la dĂ©claration des prĂ©cĂ©dences. Ces deux facettes de notre approche sont rĂ©alisĂ©es grĂące Ă  l’utilisation d’une extension d'AspectJ appelĂ©e AIRIA. Les constructions d'AIRIA permettent l’instrumentation et donc la dĂ©tection des interfĂ©rences entre aspects, avec des facilitĂ©s de compilation permettant de mettre en Ɠuvre l’évitement d’interfĂ©rences. Notre approche est outillĂ©e et vise Ă  limiter le temps de dĂ©boguage : le testeur peut se concentrer directement sur les points oĂč une interfĂ©rence se produit. Nous illustrons notre approche sur une Ă©tude de cas: un protocole de rĂ©plication duplex. Dans ce contexte le protocole est implĂ©mentĂ© en utilisant des aspects Ă  grain fin permettant ainsi une meilleure configurabilitĂ© de la politique de rĂ©plication. Nous montrons que l'assemblage de ces aspects Ă  grain fin donne lieu Ă  des interfĂ©rences de flot de donnĂ©es et flot de contrĂŽle qui sont dĂ©tectĂ©es par notre approche d'instrumentation. Nous dĂ©finissons un ensemble d'aspects interfĂ©rant pour l'exemple, et nous montrons comment notre approche permet la dĂ©tection d'interfĂ©rences. ABSTRACT : Aspect-oriented programming (AOP) separates the different concerns of a computer software system to improve modularity. AOP offers many benefits since it allows separating the functional code from the non-functional code, thus improving reuse and configurability of computer systems. Configurability is essential to ensure the resilience of computer systems, since it allows modifying the dependability mechanisms. However, the paradigm of aspectoriented programming introduces new challenges regarding testing. In large systems where multiple non-functional concerns coexist, an AOP implementation of these concerns can be problematic. Sharing the same data flow and the same control flow, aspects implementing different concerns can write into variables read by other aspects, or interrupt the control flow involving various aspects, and thus preventing the execution of some aspects in the chain. In this work we focus more specifically on interference between aspects implementing fault tolerance mechanisms. This interference is due to a lack of declaration of fine-grain precedence between aspects or an incorrect precedence declaration. To better control the assembly of the various aspects composing fault tolerance mechanisms, we have developed a method combining avoidance of interferences with runtime detection interferences at code level. The purpose of avoidance is to prevent the introduction of interference by requiring a statement of precedence between aspects during the aspects integration. Detection allows exhibiting during the test, errors introduced in the precedence statement. These two aspects of our approach are performed through the use of an extension called AspectJ AIRIA. AIRIA ‘s constructs allow instrumentation and therefore the detection of interference between aspects, with facilities compilation to implement the interference avoidance. Our approach is designed and equipped to limit the debugging time : the tester can focus directly on the points where an interference occurs. Finaly, we illustrate our approach on a case study : a duplex replication protocol. In this context, the protocol is implemented using fine grained aspects allowing a better configurability of the replication policy.We show that the assembly of these fine-grained aspects gives rise to interference data flow and control flow that are detected by our instrumentation approach. We define a set of interfering aspects in this example, and show how our approach allows the detection of interferences
    corecore