Data Flow Based Unit Testing On Aspect Oriented Programming: Survey Report
Data Flow Based Unit Testing On Aspect Oriented Programming: Survey Report
On
Bachelor of Technology
In
Submitted by Abhishek Rathore 0802910004 Amit kumar Shukla 0802910013 Avanish Shah 0802910029
Contents Table
Abstract What Is Aspect Oriented Programming Some key definitions Implementation of AOP using AspectJ An AspectJ Example Detailed description of various static testing techniques to be used for testing Aspect-Oriented Software. References
1. Abstract
Aspect-Oriented Programming (AOP) is a recent programming paradigm that aims at enhancing modularity and thus solving the problem of crosscutting concerns by capturing them into new units of modularity called aspects. With the increasing usage and acceptance of AOP, the task of assuring aspectoriented systems correctness has become a challenge, mainly due to its nature. Although several testing techniques have been applied and improved in Object-Oriented (OO) programs through the years, it is still required to demonstrate and verify which ones can be applied to AOP. The Research work provides a synopsis regarding AOP and identifies software quality harms inducted by AOP. In addition, major issues related with testing AOP programs are also described. The latter leads to a set of suggestions, with the intention of improving and assuring software quality in Aspect-Oriented Systems, which is the main goal of the underlying research work. The work here reported was strictly based on surveying existing literature on the topic.
AOP attempts to solve the problem by allowing the programmer to develop cross-cutting concerns as full stand-alone modules called aspects. In most AOP languages, an aspect is comprised of one or more pieces of advice (code snippets like method) and a list of join point (points in main program into which the advice should be woven). For example a security module can include an advice that performs a security check, with instruction to weave this code snippet into the beginning of methods a(), b() ,and c() of some class. Powerful mechanisms enable a broad specification of join points, so that developers need not enumerate weaving destinations manually. These mechanisms are commonly known as pointcut specification language. Aspect Oriented language have three critical elements: 1. A Join point model 2. A mean of identifying join points, and 3. A mean of affecting implementation at join points. Aspect Oriented Software development introduces a new paradigm that complements existing ones. A new paradigm brings new options, but also new problems, eg. When several aspects have to compose an application , a given aspect not only crosscuts the application, but may also crosscut other aspects. This issue is called the inter-aspect composition aspect. The solution is in AspectJ is based on precedence rules.
Advice : Advice is an implementation of concern represented as an interceptor. This is the actual code to be executed at a Join Point. It has three types : before, after and around.
5. An AspectJ Example
public class Example{ public static void deliverMsg(String msg){ System.out.println(The Message Is: + msg); } Public static void main(String args[]){ deliverMsg(I am here); deliverMsg(Amit Rocks); } } public aspect ExampleAspect{ pointcut helloPC():call(void Example.deliverMsg(..)); before() : helloPC(){
System.out.println(Hello! ); } After() : helloPC(){ System.out.println(The message has been delivered); } } Output: Hello! The Message is : I am Here The message has been delivered. Hello! The message is : Amit Rocks The message has been delivered
6. Detailed Description of various static testing techniques to be used for testing Aspect-oriented Software
Under this process of AO Testing, One application on AO System will be developed, AO Testing will be done on all security issues related to the aspect oriented system in order to develop the application that will be suitable for real world system. On developed application, some of the proposed methodology of working is as shown below which is completely dependent on standard way of testing any sophisticated application will be used. Unit Testing: Unit testing is to test each unit (basic component) of a program to verify that the detailed design for the unit has been correctly implemented. Since unit testing is performed after implementing a programs unit (component), it is very effective to check various errors in a programs units At earlier stage of life cycle, There are two types of unit testing, i.e., specification-based unit testing (black-box testing), and program-based unit testing (white-box testing).specification-based testing focuses on verifying the functions and behaviors of software components according to an external view, program-based testing focuses on checking the internal logic structures and behaviors of a software component. One type of program-based testing is dataflow testing which tests how values which are associated with variables can
affect the execution of the program. Data flow testing uses the data flow relations in a program to guide the selection of tests. Inter-Module Unit Testing: Inter-module Testing means performing testing on a public module along with some other module it calls, directly or indirectly, in an aspect or part of the class .Inter-module testing does not consider innovation of other modules outside the class. Intra-Aspect /Class Testing: Intra-Aspect /Class Testing mean performing testing on the interactions of multiple public modules in an aspect or class when they are called in a random sequence from the outside of the aspect or class. Data Flow Testing: Data flow testing mainly focuses on testing the value assignment of each variable in a program by executing sub-paths from assignment to some program points in which the variable is used. Mutation Testing: Mutation testing has been shown to be one of the strongest testing criteria for the evaluation of both programs and test suites. Comprehensive sets of mutants require Strong test sets to achieve acceptable testing coverage. Moreover, mutation operators are valuable for the evaluation of other testing approaches. Although its importance Has been highlighted for Aspect-Oriented (AO) programs, there is still a need for a suitable set of mutation operators for AO languages. The quality of the mutation testing itself relies on the quality of such operators. Random Testing: Random Testing (RT) and its derivatives such as Adaptive Random Testing (ART) are active and important research topics in software testing, which have also a niche in practical settings due to the merits they offers, e.g. fault-detection capacities at low cost, ease of implementation, reliability estimation, facility for automation and so forth. Inspired by these advantages, we believe the idea behind random testing can be worthwhile and attractive for testing aspect oriented programs since current research on testing of AOP, especially automated has not been adequately performed and is still in infancy.
8. References
Documentation on AspectJ released by eclipse foundation. C.C. Lopes and T. C. Ngo, Unit-Testing Aspectual Behavior, In Proceedings of Research paper on Testing Aspect-Oriented Programs (WTAOP), held in conjunction with the 4th International Conference on Aspect-Oriented Software Development (AOSD), 2005. W. Xu, D. Xu, V. Goel, and K. Nygard, "ASPECT FLOW GRAPH FOR TESTING ASPECTORIENTED PROGRAMS ", August 2004, http://www.cs.ndsu.nodak.edu/~wxu/research/43 6-1111jd.pdf. Blinder, R.V., Testing Object-Oriented Systems: Models, Patterns, and Tools. Addison-Wesley, 2000. S. Zhang and J. Zhao. On identifying bug patterns in aspect oriented programs. In COMPSAC2007, pages 431438. IEEE Computer Society, 2007. Jon Swane Baekken. A fault model for PointCuts and Advice in AspectJ Programs. , August 2006. Henrich E. G. Bonin. Aspect Oriented Software Development A little guidance to better Java Applications , July 2007 Henry P. jones. Aspect Oriented Programming with Spring- A systematic review. September, 2006 F.B. Ferrari, E. N. Hohn, J.C. Maldonaldo. Testing Aspect Oriented Software: Evolution and collaboration through the years. Brazil, 2007 J Zaho, Tools support for unit testing of Aspect-Oriented Software. Seattle/W.A. USA, 2002