The present disclosure generally relates to automated testing of software and, in one specific example, to testing services in a microservice architecture having a consumer-driven contract pattern.
Microservice architecture (MSA) has become more and more popular in the information technology (IT) industry (e.g., as a feature of cloud native applications). MSA brings some advantages, such as easy deployment, automatic scaling, service resilience, and so on. But it also brings some challenges. For example, in a traditional software development process, such as one involving a monolithic architecture, integration testing is an important phase to ensure software quality. But, in MSA, integration testing has some problems, including being slow, easy to break, hard to fix, and so on.
Consumer-driven contract (CDC) testing is an option for replacing integration testing in MSA. CDC testing in MSA may be separated into two categories. One category is for synchronous communications, such as for services using Hypertext Transfer Protocol (HTTP) and Representational State Transfer (REST)ful APIs. Another is asynchronous communications, such as for services using Advanced Message Queuing Protocol (AMQP), which is supported in many cloud environments. Third-party CDC tools, such as Pact, may be used for testing synchronous message contracts. However, such third-party tools are often ineffective or inefficient for testing asynchronous message contracts. For example, third-party tools may merely run a unit test to get a result and then check the result against the message contract. For complex services, such as microservices running in a cloud-based enterprise resource planning (ERP) environment, third-party CDC testing tools typically generate and use fake code (e.g., test doubles); thus, their results may not match results from code deployed on a real system.
In the following description, for purposes of explanation, numerous specific details are set forth in order to provide an understanding of example embodiments of the present subject matter. It will be evident, however, to those skilled in the art that example embodiments may be practiced without these specific details.
In example embodiments, a method of verifying, during a continuous integration (CI) and continuous delivery (CD) process, that an asynchronous message contract between a consumer service and a provider service in a microservice architecture has not been broken by a change to the provider service is disclosed. The asynchronous message contract is retrieved from a central server. A test message queue is created, the test message queue being separate from an existing message queue. Generation of a message based on a precondition specified in the asynchronous message contract is triggered. The message is retrieved from the test queue. The message is verified according to the asynchronous message contract, the verifying based on a build error not being generated during the CI and CD process.
This method and example embodiments disclosed herein may be implemented by a specially-configured computer system. The computer system may be specially configured by one or more modules (e.g., hardware modules or software modules) and implemented by one or more computer processors of the computer system. This method and example embodiments disclosed herein may be embodied as instructions stored on a machine-readable medium that, when executed by one or more processors of a computer system, cause the computer system to perform one or more of the operations described herein.
The details of one or more variations of the subject matter described herein are set forth in the accompanying drawings and the description below. Other features and advantages of the subject matter described herein will be apparent from the description and drawings, and from the claims.
Turning specifically to the example enterprise application platform 112, web servers 124 and Application Program Interface (API) servers 125 can be coupled to, and provide web and programmatic interfaces to, application servers 126. The application servers 126 can be, in turn, coupled to one or more database servers 128 that facilitate access to one or more databases 130. The cross-functional services 132 can include relational database modules to provide support services for access to the database(s) 130, which includes a user interface library 136. The web servers 124, API servers 125, application servers 126, and database servers 128 can host cross-functional services 132. The application servers 126 can further host domain applications 134.
The cross-functional services 132 provide services to users and processes that utilize the enterprise application platform 112. For instance, the cross-functional services 132 can provide portal services (e.g., web services), database services and connectivity to the domain applications 134 for users that operate the client machine 116, the client/server machine 117 and the small device client machine 122. In addition, the cross-functional services 132 can provide an environment for delivering enhancements to existing applications and for integrating third-party and legacy applications with existing cross-functional services 132 and domain applications 134. Further, while the system 100 shown in
The enterprise application platform 112 can improve (e.g., increase) accessibility of data across different environments of a computer system architecture. For example, the enterprise application platform 112 can effectively and efficiently enable a user to use real data created from use by one or more end users of a deployed instance of a software solution in a production environment when testing an instance of the software solution in the development environment. The enterprise application platform 112 is described in greater detail below in conjunction with
The portal modules 140 can enable a single point of access to other cross-functional services 132 and domain applications 134 for the client machine 116, the small device client machine 122, and the client/server machine 117. The portal modules 140 can be utilized to process, author and maintain web pages that present content (e.g., user interface elements and navigational controls) to the user. In addition, the portal modules 140 can enable user roles, a construct that associates a role with a specialized environment that is utilized by a user to execute tasks, utilize services and exchange information with other users and within a defined scope. For example, the role can determine the content that is available to the user and the activities that the user can perform. The portal modules 140 include a generation module, a communication module, a receiving module and a regenerating module. In addition, the portal modules 140 can comply with web services standards and/or utilize a variety of Internet technologies including Java, J2EE, SAP's Advanced Business Application Programming Language (ABAP) and Web Dynpro, XML, JCA, JAAS, X.509, LDAP, WSDL, WSRR, SOAP, UDDI and Microsoft .NET.
The relational database modules 142 can provide support services for access to the database(s) 130, which includes a user interface library 136. The relational database modules 142 can provide support for object relational mapping, database independence and distributed computing. The relational database modules 142 can be utilized to add, delete, update and manage database elements. In addition, the relational database modules 142 can comply with database standards and/or utilize a variety of database technologies including SQL, SQLDBC, Oracle, MySQL, Unicode, JDBC, or the like.
The connector and messaging modules 144 can enable communication across different types of messaging systems that are utilized by the cross-functional services 132 and the domain applications 134 by providing a common messaging application processing interface. The connector and messaging modules 144 can enable asynchronous communication on the enterprise application platform 112.
The API modules 146 can enable the development of service-based applications by exposing an interface to existing and new applications as services. Repositories can be included in the platform as a central place to find available services when building applications.
The development modules 148 can provide a development environment for the addition, integration, updating and extension of software components on the enterprise application platform 112 without impacting existing cross-functional services 132 and domain applications 134.
Turning to the domain applications 134, the customer relationship management application 150 can enable access to and can facilitate collecting and storing of relevant personalized information from multiple data sources and business processes. Enterprise personnel that are tasked with developing a buyer into a long-term customer can utilize the customer relationship management applications 150 to provide assistance to the buyer throughout a customer engagement cycle.
Enterprise personnel can utilize the financial applications 152 and business processes to track and control financial transactions within the enterprise application platform 112. The financial applications 152 can facilitate the execution of operational, analytical and collaborative tasks that are associated with financial management. Specifically, the financial applications 152 can enable the performance of tasks related to financial accountability, planning, forecasting, and managing the cost of finance.
The human resource applications 154 can be utilized by enterprise personnel and business processes to manage, deploy, and track enterprise personnel. Specifically, the human resource applications 154 can enable the analysis of human resource issues and facilitate human resource decisions based on real time information.
The product life cycle management applications 156 can enable the management of a product throughout the life cycle of the product. For example, the product life cycle management applications 156 can enable collaborative engineering, custom product development, project management, asset management and quality management among business partners.
The supply chain management applications 158 can enable monitoring of performances that are observed in supply chains. The supply chain management applications 158 can facilitate adherence to production plans and on-time delivery of products and services.
The third-party applications 160, as well as legacy applications 162, can be integrated with domain applications 134 and utilize cross-functional services 132 on the enterprise application platform 112.
JMeter 406 may include a docker file, such as the file depicted in
In cloud ERP under MSA, contracts pertaining to asynchronous messages may have one or more preconditions. In the product update example, when a product is created, updated, or deleted, the provider service will generate and transmit a message that describes this change. The receiver side will receive this message and propagate the related change to the front-end side. So, in this scenario, the contract between backend and frontend includes the following: when a product is created, then generate a product creation message. In this contract, “create product” is a precondition of the “product creation message.”
In the pseudo-code listing, “messages” is an array of messages definition. “Precondition” is a precondition of message generated, which can be empty. In this example, when a product is created, a message having a defined contents list is generated. “Contents” specifies the message body contents. In example embodiments, it is not the full message content; instead, it is only a part of the message that interests the consumer. For example, if the consumer side only cares about unit of measurement (uom) related information, it is okay to only list uom information in the message content. “Matchingrules” are rules used to match types of values specified in the message (e.g., for compatibility with third party tools). For example, in some scenarios, the consumer service may not care about a specific value or property in the message; instead, it may only care about type of value or property.
From a development process view, there may be source code branches corresponding to different development phases. For example, a “develop” branch may represent a major development phase; a “release” branch may represent a stabilization phase; a “master” branch may represent an online phase; a “hotfix” branch may represent minor changes between major releases; a “feature” branch may represent feature development. Each different branch may be associated with a different contract. Branch information may be added to the central server.
To verify an asynchronous message efficiently, the disclosed solution also involves performing one or more steps on the provider side. First, basic master data is prepared in a test tenant template. For example, a cloud ERP system may have two categories data. One is master data; another is for transaction data. Based on business domain logic, when a user does some transactions, such as, for example, creating a Sales Order, some predefined master data like product, customer, tax code, and so on, may be needed. That means that, in order to test a Sales Order related feature, many basic master data items may need to be prepared or created, which can be a time-consuming task.
To solve this issue, some template tenants are predefined. These template tenants may include some basic master data items, like product, customer, tax code, channel, and so on. Therefore, when testing is performed, tenant data may be restored from the predefined template, which prevents the need to create an empty tenant and then add basic data items one by one.
Second, a message contract may be retrieved from a central server. As discussed above, this message contract may be generated by a consumer service and placed on the central server (e.g., in one or more repository branches). The provider service will download the contract from the current branch's files, such as the branch corresponding to the current development state of interest.
Third, one or more new message queues are declared or created. These message queues are used instead of existing message queues in order to avoid affecting an origin system. The routing key is defined in the message contract. In example embodiments, the message change queue is topic based, so a new queue can be added with the same routing key without affecting the original queue.
Fourth, an API is called to generate an expected message. For example, in MSA, a message may be triggered when an event happens. This event may be an API call or another event. For example, to generate a production creation event, a product.create API may be called either by an end user or a batch import. The message contract may specify one or more property preconditions. Some precondition API calls such as product. create, product.update; SalesOrder.Create may be considered standard processes. For a simple case, if the message's precondition comes from these standard processes, the standard APIs are called directly. However, if these standard APIs can't satisfy a message's precondition, APIs may be written on demand.
Fifth, a message may be received from the previously-created message queue and stored in a local store (e.g., in an environment variable)
Sixth, the message may be verified based on the message contract. For example, a third-party tool or framework can do this check. For example, Pact may be used. As described above, a match rules section may be used to define the message such that it is compatible with such a third-party tool, allowing the third-party tool to be called directly to perform the verification.
Certain embodiments are described herein as including logic or a number of components, modules, or mechanisms. Modules may constitute either software modules (e.g., code embodied on a machine-readable medium or in a transmission signal) or hardware modules. A hardware module is a tangible unit capable of performing certain operations and may be configured or arranged in a certain manner. In example embodiments, one or more computer systems (e.g., a standalone, client, or server computer system) or one or more hardware modules of a computer system (e.g., a processor or a group of processors) may be configured by software (e.g., an application or application portion) as a hardware module that operates to perform certain operations as described herein.
In example embodiments, a hardware module may be implemented mechanically or electronically. For example, a hardware module may comprise dedicated circuitry or logic that is permanently configured (e.g., as a special-purpose processor, such as a field programmable gate array (FPGA) or an application-specific integrated circuit (ASIC)) to perform certain operations. A hardware module may also comprise programmable logic or circuitry (e.g., as encompassed within a general-purpose processor or other programmable processor) that is temporarily configured by software to perform certain operations. It will be appreciated that the decision to implement a hardware module mechanically, in dedicated and permanently configured circuitry, or in temporarily configured circuitry (e.g., configured by software) may be driven by cost and time considerations.
Accordingly, the term “hardware module” should be understood to encompass a tangible entity, be that an entity that is physically constructed, permanently configured (e.g., hardwired) or temporarily configured (e.g., programmed) to operate in a certain manner and/or to perform certain operations described herein. Considering embodiments in which hardware modules are temporarily configured (e.g., programmed), each of the hardware modules need not be configured or instantiated at any one instance in time. For example, where the hardware modules comprise a general-purpose processor configured using software, the general-purpose processor may be configured as respective different hardware modules at different times. Software may accordingly configure a processor, for example, to constitute a particular hardware module at one instance of time and to constitute a different hardware module at a different instance of time.
Hardware modules can provide information to, and receive information from, other hardware modules. Accordingly, the described hardware modules may be regarded as being communicatively coupled. Where multiple of such hardware modules exist contemporaneously, communications may be achieved through signal transmission (e.g., over appropriate circuits and buses that connect the hardware modules). In embodiments in which multiple hardware modules are configured or instantiated at different times, communications between such hardware modules may be achieved, for example, through the storage and retrieval of information in memory structures to which the multiple hardware modules have access. For example, one hardware module may perform an operation and store the output of that operation in a memory device to which it is communicatively coupled. A further hardware module may then, at a later time, access the memory device to retrieve and process the stored output. Hardware modules may also initiate communications with input or output devices and can operate on a resource (e.g., a collection of information).
The various operations of example methods described herein may be performed, at least partially, by one or more processors that are temporarily configured (e.g., by software) or permanently configured to perform the relevant operations. Whether temporarily or permanently configured, such processors may constitute processor-implemented modules that operate to perform one or more operations or functions. The modules referred to herein may, in some example embodiments, comprise processor-implemented modules.
Similarly, the methods described herein may be at least partially processor-implemented. For example, at least some of the operations of a method may be performed by one or more processors or processor-implemented modules. The performance of certain of the operations may be distributed among the one or more processors, not only residing within a single machine, but deployed across a number of machines. In some example embodiments, the processor or processors may be located in a single location (e.g., within a home environment, an office environment, or as a server farm), while in other embodiments the processors may be distributed across a number of locations.
The one or more processors may also operate to support performance of the relevant operations in a “cloud computing” environment or as a “software as a service” (SaaS). For example, at least some of the operations may be performed by a group of computers (as examples of machines including processors), these operations being accessible via a network (e.g., the network 102) and via one or more appropriate interfaces (e.g., APIs).
Example embodiments may be implemented in digital electronic circuitry, or in computer hardware, firmware, or software, or in combinations of them. Example embodiments may be implemented using a computer program product (e.g., a computer program tangibly embodied in an information carrier, in a machine-readable medium for execution by, or to control the operation of, data processing apparatus, such as a programmable processor, a computer, or multiple computers).
A computer program can be written in any form of programming language, including compiled or interpreted languages, and it can be deployed in any form, including as a stand-alone program or as a module, subroutine, or other unit suitable for use in a computing environment. A computer program can be deployed to be executed on one computer or on multiple computers at one site or distributed across multiple sites and interconnected by a communication network.
In example embodiments, operations may be performed by one or more programmable processors executing a computer program to perform functions by operating on input data and generating output. Method operations can also be performed by, and apparatus of example embodiments may be implemented as, special purpose logic circuitry (e.g., an FPGA or an ASIC).
The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. In embodiments deploying a programmable computing system, it will be appreciated that both hardware and software architectures merit consideration. Specifically, it will be appreciated that the choice of whether to implement certain functionality in permanently configured hardware (e.g., an ASIC), in temporarily configured hardware (e.g., a combination of software and a programmable processor), or in a combination of permanently and temporarily configured hardware may be a design choice.
The example computer system 1000 includes a processor 1002 (e.g., a central processing unit (CPU), a graphics processing unit (GPU), or both), a main memory 1004, and a static memory 1006, which communicate with each other via a bus 1008. The computer system 1000 may further include a video display unit 1010 (e.g., a liquid crystal display (LCD) or a cathode ray tube (CRT)). The computer system 1000 also includes an alphanumeric input device 1012 (e.g., a keyboard), a user interface (UI) navigation (or cursor control) device 1014 (e.g., a mouse), a storage unit 1016 (e.g., a disk drive unit), a signal generation device 1018 (e.g., a speaker), and a network interface device 1020.
The storage unit 1016 includes a machine-readable medium 1022 on which is stored one or more sets of instructions and data structures (e.g., software) 1024 embodying or utilized by any one or more of the methodologies or functions described herein. The instructions 1024 may also reside, completely or at least partially, within the main memory 1004 or within the processor 1002 during execution thereof by the computer system 1000, the main memory 1004 and the processor 1002 also constituting machine-readable media. The instructions 1024 may also reside, completely or at least partially, within the static memory 1006.
While the machine-readable medium 1022 is shown in an example embodiment to be a single medium, the term “machine-readable medium” may include a single medium or multiple media (e.g., a centralized or distributed database, and/or associated caches and servers) that store the one or more instructions or data structures. The term “machine-readable medium” shall also be taken to include any tangible medium that is capable of storing, encoding or carrying instructions for execution by the machine and that cause the machine to perform any one or more of the methodologies of the present embodiments, or that is capable of storing, encoding, or carrying data structures utilized by or associated with such instructions. The term “machine-readable medium” shall accordingly be taken to include, but not be limited to, solid-state memories and optical and magnetic media. Specific examples of machine-readable media include non-volatile memory, including by way of example semiconductor memory devices, e.g., Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), and flash memory devices; magnetic disks such as internal hard disks and removable disks; magneto-optical disks; and compact disc-read-only memory (CD-ROM) and digital versatile disc (or digital video disc) read-only memory (DVD-ROM) disks.
Furthermore, the machine-readable medium is non-transitory in that it does not embody a propagating signal. However, labeling the tangible machine-readable medium as “non-transitory” should not be construed to mean that the medium is incapable of movement—the medium should be considered as being transportable from one physical location to another. Additionally, since the machine-readable medium is tangible, the medium may be considered to be a machine-readable device.
The instructions 1024 may further be transmitted or received over a communications network 1026 using a transmission medium. The instructions 1024 may be transmitted using the network interface device 1020 and any one of a number of well-known transfer protocols (e.g., hypertext transfer protocol (HTTP)). Examples of communication networks include LANs, WANs, the Internet, mobile telephone networks, plain old telephone service (POTS) networks, and wireless data networks (e.g., WiFi and WiMax networks). The term “transmission medium” shall be taken to include any intangible medium capable of storing, encoding or carrying instructions for execution by the machine, and includes digital or analog communications signals or other intangible media to facilitate communication of such software. The network 1026 may be one of the networks 102.
Although an embodiment has been described with reference to specific example embodiments, it will be evident that various modifications and changes may be made to these embodiments without departing from the broader scope of the present disclosure. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense. The accompanying drawings that form a part hereof show by way of illustration, and not of limitation, specific embodiments in which the subject matter may be practiced. The embodiments illustrated are described in sufficient detail to enable those skilled in the art to practice the teachings disclosed herein. Other embodiments may be utilized and derived therefrom, such that structural and logical substitutions and changes may be made without departing from the scope of this disclosure. This Detailed Description, therefore, is not to be taken in a limiting sense, and the scope of example embodiments is defined only by the appended claims, along with the full range of equivalents to which such claims are entitled.
Such embodiments of the inventive subject matter may be referred to herein, individually and/or collectively, by the term “invention” merely for convenience and without intending to voluntarily limit the scope of this application to any single invention or inventive concept if more than one is in fact disclosed. Thus, although specific embodiments have been illustrated and described herein, it should be appreciated that any arrangement calculated to achieve the same purpose may be substituted for the specific embodiments shown. This disclosure is intended to cover any and all adaptations or variations of example embodiments. Combinations of the above embodiments, and other embodiments not specifically described herein, will be apparent to those of skill in the art upon reviewing the above description.
This application is a continuation of prior application Ser. No. 16/898,271, filed on Jun. 10, 2020, which is a continuation of prior application Ser. No. 16/202,901, filed on Nov. 28, 2018, which applications are incorporated by reference herein in their entirety.
Number | Name | Date | Kind |
---|---|---|---|
6606660 | Bowman-Amuah | Aug 2003 | B1 |
6850979 | Saulpaugh et al. | Feb 2005 | B1 |
7716492 | Saulpaugh | May 2010 | B1 |
7788674 | Siegenfeld | Aug 2010 | B1 |
9204240 | Musfeldt | Dec 2015 | B2 |
9479517 | Anand et al. | Oct 2016 | B2 |
10698798 | Liu | Jun 2020 | B2 |
10761913 | Mcclory et al. | Sep 2020 | B2 |
10956918 | Creedon | Mar 2021 | B1 |
11086763 | Liu | Aug 2021 | B2 |
11588653 | Wang | Feb 2023 | B2 |
11611537 | Hunt | Mar 2023 | B1 |
20030206192 | Chen | Nov 2003 | A1 |
20040267934 | Patiejunas | Dec 2004 | A1 |
20050080819 | Russell | Apr 2005 | A1 |
20060155894 | Pennington | Jul 2006 | A1 |
20080104258 | Oneill et al. | May 2008 | A1 |
20120221894 | Zhao | Aug 2012 | A1 |
20120265915 | Goldstein et al. | Oct 2012 | A1 |
20130160064 | van Rozen | Jun 2013 | A1 |
20160021181 | Ianakiev et al. | Jan 2016 | A1 |
20180020008 | Schoof | Jan 2018 | A1 |
20180314407 | Dinh | Nov 2018 | A1 |
20190089809 | Theebaprakasam | Mar 2019 | A1 |
20190149604 | Jahr | May 2019 | A1 |
20190155597 | Lander | May 2019 | A1 |
20190317776 | Walsh | Oct 2019 | A1 |
20200167267 | Liu | May 2020 | A1 |
20200334131 | Liu | Oct 2020 | A1 |
20220279004 | Erlingsson | Sep 2022 | A1 |
Number | Date | Country |
---|---|---|
101151934 | Mar 2008 | CN |
101197727 | Jun 2008 | CN |
102364921 | Feb 2012 | CN |
WO-2009114559 | Sep 2009 | WO |
Entry |
---|
Bakshi, “Microservices-Based Software Architecture and Approaches”, 2017, IEEE (Year: 2017). |
Betin-Can et al., “Modular Verification of Asynchronous Service Interactions Using Behavioral Interfaces”, Aug. 2011, IEEE (Year: 2011). |
Aalst et al., “Multiparty Contracts: Agreeing and Implementing Interorganizational Processes”, 2010, The computer Journal, vol. 53, No. 1 (Year: 2010). |
Ferrer-Gomila et al., “Optimality in Asynchronous Contract Signing Protocols”, 2004, Springer-Verlag Berlin Heidelberg (Year: 2004). |
“U.S. Appl. No. 16/202,901, Notice of Allowance dated Feb. 20, 2020”. |
“U.S. Appl. No. 16/898,271, Corrected Preliminary Amendment filed Jul. 14, 2020”, 6 pgs. |
“U.S. Appl. No. 16/898,271, Non Final Office Action dated Dec. 10, 2020”, 14 pgs. |
“U.S. Appl. No. 16/898,271, Notice of Allowance dated Apr. 6, 2021”, 10 pgs. |
“U.S. Appl. No. 16/898,271, Preliminary Amendment filed Jul. 10, 2020”, 6 pgs. |
“U.S. Appl. No. 16/898,271, Response filed Mar. 9, 2021 to Non Final Office Action dated Dec. 10, 2020”, 9 pgs. |
Cien, Lianping, et al., “Microservices: Architecting for Continuous Delivery and DevOps”, (2018), 8 pgs. |
Emmerich, Wofgang, “Software Engineering and Middleware: A Roadmap”, (2000), 12 pgs. |
Flieder, “Testing and Visualizing a Message Gueuing Infrastructure”, University of Applied Sciences, Graz, (2005), 7 pgs. |
Pham, “Building Continuous Delivery Pipeline for Microservices”, Helsinki Metropolia University of Applied Sciences, (May 2018), 68 pgs. |
Wamboko, “Development of a Scalable Microservice Architecture for Web Services using OS-level Virtualization”, University of Nairobi, (2016), 160 pgs. |
Number | Date | Country | |
---|---|---|---|
20210349810 A1 | Nov 2021 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 16898271 | Jun 2020 | US |
Child | 17381919 | US | |
Parent | 16202901 | Nov 2018 | US |
Child | 16898271 | US |