IP Library Granted Patent US 10,162,607
Granted Patent B2
US 10,162,607 · App. 15/275,354 · Granted Dec 25, 2018

Source code rewriting during recording to provide both direct feedback and optimal code

Inventors: Brooke K. Callahan (San Jose, CA); Michael S. Ferris (Sunnyvale, CA); William B. Turner (San Francisco, CA); Paul E. Marks (San Jose, CA); Matthew E. Dreisbach (Boulder Creek, CA); Joar Wingfors (Campbell, CA)
Assignee: Apple Inc.
G06F8/34G06F3/0482
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,162,607
App. No.
15/275,354
Granted
Dec 25, 2018
Kind
B2
Abstract

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.

Claims (58)

1. A computer-implemented method, comprising:

receiving, by an application development system, a first event generated by user interaction with an application being executed;

generating first source code that corresponds to the first event;

receiving, by the application development system, a second event generated by user interaction with the application;

synthesizing the first and second events and generating second source code that is optimized based at least in part on the synthesis of both the first and second events; and

replacing the first source code with the optimized second source code; and

executing test source code configured to test the application, the test source code comprising the optimized second source code.

2. The method of claim 1 , further comprising:

receiving, by the application development system, a snapshot of a first state of user interface elements of the application, the first state including the first event, wherein generating first source code is further based on the snapshot of the first state of the user interface;

receiving, by the application development system, a snapshot of a second state of user interface elements of the application, the second state including the second event; and wherein generating second source is further based on the second snapshot of the user interface elements.

3. The method of claim 1 , wherein optimizing source code based on both the first and second events includes at least one of:

minimizing the number of identifiers used in the source code;

minimizing the length of at least one identifier used in the source code;

minimizing a number of calls to an API, framework, or operating system function; or

minimizing the number of lines of source code generated.

4. The method of claim 1 , wherein optimizing source code based on both the first and second events includes consolidating events.

5. The method of claim 4 , wherein consolidating events comprises excluding one or more of the first or second events.

6. The method of claim 5 , wherein excluding one or more of the first or second events comprises excluding a TypeText event that comprises a backspace or delete key, and excluding the TypeText event that immediately preceded the TypeText event comprising the backspace or delete key.

7. The method of claim 4 , wherein consolidating events comprises combining a sequence of one or more TypeText events into a single TypeText event comprising the text of each of the one or more TypeText events.

8. A non-transitory computer readable medium programmed with instructions that, when executed by a processing system, perform operations, comprising:

receiving, by an application development system, a first event generated by user interaction with an application being executed;

generating first source code that corresponds to the first event;

receiving, by the application development system, a second event generated by user interaction with the application;

synthesizing the first and second events and generating second source code that is optimized based at least in part on the synthesis of both the first and second events;

replacing the first source code with the optimized second source code; and

executing test source code configured to test the application, the test source code comprising the optimized second source code.

9. The medium of claim 8 , the operations further comprising:

receiving, by the application development system, a snapshot of a first state of user interface elements of the application, the first state including the first event, wherein generating first source code is further based on the snapshot of the first state of the user interface;

receiving, by the application development system, a snapshot of a second state of user interface elements of the application, the second state including the second event; and wherein generating second source is further based on the second snapshot of the user interface elements.

10. The medium of claim 8 , wherein optimizing source code based on both the first and second events includes at least one of:

minimizing the number of identifiers used in the source code;

minimizing the length of at least one identifier used in the source code;

minimizing a number of calls to an API, framework, or operating system function; or

minimizing the number of lines of source code generated.

11. The medium of claim 8 , wherein optimizing source code based on both the first and second events includes consolidating events.

12. The medium of claim 11 , wherein consolidating events comprises excluding one or more of the first or second events.

13. The medium of claim 12 , wherein excluding one or more of the first or second events comprises excluding a TypeText event that comprises a backspace or delete key, and excluding the TypeText event that immediately preceded the TypeText event comprising the backspace or delete key.

14. The medium of claim 11 , wherein consolidating events comprises combining a sequence of one or more TypeText events into a single TypeText event comprising the text of each of the one or more TypeText events.

15. A system comprising:

a processing system coupled to a memory programmed with executable instructions that, when executed by the processing system perform operations, comprising:

receiving, by an application development system, a first event generated by user interaction with an application being executed;

generating first source code that corresponds to the first event;

receiving, by the application development system, a second event generated by user interaction with the application;

synthesizing the first and second events and generating second source code that is optimized based at least in part on the synthesis of both the first and second events; and

replacing of the first source code with the optimized second source code; and

executing test source code configured to test the application, the test source code comprising the optimized second source code.

16. The system of claim 15 , the operations further comprising:

receiving, by the application development system, a snapshot of a first state of user interface elements of the application, the first state including the first event, wherein generating first source code is further based on the snapshot of the first state of the user interface;

receiving, by the application development system, a snapshot of a second state of user interface elements of the application, the second state including the second event; and wherein generating second source is further based on the second snapshot of the user interface elements.

17. The system of claim 15 , wherein optimizing source code based on both the first and second events includes at least one of:

minimizing the number of identifiers used in the source code;

minimizing the length of at least one identifier used in the source code;

minimizing a number of calls to an API, framework, or operating system function; or

minimizing the number of lines of source code generated.

18. The system of claim 15 , wherein optimizing source code based on both the first and second events includes consolidating events.

19. The system of claim 18 , wherein consolidating events comprises excluding one or more of the first or second events.

20. The system of claim 19 , wherein excluding one or more of the first or second events comprises excluding a TypeText event that comprises a backspace or delete key, and excluding the TypeText event that immediately preceded the TypeText event comprising the backspace or delete key.

21. The system of claim 18 , wherein consolidating events comprises combining a sequence of one or more TypeText events into a single TypeText event comprising the text of each of the one or more TypeText events.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 2, 2016
From: CALLAHAN, BROOKE K.; FERRIS, MICHAEL S.; TURNER, WILLIAM B.; MARKS, PAUL E.; DREISBACH, MATTHEW E.; WINGFORS, JOAR
To: APPLE INC.
Reel/Frame 040201/0463 →
Continuity (2)
Provisional Application 62339857 · May 21, 2016
Related Publication 20170337041A1 · Nov 23, 2017
Cited By (1)
US 12,730,615