Monday, 19 August 2019

Twitter @java: Testing Microservices - Overview of 12 Useful Techniques - Part 1 with Liam Williams

Thanks to @java for the recognition by Tweeting Liam's and Wojciech's article!


"The combination of a microservice architectural style and container-based infrastructure requires a testing strategy that is compatible with this brave new world. A microservice architecture relies more on over-the-wire (remote) dependencies and less on in-process components, and your testing strategy and test environments need to adapt to these changes." - Wojciech Bulaty and Liam Williams for InfoQ

Read more: https://www.infoq.com/articles/twelve-testing-techniques-microservices-intro/

Trending article: 12 useful techniques when testing microservices

Liam and Wojciech's article "Testing Microservices: Overview of 12 Useful Techniques - Part 1" is trending at position 1 on InfoQ!


"When working with microservices, you have more options because microservices are deployed typically in environments that use containers like Docker. In microservice architectures, your teams are likely to use a wider variety of testing techniques. Also, since microservices communicate more over the wire, you need to test the impact of network connections more thoroughly. Using tools and techniques that better fit the new architecture can allow for faster time to market, less cost, and less risk." - Wojciech Bulaty and Liam Williams for InfoQ.

Read more: https://www.infoq.com/articles/twelve-testing-techniques-microservices-intro/

Saturday, 17 August 2019

Traffic Parrot 5.4.0 released, whats new?

We have just released version 5.4.0. Here is a list of the changes that came with the release:

Features

  • Added JMS REST API to count the number of requests made that match the given criteria using POST /api/jms/requests/count and reset the count using DELETE /api/jms/requests
  • See the OpenAPI documentation or import the Postman workspace for more information on the API usage

Fixes

  • Fixed usage of {{ anyNumber }} to match numbers within JSON string fields

Friday, 16 August 2019

Testing Microservices: Overview of 12 Useful Techniques - Part 1

"The combination of a microservice architectural style and container-based infrastructure requires a testing strategy that is compatible with this brave new world. A microservice architecture relies more on over-the-wire (remote) dependencies and less on in-process components, and your testing strategy and test environments need to adapt to these changes." - Wojciech Bulaty and Liam Williams for InfoQ 15th Aug 2019.

Liam and Wojciech have just published an article about testing microservices. A big thank you to the InfoQ editorial team, who were fantastic help getting this article ready.



Sunday, 11 August 2019

How multiple teams can use Traffic Parrot

“Is it possible to segregate a Traffic Parrot installation across multiple teams?” - Consultant Developer at a global software consultancy in Portugal.

It's a great question, and we hear it quite often, so we have decided it would be good to blog about it!
Start with exploring the "3 ways to deploy and share virtual services and API mocks".

If you want to use Diagram 3 deployment style which is where we recommend using Traffic Parrot, Diagram 3a below shows an example of how you could configure TP to be used by multiple teams:


Click to enlarge
On the left, you see a team responsible for the Legacy Banking Application. They used to have two environments DEV and QA that now connect to a Payment virtual service. They also have a CI build in Jenkins, and develop the application on their laptops. All of those environments use the same versioned virtual service artifact, that is used to spin up the Payment virtual service.
On the right, you can see another team in the same organisation but working in the new world of microservices. Developers and QAs are running developing and testing those microservices on their laptops, but they also have a GitLab pipeline setup. All of those laptops and the pipeline are running separate virtual services that are built from the source code and versioned in GIT source code.

Here is a sample workflow of how you can manage your API mocks as code to handle the distributed deployment and versioning of the API mock artifacts in the example above:


Click to enlarge
You can see a sample developer workflow, how to create the API mocks (virtual services), test them together with the microservice. The workflow ends in the developer checking in and pushing his changes to GIT. And then a GitLab pipeline picking up those changes and running the checks, publishing and deploying the artifacts.
Please keep in mind, these are only examples to demonstrate how our clients use Traffic Parrot, the details can differ and will be specific to every organization.

If you would like a recommendation of how to deploy the virtual services or API mocks specific to your project, please contact help@trafficparrot.com and we will be more than happy to assist you.

3 ways to deploy and share virtual services and API mocks

There are three common ways you can deploy and share your virtual services or API mocks.

The first one is where you reuse the same hardware and virtual service across many users, see Diagram 1.

What you see in Diagram 1 is an organisation that uses a DEV environment to deploy a Legacy Banking Application. That application needs to connect to, among many others, a payment service. The DEV environment is connected to a payment virtual service, that is running in a service virtualization tool deployed on a virtual machine. That same virtual service is shared with two more users (or agents if you wanna call them that). The Jenkins slave is running build jobs (pipelines) of that same Legacy Banking Application and connects to the shared Payment virtual services. We also have a QA that is testing a new microservice on her laptop, that requires connectivity to the Payment service, and she is using the same shared Payment virtual service.




The second one is where you reuse the same hardware but create a copy of virtual service per user, see Diagram 3. The three users/agents (DEV environment, Jenkins Slave and the QA) are using three copies of the same Payment virtual service, running on the same shared virtual machine.




The third option is where you use a copy of virtual service per-user, but deploy it per-use instead of using a shared environment, see Diagram 3. In this case, each user/agent uses a copy of the Payment virtual service that is for their exclusive use. So, the DEV environment is connected to a Payment virtual service running in Docker on OpenShift in the internal cloud. The Jenkins Slave is spinning up a Payment virtual services just before running the tests of the Legacy Banking Application. And, the QA is spinning up a Payment virtual services on her laptop.


Please keep in mind, these are only examples to demonstrate what our clients do, the details can differ and will be specific to every organization.

Traffic Parrot is not recommended in Diagram 1 and 2 style deployments

Firstly, if you want to do Diagram 1 or Diagram 2 shared deployment style, we recommend using other commercial service virtualization tools instead of Traffic Parrot. It is possible to use Traffic Parrot in those environments, but we do not recommend it.

Traffic Parrot is recommended in Diagram 3 style deployments

If you would like to use distributed deployment, similar to the one described in Diagram 3, we recommend using Traffic Parrot.
If you would like a recommendation of how to deploy the virtual services or API mocks specific to your project, please contact help@trafficparrot.com and we will be more than happy to assist you.

Tuesday, 6 August 2019

Traffic Parrot 5.3.1 released, whats new?

We have just released version 5.3.1. Here is a list of the changes that came with the release:

Features

  • New operating system specific release with bundled JRE:
    • Any operating system with no bundled JRE: trafficparrot-no-jre-5.3.1.zip
    • 64-bit Linux with bundled JRE: trafficparrot-linux-x64-jre-5.3.1.zip
    • 64-bit Mac with bundled JRE: trafficparrot-mac-x64-jre-5.3.1.zip
    • 64-bit Windows with bundled JRE: trafficparrot-windows-x64-jre-5.3.1.zip
    • 32-bit Windows with bundled JRE: trafficparrot-windows-x86-32-jre-5.3.1.zip
  • New state management REST API for global state:
    • Create or update state using PUT /api/state/global/{name}
    • Get state using GET /api/state/global/{name}
    • Reset all state using DELETE /api/state
    • See the OpenAPI documentation or import the Postman workspace for more information on the API usage
    • {{ manageState 'example' 'set' 1234 }} to set a variable in a response template
    • {{ manageState 'example' 'get' }} to get a variable in a response template

Tuesday, 23 July 2019

What can I do with Traffic Parrot?

"What can I do with Traffic Parrot? I am trying to simulate resource allocation scenario for fog computing. Can I simulate that using Traffic Parrot?" - a trafficparrot.com website visitor via the chat window.

Traffic Parrot is a service virtualisation and API mocking tool, which are two techniques from the test doubles family.

"Sometimes it is just plain hard to test the system under test because it depends on other components that cannot be used in the test environment. This could be because they aren't available, they will not return the results needed for the test or because executing them would have undesirable side effects. In other cases, our test strategy requires us to have more control or visibility of the internal behavior of the SUT."  - Test Double at XUnitPatterns.

For more information have a look at the tutorial: Getting started with stubbing, mocking and service virtualization.


Sunday, 21 July 2019

Traffic Parrot 5.2.0 released, whats new?

We have just released version 5.2.0. Here is a list of the changes that came with the release:

Features

  • WireMock 2.10.1 compatible REST API is now mounted on /api/http/* on the Traffic Parrot UI/API port (default 8080) for example POST /api/http/requests/count can be used to count requests
  • Added gRPC REST API to count the number of requests made that match the given criteria using POST /api/grpc/requests/count and reset the count using DELETE /api/grpc/requests
  • See the OpenAPI documentation or import the Postman workspace for more information.

Fixes

  • Fix scenarios dropdown UI on Windows browsers

Changes

  • Rename "request body" to "request message payload" in the gRPC UI

Sunday, 14 July 2019

Does Traffic Parrot support HTTP/2 (HTTP2)?

Not yet directly. Currently only via gRPC.

gRPC leverages HTTP/2 underneath and benefits from many of the efficiencies of HTTP/2. Traffic Parrot supports gRPC. Traffic Parrot does not support HTTP/2 directly yet, please reach out to us to have a look at the HTTP/2 beta version.

Monday, 8 July 2019

Traffic Parrot 5.1.0 released, whats new?

We have just released version 5.1.0. Here is a list of the changes that came with the release:

Features

  • gRPC improvements
    • Import gRPC proto files using the import button on the gRPC Add/Edit page
    • Convert OpenAPI files to gRPC proto files with openapi2proto using the import button on the gRPC Add/Edit page
    • Use the trafficparrot.virtualservice.grpc.openapi2proto.plugin.location property to configure the openapi2proto binary location, which can be either AUTO_DETECT (which searches the system environment path, go/bin directory and Traffic Parrot plugins directory) or a specific location
  • Configure HTTP proxy mappings on the HTTP Add/Edit page to allow routing some calls to the virtual service and some calls to real services
  • Added support for database queries in responses
    • New {{ databaseQuery }} helper
    • Configure JDBC connections in the database-connections.json file
    • Provide the JDBC driver JAR files for your database in the lib/external folder
  • Added support for default value when using {{ select }} to look up values in CSV files
  • Added support for the IBM®MQ Message ID as Correlation ID pattern

Fixes

  • When a property is missing from trafficparrot.properties we now report which key is missing in the logs
  • PDF files can now be correctly recorded and replayed as HTTP multipart/related attachments

Changes

  • Removed equal to matcher from gRPC edit mapping form (equal to JSON always makes more sense to use than equal to)
  • New toggle trafficparrot.virtualservice.grpc.message.field.naming to choose whether to define gRPC mappings using CAMEL_CASE field names or using the ORIGINAL field name case used in the proto files
  • Binary (non plain text) HTTP responses are now recorded in .bin files

Sunday, 16 June 2019

How to approach Traffic Parrot speed issues during load testing

We had one of our prospects reach out to us this week:

"I am stuck with my POC (Proof Of Concept project) on Traffic Parrot as I am facing out of memory issues at 30 TPS for 100 concurrent users for HTTP and IBM MQ JMS, please advise." -  Test Automation and Service Virtualization Consultant at an Australian Bank

Typically we advise starting by having a look at common approaches to speeding up Traffic Parrot for performance testing which is located here: https://trafficparrot.com/documentation/5.0.x/performance_testing.html

If the guidelines outlined there do not resolve the issue, please contact support@trafficparrot.com, and we will suggest how we can improve the performance of Traffic Parrot in your specific use case.

In this particular case increasing the memory from -Xmx128mb to -Xmx1g (Traffic Parrot JVM heap size increase from 128MB to 1GB) in jvm.args resolved the issue. The issue was that the request to response mappings used by the prospect were complex enough to require higher than standard use of memory for 100 concurrent users.

Saturday, 15 June 2019

Traffic Parrot 5.0.0 release, whats new?

We have released Traffic Parrot 5.0.0. Here is a list of what is included in the new release:

Features

  • New HTTP skeletons feature:
    • OpenAPI specifications are used to generate a list of HTTP skeletons that can be used to help design HTTP mappings in the Traffic Parrot user interface
    • Place OpenAPI specifications in the openapi configuration directory to populate the dropdown menu or use the upload button on the HTTP Add/Edit page next to the dropdown
    • This replaces the old scenarios.js dropdown, which has been removed (see changes section below for migration instructions)
  • Maven plugin improvements:
    • New trafficparrot:check-environment goal to run in the pre-clean phase to check nothing is preventing a successful start of Traffic Parrot
    • Check that there is not an existing Traffic Parrot instance running
    • Check for locked files or directories that are unable to be cleaned on Windows (typically this is because a file is open in a text editor or command prompt)
    • Improved speed when cacheDownload is enabled by also caching the extracted zip file
    • Accept either file:/// or file:// syntax when specifying file URLs
    • Remember to upgrade your plugin version to 5.0.0

Fixes

  • The randomInteger and randomDouble helpers now return a number type instead of a string, so that they can be combined with other helpers that require a number. For example when combined with the stringFormat helper: {{stringFormat '%02d:%02d' (randomInteger 0 59) (randomInteger 0 59)}}

Changes

  • The scenarios.js HTTP dropdown has been removed.
    • We recommend migrating to an OpenAPI specification file which can be used to produce a similar dropdown via the new HTTP skeletons functionality
    • Please email help@trafficparrot.com with your scenarios.js file and we will translate it to an OpenAPI file for you
    • Removed unused property trafficparrot.gui.scenarios.resource.name
  • Improved reporting of port clashes and how to change ports in trafficparrot.properties

I want to learn Service Virtualization

"I want to learn Service Virtualization for mocking. How can I do that?" - An anonymous trafficparrot.com website visitor.

We recommend looking at the Service Virtualization and API mocking tutorials available on our website, starting with Chapter 1: Getting started with stubbing, mocking and service virtualization and then Chapter 2: How to record and replay HTTP SOAP requests and responses to create API mocks.

If you would like to schedule a free 45-minute "Service Virtualization and API mocking" webinar for your company or your team, please reach out to contact@trafficparrot.com, and we will organise it at a time convenient to you and your team.

Wednesday, 12 June 2019

Do you have single user licenses?

Recently a website visitor asked:

"Do you have single user licenses?" - QA Lead at a Russell 3000 company, Pennsylvania.

Yes, we do support the single user scenario. For a single user, we have an option for a single floating license (only one instance allowed to be running at the same time).

If you are interested in single user licenses, we would be happy to provide a quote according to your requirements. Please contact sales@trafficparrot.com for more information.