Skip to content
HAIBING edited this page Jul 25, 2022 · 3 revisions

Arex IconAREX

1. What is AREX?

AREX, short for Automatic Replay X, is a regression testing tool for software development that allows you to validate APIs and quickly find out what causes differences in responses.

Its core goal is to improve the quality of software development and reduce the cost of testing.

It works by record from entry to all dependencies (such as remote calls and local cache calls) and then restoring all dependencies on replay. Everything is done automatically.

Therefore, it also absolutely supports read and write operations, including synchronous, asynchronous and transactional.

2. How is it implemented in Java?

We use ByteBuddy to modify the bytecode of the target class and inject the logic for recording and replaying to build a dynamic instrumentation agent for the Java application which should be bootstrap or attached.

You can find more information about our AREX's agent implementation here.

3. What modules does AREX consist of?

There is a basic chart that looks like this:

  graph TD;
    A[AREX]-->B[Configuration Service];
    A-->C[Schedule Service];
    A-->D[Agent Hook Service];
    A-->E[Replay Report Service];    
    A-->H[Storage Service];
    A-->I[Front-End]
Loading
  • Front-End is a visual web site that provide entry to all operations in your AREX.

    There is a sample image for you to preview as follows:

    Report Details

  • Configuration Service is a sets of configuration APIs for the recording and replaying functions.

    For example, what is the frequency and period of recording, and which operations need to be recorded, and which use cases can be replayed, etc.

  • Schedule Service is a set of schedule APIs that provide replay send and retrieve all responses for comparison.

  • Agent Hook Service is a basic component that provides replaying and recording. By default, we implement common technology stack usage like Http Servlet.

  • Replay Report Service is a set of report APIs that provide difference summaries and show the difference result details after the responses are compared.

  • Storage Service is a set of remote storage APIs that provide Agent Hook Service to save records and get responses as mocks. It also provide that Schedule Service to load user cases for replay.

  • Deployments is a couple of scripts to install AREX.

4. What are the features?

There are some features as follows:

  • It can be integrated and used without modifying the source code of your project.
  • Supports read and write operations whether synchronous, asynchronous, or transactional.
  • No dirty data is generated during testing and no manual data cleaning is required.
  • Regression testing no longer needs to generate test cases manually, and it can be reused.
  • Support one-click Debug to quickly reproduce online problems.

5. How to getting started?

1. Prerequisites

  • Check if your JDK version supports it, we at least support JDK8 and above.
  • List components you use in your project, which components are supported by the AREX's Agent. If not you can extend it.

2. Installation AREX's Agent

In the Java, there are two ways to install AREX's agent:

  1. Use the JVM parameter -javaagent, the example is as follows:
    java -javaagent:/path/to/agent.jar -jar myapp.jar
    
  2. Write an application yourself using VirtualMachine's attach API. For more information, you can find online examples.

Note that there are additional parameters in our AREX's Agent required:arex.service.name and arex.storge.model.

More information on installation can be found here.

3. Extension by yourself

In the Java, we use Service Provider Interface mechanism to load services dynamically.

You can find service contracts in our components listed above.

4. A live demo

There is a live demo created from Spring-Petclinic.

6. Contributing

Welcome to join us, you can change the source code to build what you want by yourself.

  1. Fork it
  2. Create your feature branch
  3. Commit your code changes and push to your feature branch
  4. Create a new Pull Request

7. License