---
sidebar_position: 7
sidebar_label: Profound Automated Testing
---
# Profound Automated Testing

Profound Automated Testing verifies that refactored code behaves identically to the original. Tests are recorded once against your original application, then replayed automatically against refactored versions to detect any discrepancies in screens or data.

This is especially valuable for agent-driven refactoring tasks—like converting legacy RPG to modern RPG, or migrating from one language to another—where you need confidence that functionality remains intact.

## How It Works

### 1. Record Against the Original

Before refactoring begins, tests are recorded against your original application:

- Interact with the application (5250/Genie screens or Rich Display interfaces)
- The system captures JSON payloads representing the UI state at each step
- Database changes are also tracked at each step
- This creates a baseline without writing any test code

### 2. Validate to Establish Baseline

Run the recorded test against the original environment to establish expected outcomes:

- Data hashes are captured for each database table at every step
- These hashes become the reference for future comparisons
- Any dynamic elements (like timestamps) are accounted for

### 3. Replay Against Refactored Code

When an agent refactors code, the tests replay automatically:

- The same interactions run against the refactored application
- UI payloads are compared against the baseline
- Database changes are compared using the captured hashes
- Any differences are flagged—altered screens, missing data, unexpected changes

### 4. Review Results

After replay, you can see exactly what matched and what differed:

- Which screens rendered correctly
- Which data changes matched expectations
- Where discrepancies occurred and why

## Agent Integration

Agents run these tests automatically in **headless mode** during refactoring tasks. This means:

- Tests execute without manual intervention
- Multiple tests can run in parallel
- Results feed back into the agent's understanding of whether the refactor succeeded
- Agents can iterate on their changes if tests fail

This creates a tight feedback loop: the agent refactors, tests verify, and if something breaks, the agent knows immediately and can adjust.

## Modernization and Refactoring

Profound offers a combination of algorithmic and AI-based refactoring for enterprise modernization efforts, including:

- **5250 to Web**: Converting terminal-based interfaces to modern web applications
- **RPG to modern languages**: Transforming RPG code to Node.js, .NET, or Java
- **COBOL to modern languages**: Migrating COBOL applications to contemporary platforms

The algorithmic approach ensures consistent, predictable transformations for well-understood patterns, while AI handles nuanced decisions and edge cases. Profound Automated Testing validates these transformations automatically, ensuring the modernized application behaves identically to the original.

## When to Use

Profound Automated Testing is most valuable for:

- **Code modernization**: Converting legacy code to modern languages or frameworks
- **RPG refactoring**: Updating old RPG patterns to modern free-format RPG
- **Platform migrations**: Moving applications between environments
- **Large-scale changes**: Any refactoring where manual verification would be impractical

For smaller changes or new features, manual testing through the Testing menu may be sufficient. Automated testing shines when you need to verify that complex, existing functionality remains unchanged.

## Learn More

For detailed documentation on recording tests, configuring environments, and analyzing results, see the [Profound Automated Testing documentation](https://profoundlogicsupport.atlassian.net/wiki/spaces/PUI/pages/1461092365/Automated+Testing).
