Source Code Rewriting for Readable Test Automation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current software development environments generate lengthy and inefficient test source code based on user interactions, making it difficult to read and maintain.

Innovation Solution

The system captures and records user interactions with an application, using an event tap and test manager daemon to intercept events and generate optimized source code that minimizes identifiers, lines of code, and improves readability by synthesizing events into efficient sequences.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If source code is generated based on each received event, then complete test coverage is achieved, but the source code becomes lengthy and difficult to read

Engineering Contradiction:
Improvetest coverageVSAvoidreadability
Core Design Contradiction:
ReliabilityVSEase of operation

Solution Approach 1:

The system merges multiple individual event records into consolidated test code statements. Instead of generating separate code lines for each event, the system combines related events into single optimized statements that achieve the same test coverage while improving readability and reducing code length.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The system transforms the parameter representation of events by changing from detailed individual event parameters to optimized consolidated parameters. This involves analyzing event sequences and representing them with minimized identifiers and optimized parameter structures that reduce code verbosity while preserving test functionality.

Inventive Principle:
Principle #35Parameter changes

2Reliability

If detailed event sequences are recorded, then accurate test reproduction is achieved, but the number of lines of code increases

Engineering Contradiction:
Improvetest accuracyVSAvoidcode structure
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system extracts and removes redundant information from detailed event sequences. By analyzing the essential elements needed for accurate test reproduction and eliminating unnecessary details, the system generates concise code that maintains test accuracy without requiring excessive lines or complex structure.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The system performs preliminary optimization of event sequences before generating final test code. This involves pre-processing recorded events to identify patterns, consolidate redundant operations, and structure the data in an optimized format that reduces the complexity of the generated code while preserving test accuracy.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10891113B2Source code rewriting during recording to provide both direct feedback and optimal code
Publication Date: 2021.01.12 APPLE INC
  • US10891113B2 patent drawing
  • US10891113B2 patent drawing
  • US10891113B2 patent drawing

AI summary

Systems and methods are disclosed for developing an application on a development device. The application is built on a development device, then installed and run on a test device. Installation includes installing an event tap to intercept events generated by a user interacting with the application. In response to a call from the event tap, a test manager daemon snapshots the user interface elements of the application and packages the snapshot and event for transmission to the development device. A development environment on the development device receives the package, then generates and displays optimized source code in response to the received events and snapshots. Generated source code can be optimized to minimize a number identifiers, minimize a length of identifiers, minimize a generated number of lines of code, or optimize the generated source code for readability.