0% found this document useful (0 votes)
49 views8 pages

Data Flow Based Unit Testing On Aspect Oriented Programming: Survey Report

The document is a survey report submitted as part of a course on aspect oriented programming. It contains an abstract summarizing the report, which examines aspect oriented programming and various testing techniques that can be applied to aspect oriented software. The report then defines key aspects of aspect oriented programming and provides an example program in AspectJ. It also describes various static testing techniques like unit testing, data flow testing, and mutation testing that can be used to test aspect oriented software.

Uploaded by

avani_scribd
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views8 pages

Data Flow Based Unit Testing On Aspect Oriented Programming: Survey Report

The document is a survey report submitted as part of a course on aspect oriented programming. It contains an abstract summarizing the report, which examines aspect oriented programming and various testing techniques that can be applied to aspect oriented software. The report then defines key aspects of aspect oriented programming and provides an example program in AspectJ. It also describes various static testing techniques like unit testing, data flow testing, and mutation testing that can be used to test aspect oriented software.

Uploaded by

avani_scribd
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Survey Report

Data Flow Based Unit Testing on Aspect Oriented Programming


Submitted as a part of course curriculum for

On

Bachelor of Technology
In

Computer Science and Engineering

Under the Guidance of Mrs. Neha Gupta Lecturer

Submitted by Abhishek Rathore 0802910004 Amit kumar Shukla 0802910013 Avanish Shah 0802910029

Department of Computer Science and Engineering Gautam Buddha Technical University


Krishna Institute of Engineering & Technology, Ghaziabad

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.

2. What Is Aspect Oriented Programming


Aspect Oriented Programming is based on the paradigm that computer are better programmed by separately specifying the various concerns ( properties or areas of interest ) of a system. A software engineering environment weaves or composes these concerns and the descriptions of their mutual relationship into the runnable program . While OOP tries to find communality among classes and pushes it up the inheritance tree, AOP attempts to realize scattered concerns as first-class elements, and ejects them horizontally from the object structure. AOP is focused on mechanism for simplifying the realizations of such crosscutting concerns. Aspect Oriented programming (AOP) is an emerging programming paradigm that seeks new ways to modularize software systems. Modularizing involves separating and localizing the different concerns things that we care about in our system. Concerns can range from high-level requirements to low-level implementation issues. Due to limitations with the programming language, the implementation of concern must sometimes be scattered across and /or tangled with the rest of the implementations. We say that such a concern is cross-cutting. While traditional programming paradigm have been successful in modularizing primary functionality (core concerns) with constructs such as classes and functions, it has been argued that they fail to provide means of cleanly modularizing crosscutting concerns.

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.

3. Some Key Definitions


Concern : A concern is some functionality or requirement necessary in a system which has been implemented in a code structure. Cross-Cutting Concern : Concerns that in conventional implementations cant be implemented without scattering/duplicating code. Aspect : A concern that cuts across multiple classes and layers. It is a unit of modularity and can contain fields and method like regular java class. Join Point: A method invocation during the execution of program. It is the places where cross-cutting concerns can be invoked. e.g. method call etc. Point Cut : A Point-Cut is an expression mapped to a join point. It is a declaration that selects Join Points and collects contexts at that point.

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.

4. Implementation of AOP using AspectJ


AspectJ is an extension of Java Language that includes several new concepts and constructs. AspectJ enables the modular implementation of wide range of cross-cutting concerns. These include join point, which are well-defined points in execution of a program, pointcuts , which are collections of join points and advice, which are method-like constructs that can be attached to pointcuts, and thereby alter the program execution at the specified join points. Aspects are modular units comprising pointcuts and advice, besides ordinary Java member declarations. Because of all these new features, it is natural to assume that new kinds of faults can exist in programs written in the language.

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

You might also like