The P2P Aspect Testing Framework


Testing is a vital stage in the development cycle of any application but is often neglected due to the difficulty and expense required to perform the stage successfully. This is especially so for distributed applications due to the co-ordination required to successfully test several distributed components simultaneously. This position paper proposes a framework implemented using Aspect-Oriented Programming and Reflection, which aims to ease the testing of such systems and other varieties of systems which encounter similar problems. Two case-studies are examined to illustrate how the framework will simplify the testing stage.


Aspect Oriented Programming

Aspect-Oriented Programming is an emerging programming paradigm which extends Object-Oriented Programming (OOP) and claims to improve certain areas where OOP fails. The purpose of OOP is to allow the programmer to cleanly capture a single piece of functionality or concern in an encapsulated object, only exposing features via an interface. Suppose however that a concern can not be cleanly captured in a single object, this would normally result in the concern being spread out over several objects with sections of code implementing the concern contained in each of these objects. This leads to several problems: the code is less maintainable, the readability of the code is diminished and the encapsulation provided by OOP is lost. One piece of functionality which is ideal for capturing with AOP is debugging code like that which would be added to a distributed program in order to test it.


 Peer-to-Peer Support

Due to the large number of nodes that must be simulated, testing distributed systems is highly CPU intensive, requiring very powerful and expensive machines to adequately simulate realistic numbers of users on online communities. This is an increasing problem, which will only grow as the number of users accessing web services increases. A large amount of CPU time is wasted when general purpose workstations are idle throughout the day. The distributed testing framework makes use of the CPU cycles of such idle machines connected via a peer-to-peer network. This network of workstations is capable of hosting distributed tests. For large organisations this gives access to a significant pool of computing resources at no additional cost. Managing these test manually would be extremely time-consuming, if indeed it were possible at all. To this end, a unified interface to the Aspect Testing Framework was created allowing users to manage test nodes across a large distributed test-bed from a single interface (see screenshots).


The Testing Process

The traditional testing process usually employed to test distributed systems is illustrated in Figure 1.


 


[Figure 1]

The automated testing process employed by the Aspect Testing Framework is illustrated in Figure 2.


[Figure 2]


Advantages of the Aspect Testing Framework

1. Automatic insertion and removal of necessary testing code.
2. Support for automated monitoring of the state of many distributed components.
3. More rapid deployment of test scenarios.
4. Easy customisation of test cases
5. Reuse of test code
6. Ensures the correctness of test code


 Screenshots


[Figure 3] Test Code Insertion Interface
 

[Figure 5] The Testbed Host Application


[Figure 4] The Central Interface


Additional Information

1. http://polo.lancs.ac.uk/p2p/DocumentsMain.htm