Business Rules - a pain in the software application
About 3 months ago one of my colleagues started having severe back pain. Sometimes it would manifest itself as numbness in his hands. It virtually made him quit working diligently. He would ‘take off’ few hours in a stretch. He tried ’self medication’ in the form of some Yoga exercises.
About 15 days back he finally visited a good doctor- a general physician. The doctor asked him a few questions. Then he finally ‘referred’ him to an orthopedist.
Then this good friend of mine delayed visiting the orthopedist. The pain got worse and finally he did visit the orthopedist. The orthopedist had very few pointed questions. One question that he zeroed in on a typical day my friend lived through. When he woke up, how he slept, what kind of a profession he was in and questions like that. Then with a few tests he then prescribed a treatment(By this time you would have guessed that it was indeed a stress related injury). Along with the treatment came some changes that my friend had to adhere to. My friend had several followup visits where the doctor saw how the progress was.
Enough of Story telling
Now why this story you ask? It was a bit intriguing and here are some reasons why:
1. No doctor ever, zilch, called him saying you need treatment. I dont recall a doctor ever peddling his service.
2. Self medication never worked. The ailment required a doctor
3. Correct the statement above! The ailment required a specialist, actually.
4. The disease was there - it required a change in lifestyle.
Whats this got to business rules?
See the analogy - business rules form decisioning logic. And this decisioning logic is known to the experts - ‘business users’, ’subject matter experts’, ‘domain specialists’ or ‘business analysts’. Unfortunately - simply because it is ‘written’ in a programming language, it is deemed that the IT developer is the specialist.
The true specialist is never approached. At best he says: “the following is the change required”. There ends his role.
The true specialist never even diagonizes the reasons for the pain. He wont.
How do you handle business rules today?
Here are a sequence of steps in today’s software application:
You follow RUP (Rational Unified Process) or some form of process (maybe XP) - whatever.
You ‘collect’ requirements - potentially a program manager, functional expert or business analyst does storyboarding or writes use cases.
After these use cases are reasonably known - they are implemented using some standard software programming language.
Some amount of unit/integration testing takes place. Depending on your software process maturity you have rigorous unit test cases defined-all of them focussed on application code.
The process is iterative. Depending on your software maturity you include some sort of code review.
Finally it is ‘dispatched’ for User Acceptance Testing.
Users test the functionality.
The application is migrated to production from staging environments.
What is happening in this process?
In this process you:
1. Give no thought to managing your business logic. Oflate with the advent of N-Tier applications there has been an endeavour to atleast restrict this to some layer - but it is still no good.
2. Initiate User Acceptance Testing - users test functionality but not business logic. Its definitely not a thorough testing of business logic.
3. Code reviews are conducted. Usually the reviewers are some good developers. Care is taken to ensure that coding standards, comments and good design patterns are used.
4. You even review database design (if its a greenfield application).
5. There is no business logic or business rule review! How can it be done really! Business users just cannot review programming logic! Functional experts cannot see code and say if it is right or wrong.
I hope you understand where we are going. This is not a problem if the business rules are minimal & manageable. But it is a problem when you have a larger number - something greater than 30-50 business rules.
6 Symptoms You are Likely to Encounter
Symptom 1: “They cook strategies in months and expect IT to implement them in weeks!!” Familiar with that?
As far as your business goes - it IS a simple change. They just want to change a product, a plan - it is not an application change. It is the same old application. And why should it take so looooong.
Symptom 2: “They Laughed at me when I said it would take the next release”
Symptom 3: “Joe wrote this application, now where should i change this”
Symptom 4: “Quick, The Campaign has some Errors. Please Fix Them”
Symptom 5: “The Campaign Isnt What Marketing asked for. Now they want something different”
Symptom 6:”Its John Q Customer And He Wants To Know How We Billed Him The Amount On His Invoice”
5 Reasons Why the application will have a Pain that requires a Cure(and this doesnt include all the rest of the 50 others that have been seen).
Reason #1: Changes to Business Rules Simply Cannot Wait
Lets face it. Application changes involves functionality changes. Even simple Business Rules changes have profound impact. What do we mean by this statement? Take the example of a simple discount change - its got to happen at the right time, during christmass or a special campaign. It simply cannot wait.
How do current IT processes enforce such changes? By tagging such changes with application changes - by linking them to release cycles!. The standard story goes like this, lets have changes to the discount policy AND the new offer module in release 2.0. Now the whole ‘release’ cycle is a long process.
Reason #2: You CANNOT afford to have the Wrong Business Rules
Its the same logic. Even a small discount rule has profound effect.
Reason #3: The Business Rules MUST be inline with the Business Intent
Reason #4: If You Dont Test It, It is Bound to Be Wrong.
Reason #5: If you Dont Know How Something Was Arrived At, You Cannot Explain Why-not to your Customers, Not to Your Regulators and Not to Yourself
Will The True Expert Stand Up Please?
It should now come as no surprise. The real experts of business rules should at the very minimum be involved in the process of executing the change. Just initiating changes is not enough.