Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7690519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:24:57+00:00 2026-05-31T20:24:57+00:00

Our Java application has a number of modules which implement a common interface. By

  • 0

Our Java application has a number of modules which implement a common interface. By design, each module is well-encapsulated and interchangeable. All calls to/from go via a small set of interfaces.

We need to instrument this mechanism to add,

  1. Record the method calls and results – in a structured format
  2. Replay those calls against the module, when debugging an issue, or testing a fix.
  3. (Nice-to-have) Use the recorded interactions as an ‘Expected’ result, have them compared to ‘Actual’ when running JUnit tests.
  4. (Probably-should-have) Be fully thread-safe.

Are there recommended options for this?

A few options I glanced at:

  • Chronon – Looks like a different concept. ‘No code of your program is being executed when you playback the recordings’
  • Some academic papers on JSnoopy, SCARPE; these don’t seem to be public projects?
  • Write by hand e.g. capture the calls with AspectJ – Should work but I’m wondering if there’s something off-the-shelf.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:24:59+00:00Added an answer on May 31, 2026 at 8:24 pm

    Assuming you are very strict about adhering to your small set of interfaces, then you could make use of wrapper objects that do the following:

    • Implement the interface
    • Log/record the inputs
    • Delegate the call to the underlying object
    • Log/record the result
    • Return result to caller

    You could also modify factory methods to return wrapped objects rather than the underlying objects so that the usage of these wrappers is fairly transparent.

    Note that you will need to be very careful about mutability of parameters: ideally all parameters would be immutable but if not you would need to take deep copies (perhaps via serialization).

    Theoretically you can then also use the logged inputs to enable playback and/or testing…. but I’d be cautious about expecting too much from this since playback would require you to capture all relevant state (including external state like DB transaction, filesystem access etc.) In general this is hard to achieve, though you might be able to make it work in your specific case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A module I'm adding to our large Java application has to converse with another
I've set up ehcache on our Java application, which uses Spring and Hibernate. However,
Our Java application has about 100 classes mapped to a database (SQL Server or
Our application has a table which stores all transactions records of clients in one
I have a J2EE java application which processes SOAP requests. In our production environment
We want to be able to create log files from our Java application which
Currently our Java application uses the values held within a tab delimited *.cfg file.
Part of our java application needs to run javascript that is written by non-developers.
On one of our Java application screens, we want to display data loaded from
I am working on the I18n of our java application and we have decided

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.