IP Library Granted Patent US 10,261,891
Granted Patent B2
US 10,261,891 · App. 15/229,949 · Granted Apr 16, 2019

Automated test input generation for integration testing of microservice-based web applications

Inventors: Shriram Rajagopalan (White Plains, NY); Saurabh Sinha (Danbury, CT)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F11/3664G06F3/0482G06F9/451G06F17/30958
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,261,891
App. No.
15/229,949
Granted
Apr 16, 2019
Kind
B2
Abstract

Techniques for automated generation of inputs for testing microservice-based applications are provided. In one example, a computer-implemented method comprises: traversing, by a system operatively coupled to a processor, a user interface of a microservices-based application by performing actions on user interface elements of the user interface; and generating, by the system, an aggregated log of user interface event sequences and application program interface call sets based on the traversing. The computer-implemented method also comprises: determining, by the system, respective user interface event sequences that invoke application program interface call sets; and generating, by the system, respective test inputs based on the user interface event sequences that invoke the application program interface call sets.

Claims (54)

1. A system, comprising:

a memory that stores computer executable components; and

a processor that executes the computer executable components stored in the memory, wherein the computer executable components comprise:

a user interface crawling component that traverses a user interface of a microservices-based application by performing actions on user interface elements of the user interface;

an event sequence component that:

generates an aggregated log of user interface event sequences and application program interface call sets of an application program interface call graph associated with the microservices-based application based on the traversal of the user interface, and

determines respective user interface event sequences that invoke application program interface call sets based on an analysis of the aggregated log;

a coverage component that generates an annotated application program interface call graph from the application program interface call graph based on the aggregated log, wherein respective edges of the annotated application program interface call graph are annotated with coverage indications;

a test input recording component that generates respective test inputs based on the user interface event sequences that invoke the application program interface call sets and the coverage indications; and

a test execution component that tests, within a defined time period prior to deployment of the micro services-based application in a live environment, at least a portion of the application program interface call graph using at least one test input of the test inputs.

2. The system of claim 1 , further comprising:

wherein at least one coverage indication associated with an edge indicates a calling relationship between two application program interfaces represented by the edge, and the calling relationship is invoked by at least one application program interface call set of the application program interface call sets; and

the coverage component further determines at least one coverage metric related to the annotated application program interface call graph based on the coverage indications.

3. The system of claim 2 , wherein the coverage component further determines that the user interface should be traversed again with one or more mutated event sequences based on the at least one coverage metric and at least one coverage criterion.

4. The system of claim 3 , wherein the coverage component further determines an event sequence for mutation, where the event sequence is determined by the coverage component to invoke an externally visible application program interface that is at least one of directly or indirectly connected with an uncovered edge of the annotated application program interface call graph.

5. The system of claim 4 , wherein the user interface crawling component mutates the event sequence to invoke the externally visible application program interface with at least one of a different parameter or a different parameter value.

6. The system of claim 5 , wherein the user interface crawling component mutates the event sequence by at least one of deletion of an event of the event sequence that contributes at least one parameter to invocation of the externally visible application program interface, addition of an additional event to the event sequence that contributes at least one additional parameter to invocation of the externally visible application program interface, or modification of at least one data value of at least one event of the event sequence.

7. The system of claim 1 , wherein the event sequence component further:

obtains a first log generated by the traversal of the user interface comprising user interface events that are timestamped;

obtains a second log generated by the traversal of the user interface comprising application program interface calls that are timestamped; and

aggregates user interface events and application program interface calls in time synched order into the aggregated log.

8. A computer-implemented method, comprising:

traversing, by a system operatively coupled to a processor, a user interface of a microservices-based application by performing actions on user interface elements of the user interface;

generating, by the system, an aggregated log of user interface event sequences and application program interface call sets of an application program interface call graph associated with the microservices-based application based on the traversing;

determining, by the system, respective user interface event sequences that invoke application program interface call sets based on an analysis of the aggregated log;

annotating, by the system, respective edges of the application program interface call graph with coverage indications based on the aggregated log to generate an annotated application program interface call graph;

generating, by the system, respective test inputs based on the user interface event sequences that invoke the application program interface call sets and the coverage indications; and

testing, by the system within a defined time period prior to deployment of the microservices-based application in a live environment, at least a portion of the application program interface call graph using at least one test input of the test inputs.

9. The computer-implemented method of claim 8 , further comprising:

determining, by the system, at least one coverage metric related to the annotated application program interface call graph based on the coverage indications, wherein at least one coverage indication associated with an edge indicates a calling relationship between two application program interfaces represented by the edge, and the calling relationship is invoked by at least one application program interface call set of the application program interface call sets.

10. The computer-implemented method of claim 9 , further comprising determining, by the system, whether the user interface should be traversed again with one or more mutated event sequences based on the at least one coverage metric and at least one coverage criterion.

11. The computer-implemented method of claim 10 , further comprising determining, by the system, an event sequence for mutation, wherein the event sequence is determined to invoke an externally visible application program interface that is at least one of directly or indirectly connected with an uncovered edge of the annotated application program interface call graph.

12. The computer-implemented method of claim 11 , further comprising mutating, by the system, the event sequence to invoke the externally visible application program interface with at least one of a different parameter or a different parameter value.

13. The computer-implemented method of claim 12 , wherein the mutating comprises at least one of deleting of an event of the event sequence that contributes at least a parameter to invocation of the externally visible application program interface, adding of an additional event to the event sequence that contributes at least one additional parameter to invocation of the externally visible application program interface, or changing of at least one data value of at least one event of the event sequence.

14. The computer-implemented method of claim 8 , wherein the generating the aggregated log comprises:

obtaining, by the system, a first log generated by the traversal of the user interface comprising user interface events that are timestamped;

obtaining, by the system, a second log generated by the traversal of the user interface comprising application program interface calls that are timestamped; and

aggregating, by the system, user interface events and application program interface calls in time synchronized order into the aggregated log.

15. A computer program product for automatically generating test inputs for testing of a microservices-based application, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processing component to cause the processing component to:

traverse a user interface of a microservices-based application by performing actions on user interface elements of the user interface;

generate an aggregated log of user interface event sequences and application program interface call sets of an application program interface call graph associated with the microservices-based application based on the traversing;

determine respective user interface event sequences that invoke application program interface call sets based on an analysis of the aggregated log;

annotate respective edges of the application program interface call graph with coverage indications based on the aggregated log to generate an annotated application program interface call graph;

generate respective test inputs based on the user interface event sequences that invoke the application program interface call sets and the coverage indications; and

test, within a defined time period prior to deployment of the microservices-based application in a live environment, at least a portion of the application program interface call graph using at least one test input of the test inputs.

16. The computer program product of claim 15 , wherein the program instructions are further executable by the processing component to cause the processing component to:

determine at least one coverage metric related to the annotated application program interface call graph based on the coverage indications, wherein at least one coverage indication associated with an edge indicates a calling relationship between two application program interfaces represented by the edge, and the calling relationship is invoked by at least one application program interface call set of the application program interface call sets.

17. The computer program product of claim 16 , wherein the program instructions are further executable by the processing component to cause the processing component to:

determine whether the user interface should be traversed again with one or more mutated event sequences based on the at least one coverage metric and at least one coverage criterion.

18. The computer program product of claim 17 , wherein the program instructions are further executable by the processing component to cause the processing component to:

determine an event sequence for mutation, wherein the event sequence is determined to invoke an externally visible application program interface that is at least one of directly or indirectly connected with an uncovered edge of the annotated application program interface call graph.

19. The computer program product of claim 18 , wherein the program instructions are further executable by the processing component to cause the processing component to:

mutate the event sequence to invoke the externally visible application program interface with at least one of a different parameter or a different parameter value.

20. The computer program product of claim 19 , wherein the mutation of the event sequence comprises at least one of deletion of an event of the event sequence that contributes at least a parameter to invocation of the externally visible application program interface, adding of an additional event to the event sequence that contributes at least one additional parameter to invocation of the externally visible application program interface, or modification of at least one data value of at least one event of the event sequence.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 5, 2016
From: RAJAGOPALAN, SHRIRAM; SINHA, SAURABH
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 039357/0617 →
Continuity (1)
Related Publication 20180039565A1 · Feb 8, 2018
Cited By (2)
US 12,340,346 US 12,619,414