BPMS lesson learned

Testing BPMS component

In the first part of this series, we focused on a designing system using BPMS technology for orchestrating workflow in the organisation, then we shared useful points from the developers perspective. In this third part, we will focus on a quality aspect of the solution.
I do remember a discussion with one of our QA guys regarding BPMS testing I want to share. I was asking QA for requirements on a system and curious what methodology is being used for this component.  The answer I got and  I will probably never forget was: BPMS is a minor part of the system hence we are not supposed to test it at all. The motivation behind this article is simply based on fact that this approach wasn’t correct an provide some insight what’s going on. There is no ambition to provide a complete methodology or best practices regarding testing of BPMS component. That is the role of skilled QA.

BPMS at the core

As BPMS is a solution for orchestration of your business services inside the house. Simply it drives the workflow. BPMS isn’t usually a decision maker. Decision-making rules are typically required to be flexible, expect frequent changes. It should reflex business changes as quick as possible. So because of that, it is not a good practice to hard-code them into processes in a form of “spaghetti code structure” (structure of if-else in several levels) which is error-prone and hard to maintain. Those are reasons for having a separate component responsible for decision making – BRE (business rule engine). So the QA task can be divided into two main objectives for functional testing. Verify for given input data:
  • all the necessary data for making a decision present at the specified point? This can be difficult because of a large amount of incoming path to the decision point. Despite the execution path you are verifying that all the data needed were gathered in the system.
  • based on decision results are the steps actioned in the correct order? Verification of the required business process.
  • are the fault recovery procedures working correctly? Switching the system to fault recovery mode and verification that the system stored all data correctly and data completeness.
For sure there can be more aspects but those are considered as the main ones. The main problem of the testing is that those aspects cannot be tested in isolation. By isolation, I mean that you cannot use standard methodologies (e.g. black box, white box, … whatever it is) and point somewhere in the system. BPMS is a system component that has “memory”. That means you cannot simply arbitrarily divide the process into parts which are you going to test in separation. Some systems can have something like “point of synchronization” (despite the execution path the system has defined data set) but this depends on a design and hence it isn’t mandatory.
Let’s have a look at possibilities. The product itself offers the feature called BUnit what is alternative to JUnit in java world. It is feature facilitating process unit testing. All invoke activities within the process are mocked – the XML reply is recorded. XML manipulation expressions and gathering data within the flow ( aspect 1) can be tested this way by correct choice of recorded data. But the tests are still taking place in artificial conditions. Aspect 3 – testing fault recovery can be tested relatively easily by this approach if there is no awkward decision during the design phase. Test analyst is the key role in this process. No need to talk about documentation of the system itself. Unit testing of BRE is completely separate chapter not discussed here.
Having verified basic functionality of the blocks – processes and subprocesses we can continue with integration testing. Usually, this kind of systems are systems with high degree of integration so it is really handy to have all back-end systems under your control. The reason no. 1 – data-driven system – the behaviour of your data depends on a data in those systems. The reason no. 2 – BPMS has “memory” (it is “state-full”). If you wanna test from a certain point in the process you have to bring the system in this point. You need to do it repetitively and in a well-defined way. The approach used in web application testing – modification of data in DB to bring the order, application and etc. to a certain state is not sufficient here. Having simulators of real back-end systems was proved as really good practice. This way you simply isolate your system and time to error localization is significantly lower. This way you can conduct integration testing of bigger functional blocks up to end-to-end testing. There is no doubt that higher level of automation is a must.
This entry was posted in Uncategorized by jaksky. Bookmark the permalink.

1 thought on “BPMS lesson learned

  1. Pingback: BPMS in production environment | JVM & Software development

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s