Monday, September 12, 2016

Conclusion: Agile & ERP, part 5

The story so far…

  1. Agile & ERP?
  2. The Good News about Agile & ERP
  3. ERP Culture v. Agile Culture
  4. Th Bad News about Agile & ERP        5.        

Where does this leave us?

For a modern software developer, who understand agile and is well versed in the current ways of working encountering an ERP system is like stepping back 20 or perhaps 30 years.

The mindset of in ERP is more akin to the software development mindset when I started working in IT. It is as if the last 20 years have passed them by - the technology is dated, the agile revolution hasn’t happened, users should be grateful for what they are given and the vendor is all powerful.

The deal with ERP is: the ERP system does so very much, why reinvent the wheel? Writing software is expensive (and fraught with failure) so why not use one we made earlier?

It’s the software reuse argument written BIG.

The downside is: the ERP is all encompassing, you need to use particular technologies and these technologies haven’t really advanced in 20 years. The skills are in short supply. Most importantly: all the ways we have found to make software development more effective are absent.

Let us be very clear: there are massive benefits from using an off-the-shelf system. ERP systems are big, really big, and complex, general ledgers, multi-country/multi-currency payroll, etc. etc. Why would you want to rebuild this stuff?

But: there are also massive costs.

The ultimate question is: are the benefits greater than the costs?

Its worth repeating what Capers Jones says at this point:

“As a rule of thumb, if COTS [Common Of The Shelf] packages require modification by more than 25% it may be less expensive in the long run to build the same kind of application.” Applied Software Measurement, Jones, 2008

Unfortunately he doesn’t elaborate on how the 25% is calculated, he probably means function points. He continues:

“Package modification is a high-risk activity with a significant chance of failure and disaster. Not only is productivity normally low for modifying purchased packages, but if the vendors are reluctant to provide support, modification can easily be more expensive than customer development.” Applied Software Measurement, Jones, 2008

When answering this question please remember licenses for ERP systems are far from cheap, and they reoccure. Plus, vendors may well charge extra fees to support parts of the system which have been changed or to ensure backward compatibility.

Once installed clients can be very, very, reluctant to update ERP system. This is hardly surprising once you realise that “configuring” a system like SAP may mean having developers change SAP code in the base system. If SAP release a new version they may have changed that code, you are lucky if you can get away with a merge from hell.

When you buy an ERP system you buy an existing legacy system. You then attempt to configure it to be your legacy system. (See my Peugeot post.)

This sounds like a bad deal but its a deal that makes sense for a lot of companies and has done for 20 or 30 years.

Now, here is my conclusion:

20 years ago buying a legacy ERP system and configuring it to be your own legacy may well have made financial sense.

But in the last 20 years technology has advanced, not just the CPUs but the programming languages, the programming tools and even the programming processes.

Buying a legacy ERP system today means buying into a legacy development process with legacy tools. You step back 20 years.

In the last 20 years the tools and techniques have got a lot better. While buying an ERP system may look like a sensible decision you also shackle yourself to 20 year old tools and processes.

The tools and processes have improved so much in the last 20 years that the equation has changed. Modern approaches (i.e. agile and test driven) using modern technology means the cost and time gap between a) developing your own system using modern techniques (including microservices, existing libraries, open source, etc.) and b) choosing legacy ERP system (reoccuring license fees plus configuration costs) is far smaller than it was.

I conjecture that the gap is getting smaller as we speak.

Since ERP systems last decades the 20 year old ERP system you are buying today might be expected to last another 20 years. Who knows how much better things will get in two decades.

This also means there is a market opportunity for “modern ERP” systems which use modern technologies (Java, JavaScript, Micro-services, etc.) to support modern working practices. Microsoft, Oracle and SAP are all trying to move forward but the legacy is very profitable.

Finally, one might ask: given all these problems, and the changes in technology why do companies buy these systems?

Nobody ever asked my opinion on this so I can’t really say but let me float an idea.

Only companies of a certain size, say $1 billion revenue can afford these systems. When a company reaches that size they are expected to buy such a system - having an expensive system is a sign that your company has arrived.

These systems are driven by the finance departments, the CFO. As companies get big they need such systems to control the company. But also, the CFO of a $1bn company wouldn’t look serious if he didn’t have one - after all, all the other $1bn companies have an ERP system so why not yours?

If you are the CFO of a $1bn company without an ERP system and something goes wrong it will look irresponsible. Having an expensive ERP system allows the CFO to say “We followed best practice and bought Oracle”. It reduces the risk of the CFO losing their job.

And buying an ERP system allows the CFO to claim more resources for his department.

And it allows the CFO to say at his next job interview “I introduced an ERP system to a $1bn company.”

So the next time you get appointed CFO of a company which as just broken the $1bn revenue barrier and you find there is no ERP system in place what are you going to do?

Engineers might think: I’ll set up a small team and start growing our own ERP system using modern technology.

To the engineering mind that approach stands the best chance of working and is financially the best route.

But it is also high risk simply because nobody else does it.

Everyone else says: “I’ll call SAP, I’ll spend a lot of money with them, Accenture, Cap-Gemini and CSC. When it goes wrong I can blame them. After all, thats what everyone else does so doing anything different would be high risk.”

Friday, September 09, 2016

The Bad News: Agile & ERP, part 4

The story so far…

In this mini-series I’m discussing Agile development on ERP systems. If you are doing this and you’ve just Googled “Agile and ERP” there is a good chance you’ve found this blog because… bad news… there isn’t a lot of experience of doing Agile in an ERP environment.

Sure people have done it, sure some people have written about it in blog and journals but I said: “some”. Some means “not many”. One of the problems of doing Agile in an ERP setting is that there is a lack of knowledge and experience. People have done this, I’ve “done” it several times myself but… not as many people have done Agile in ERP as have done, say, Agile in Java Banking or some other domain. And very few of them have written their experience up. And even fewer have good stories to tell.

Partly it comes down to a question of “What do you mean by Agile?”. Sure you can do Agile in ERP if you define “Agile” as those “agile” practices which work in the ERP setting. On the other hand, when you do find the examples that are out there you will find many practices missing, specifically the technical practices.

Almost all the reports of Agile in ERP you will find are about process - much like my previous post . Doing ERP with test driven development, acceptance test driven development, simple design, emergent design and refactoring is almost unheard of.

Sure there are a few blogs out there which discuss it a bit but there is not much. I briefed a recruiter to find someone with (A)TDD and ERP experience. He came back a couple of weeks later and said “Its like looking for Unicorns, these people don’t exist.”

In part this is because ERP systems are sold on the promise of EVERYTHING. Their design dates back decades so they are monolithic and the culture that surrounds them is 20 or 30 years behind the current thinking.

My most recent run at this problem was the best yet but here is the bad news: with an ERP system once you move away from the Agile processes practices and start to look at the Agile technical practices things get very difficult.

The cultural problems (corporate IT and ERP specific) don’t help but the technology is the major obstacle. Lets start with testing…

Some test frameworks do exist (e.g. ABAP Unit and X++ Unit) but they are limited and, as with other languages, only a fraction of developers use them, and only a few of them do it properly.

One of the problems is an old one: Mocking and Stubbing. But in an ERP system the Mocking and Stubbing problems are far far worse because the system is provides so much already you need to do more mocking, the system is pervasive, there is just more system to mocks and stub.

Since ABAP is effectively Cobol you can forget reflection, annotation and polymorphic substitution. Heck, I don’t think it even supports macros!

Part of this problem is because of the architecture of ERP systems. The architecture is decades old, its decidedly not Object Oriented, as closer to working in embedded C than Java.

Another problem is because of lot of the system isn’t programmed in text. Remember I said some of the programming was table based? And some was pointy-clicky? That stuff is super difficult to test because it exists in a different paradigm. In some cases even when the “configuration” exists as a code like fragment it is considered data by the system and cannot be extracted.

In once case we exported “the code” only to find it wasn’t coded in ASCII. And if you’ve exported it you might not be able to import it again.

The designers of these systems actually expect their production code to be changed, tinkered with, messed with, hacked, by those configuring the system. Let me repeat: production code from the vendor may be changed as part of a configuration effort. Imagine that when you wanted to write a macro in Microsoft Word VBA you were allowed access to the underlying Microsoft Word code.

These systems are the exact opposite of what John Vlassides would advocate:

"the hallmark of good code is that it is changed by adding to it, not hacking it" John Vlassides, The C++ Report

Changing code by adding to it is a new idea in the ERP world, both for those “configuring” it and those building the product.

But the problems of Automated Unit Testing TDD pale into insignificance when compared to the problems of doing automated Acceptance Test Driven Development (ATDD).

Because ERP systems are monoliths it is hard, if not impossible, to find a way in to add ATDD style tests. These systems don’t just predate microservices they predate components, COM, CORBA, DLLs, shared libraries and even static libraries.

I’ve seen automated test tools work at the highest level, the UI level. I’ve heard Quick Test Pro can run against the UI on Windows interfaces and I’ve seen Selenium run against a Microsoft front end, I’ve even seen Selenium execute a Given-When-Then test but…

This is all at the UI level.

It seems impossible to set up tests anywhere between the very lowest level and the very highest.

If you are lucky the ERP system exposes some services or interfaces you can connect to, for example Rocket U-2 lets .NET code connect to it in places. But such interfaces are not always there, or if they are they are undocumented and subject to change. So most higher level testing needs to be at the UI level….

Since its at the UI level the tests are slow, fragile, slow, difficult to create in advance and slow; the whole system needs to brought up to run them so if something is found its a big pond to fish in.

Since the whole system is being powered up for a test you need test data and this is a problem. If you are very lucky you might be able to get to a relational database and insert your own data, if you are unlucky you won’t be able to access the database or you’ll find its an old propriety hierarchical database and you will need to load lots of data.

And did I mention its slow?

It is not just ATDD tests which are slow the build is slow too. Hours not minutes.

Building might not be much like you know it, I once had to explain source code control to an SAP team. Because all configuration is considered “data” the very idea of source code control can be strange - you are dependent on the vendor actually supporting source control which at one point SAP did not.

Sometimes actually saving “configuration” and loading it into another instance of the system isn’t supported to start with. You may need to build that plumbing.

And remember, these ideas may be completely foreign to the people “configuring” the system. These people are HR or supply chain experts who happened to pick up a bit of ERP and found it pays well. They don’t understand many software engineering concepts, they may not particularly want to learn them and their employers may not want them to either.

As I said before: these systems are large monoliths.

Many of the tools and techniques which software developers have created to manage large systems, to modularise them, to control them, to isolate parts of them, to allow change at different rates are simply absent. ERP systems are not just monoliths the are monopolies, they are intended to form the central nervous system of an organization and run the organization, they are a single thing.

That is their nature, their culture, their technology, even their raison d'ĂȘtre.

That might seem strong but think about it… Senior managers buy these systems to provide insight and control over large organizations. They want the large organization to function as a single entity, they don’t want duplication, they don’t want variation, they want a monolith and that is what the ERP sales people sell them.

So while you might be able to bring some Agile to ERP implementation there is a very deep seated conflict between the agile means and the decidedly non-agile end.

Thursday, September 08, 2016

Culture problems: Agile & ERP part 3

I suggested some cultural problems with software development in an ERP setting in my second post on Agile and ERP, this time I want to look more closely at the differences in the two cultures.

Many of the cultural issues revolved around the fact that ERP tends to happen in a corporate IT environment, and since corporate IT is a more challenging place to develop software anyway an ERP system is going to have “the usual” corporate IT problems.

However ERP systems seem to be prone to even more cultural problems.

I’ve already said that ERP systems are monoliths, and I’ve also hinted at the fact that they are hierarchical in nature. In part this is a historical hang over, they come from the Cobol mainframe world when systems were written like that.

If you know Conway’s Law what I am about to say is obvious: organizations developing, sorry, configuring, ERP systems are themselves hierarchal and monolithic. Separating the HR development from the Logistics development is hard.

This is actually a great example of Reverse Conway’s law (sometimes called Yawnoc): the organization is a copy of the system architecture.

When an organization buys an ERP system they buy a large, monolithic, hierarchal system, the investment (financial and personal) required from senior managers mean the homomorphic force is strong. Therefore the organization which engages with the system becomes a copy of the system - reverse Conway’s.

(On the bright side, since these systems are designed to serve yesterdays needs using technology based on yesterday’s paradigms there should be an opportunity to disrupt this model - but that is another topic for another day.)

Lets talk about some details…

The first problem hits you right out of the box, literally.

An ERP system is sold and marketed as an application which does not require programming, it only requires configuration. Take careful not of that word: configuration, not even customisation and certainly not programming. This is very sophisticated marketing.

ERP systems cost millions of dollars to buy and operate them. Very few technical people will ever have a say in the purchase of such a system. The sales people deliberately talk of such systems being configured (without programming) in order to say to the buyers “Look you don’t need any pesky (expensive) programmers.”

Instead they plant the idea that you install SAP, go to the tools menu, select options, choose the right tab, click on the box and … et voila! — the system is configured. OK, its a big system so it needs a “lot” of configuration but you get the idea.

This isn’t so.

The kind of configuration required by ERP system is far more akin to programming than any ERP seller would ever admit. It might not be the kind of programming recognisable to a Java developer but it is programming in a different paradigm.

Sometimes it is table based programming - a kind of predicate Prolog rules system.

Sometimes it is lots of parameters - think .ini or XML files but probably in some arcade syntax.

Sometimes it is quite literally lots of pointing and clicking.

And sometimes it is actual coding, usually in the systems only language, SAP uses a Cobol like language called ABAP while Microsoft Dynamics uses Frankenstein version of C++ called X++.

Note also, that because just about every ERP system I know of is actually an assembly of multiple different products built by different companies at different times and smashed together by the current vendor you are likely find all these approaches and multiple languages on the inside.

The first big problem to overcome when faced with an ERP system can be simply convincing people that programming is required. Or rather, that the kind of rules and thinking which apply to major programming efforts need to be taken here.

That programming is required is provable because there are always Testers. If configuration really was straight forward no testing would be required. Since ERP systems are always tested that which is called “configuration” is clearly more than tools, options, click. Clearly there is the possibility that two different pieces of “configuration” interact in unexpected ways.

Because ERP systems emphasis the business functionality and disclaim programming they claim to be configurable by practitioners, e.g. accountants, HR professionals, logistic experts. etc. Indeed you probably need to have domain skills to configure it but you also need technical skills.

Thus the people doing the “configuration” do not see themselves as programmers. They rarely have a programming background, concepts like cohesion, coupling, separation of concerns, interfaces, etc. are foreign to them and they wouldn’t know dependency inversion if it is turned them upside down - or any other pattern for that matter.

It is not that these people are stupid, actually they are experts in their own fields; rather because they do not believe they are programmers they take little interest in software engineering concepts. And since their education was in their expert field (logistics, accountancy, human resources, etc.) they they never learned these concepts at school.

Unfortunately when you program a big system, a big anything, having software engineering knowledge really helps - that is why the discipline came into being.

Worse than this, because the “no programming required” concept is encouraged by the vendors the programming systems inside the ERP systems also lack modern software engineering concepts. Remember: ABAP is Cobol, Cobol is not a modern language.

Like Cobol, ERP languages such as ABAP and X++ have a “commercial orientation” and lack the idioms required for engineering. On one ERP implementation I came to feel the whole thing was just Visual Basic on steroids - and VB6 at that! Such languages are Turning complete so you can do (in theory) do everything but somethings these things are damn hard.

The ERP culture creates other problems too.

There is no OpenSource for ERP. Nobody ever went home at night and wrote ABAP for release under the GNU license. As a consequence the kind of tools modern software engineers expect do not exist.

While ABAP-Unit and X++Unit exists they are not as widespread or as usable as JUnit.

Nor will you find Stackoverflow full of ABAP or X++ questions and answers. Sure there are a few but only fraction of what you will find for Python. To be fair, the number of ABAP or X++ programmers is only a fraction of Python, C# or Java programmers anyway so while some public resources exist there are tiny.

Many ERP “developers” work for system integrators (CapGemini, Accenture and countless small shops). They charge high rates for their people and take a very fluid approach to staffing. For example, an SAP HR “consultant” on a team I was working with had a two week holiday. The consultancy company sent another consultant to fill in for the two weeks she was away. I find it hard to believe the stand-in consultant could usefully do anything for the client in that time but by being there they could bill time for the system integrator.

A side effect of this is that the consultants are often in high demand, they may work on multiple client projects at once, and they are internationally mobile, they get lots of frequent flyer points.

This has some very practical limitations, these people may not devote 100% of their headspace to the client and getting a standup meeting to start early or at a regular time is hard it may depend on Heathrow congestion.

And because they work for someone else the client and the consultancy may not agree on who pays for any Agile training or workshops. I’ve found myself giving Agile workshops to client staff where the ERP consultants are excluded because they work for a supplier. Even when the client hires the staff directly, or the client and supplier agree, the ERP Consultants may resist learning about Agile, and especially technical considerations, because they do not consider themselves technical!

And when the ERP consultants do engage its is like stepping back 10 or 15 years, all the “old” arguments appear: “how can we do something in 2 week?”, “we must design the whole”, “the business must fix its requirements”, etc. etc.

In the next instalment we’ll turn to the bad news, the technology…

Wednesday, September 07, 2016

The Good News - Agile & ERP, part 2

First the good news: there is a lot of Agile practices which work just fine in an ERP environment. These are mostly the process practices and some from the demand side (i.e. requirements, “what are we going to build”).

All of the following work just fine and will improve work of teams in ERP:

  • Stand-up meetings work just fine, but stand-up meetings alone do not make a team Agile.
  • Iterations (Sprints) work just fine; and that includes starting them with a planning meeting and ending them with a retrospective. (You can do estimation with planning poker if you like, I’ve no evidence that it is accurate in this environment but it might be effective at persuading people you are taking estimates seriously.)
  • Visual boards work just fine and will improve work.
  • User Stories, i.e. small pieces of business valuable work, are fine; you can also use Epics and Tasks too, and you can do Xanpan style urgent-but-unplanned work too.
  • Defining acceptance criteria (conditions of satisfaction) works too.
  • Pushing authority down, encouraging teams to take on more responsibility is all good too. But note: ERP and big company culture make this a challenge
  • Agile Coaching works just fine too.
  • Product Owners work; and as usual in a corporate you will probably find a Business Analyst filling the role day to day. However, ERP culture is document centric and added together with authority problems means POs might not have, or at least feel they do not have, the authority to make decisions.
  • As always co-located teams work best, pair programming and mob programming work fine too.

Some practices are always more difficult, perhaps in ERP they are more difficult.

Identifying and delivering small, thin, slices of business functionality works, almost. Two problems appear. First because the nature of ERP systems is all encompassing business representatives are even more resistant than usual to accepting anything less than everything. Second, architecturally ERP systems do not lend themselves to working on things piecemeal. You can do some of this but its even more difficult than usual.

Emergent design is hard, largely because refactoring is still a new idea, the tools, techniques and most importantly mindset and understanding for incremental, evolutionary, organic style growth are not there. Therefore all the old arguments about “we must design the big picture” are very much in play.

Multi-skilled individuals and cross-functional teams: as with “normal” software development getting people to work outside their core skill-set helps smooth the flow of work; and as with normal software development there are limits to this both because of the learning curves involved and because of individual preferences and identity questions.

With ERP systems these issues seem to be more difficult partly because the skills involved in ERP work are even more different and - to preview something I will say later - there are greater cultural issues. Many ERP developers come from domains other that software engineering and therefore lack some of the basic understanding that one might expected of them.

Secondly, because ERP is normally done inside a corporate environment people are more conscious of their defined roles. In typical software companies individuals are more prepared to try doing something different because the aim is to ship a something. In all corporate environments people are more prone to limit themselves to their defined job roles and titles.

Corporate environments typically bring another problem too. Not in every case, but in the majority of cases, the quality (depth of skills, ability to learn fast, and such) of people inside corporate IT tends to be lower than that in specialist software development organizations. I tend to believe this is more a function of the organization than the individuals and it is not true in every case but it certainly seems that good technologists tend to gravitate towards specialist organizations.

This might be a function of recruitment practices, it might be a function of expenditure on training and skills, it might be a function of corporate mission, it may well be a function of the corporate environment or the specialist development environment, or something else altogether.

And because the corporate environment limits the teams ability to resolve impediments. Implementing a commitment model is extraordinarily difficult. This doesn’t worry me much because I’m not a keen fan of the commitment model anyway - see my Commitment Considered Harmful post.

The net result is: ERP teams don’t have as many high performing environment or individuals and teams as a specialist IT shop. (Obviously those two things go hand in hand but unravelling cause and effect is hard.)

And thats the good news, the next post will discuss culture before I turn to the bad news.

Tuesday, September 06, 2016

Agile & ERP? - part 1

This is the first of several blog posts about working in an Agile way with ERP systems…

Most of the developers, testers, BAs and managers I know have little, if any, awareness of ERP: Enterprise Resource Planning. The big software systems sold by SAP in particular but also by Oracle, Microsoft and others.

Strictly speaking ERP is a specific application for planning and scheduling resources usually in manufacturing, but many in the industry use the term “ERP” is used as a generic shorthand for a whole host of large enterprise applications beside strict ERP: CRM (customer relationship management), financial accounting, payroll, human resources, asset management, logistics and supply chain management, and more.

Over time the big players tend to have swallowed the more successful ones, so Oracle now owns JD Edwards and Peoplesoft, Microsoft swallowed Great Plains and Navision, The products tend get recycled… but I digress.

While most developers can happily spend their entire career avoiding these packages those that encounter them find two things. Firstly they very pay well, exceptionally well in some cases. Second these systems are all embracing: the database is probably hidden well down, it may well be hierarchical rather than relational; they usually come with their own language, SAP has ABAP and Microsoft X++

Over the years I’ve touched a few of these systems, some of the big names, some of the smaller names, some of the “modern” systems and some so old they predate the ERP classification - anyone for Rocket? Or Comet?

This year I’ve had an chance to work for an extended period with a team using Microsoft Dynamics and attempting Agile and I think its worth a few comments, partly about the state of “agile and ERP” but also about ERP in general.

In the next few blogs I’m going to say something about my experiences, I want to talk about the common issues with these systems, not specific problems of one team or another. Here are a few of the key-points:

  • Stepping into the ERP world from the Agile world is like stepping back 20 years, or maybe 30.
  • You can do Scrum in an ERP environment but it seems impossible to do XP, i.e. getting the technical practices to support your efforts does not seem possible.
  • Testing, automated testing is only possible in very limited amounts, its an uphill challenge.
  • Configuration is a form of programming but many people in the ERP space reject the idea that they are programming and therefore reject (or probably never knew) the engineering approaches that programmers (should) take.
  • Systems Analysts are alive and well in the ERP world: such analysts are rarely found in development teams any more, they role has fractured in two, some of the work has gone to Business Analysts and some to Architects and Senior Developers or just “the team”.
  • Release cycles are long and the monolithic nature of ERP systems means they resist attempts to reduce them. The monolithic nature bits these teams again and again.
  • Culture: the culture that surrounds ERP systems is the antithesis of Agile culture. In part this is because only large corporates have ERP systems; Agile can work in the large but it is more difficult, Agile can work in a corporate culture but it is more difficult, in ERP you start off down two and then you add ERP culture.

Reverse Conway’s Law means that the organizations which develop in ERP systems themselves take on the attributes of the system, namely they are hierarchical and monolithic.

ERP systems and Agile is a big topic and I’ve plenty to say so I’m going to blast out a series of blogs in the next couple of weeks, they are all drafted so watch this space:

(Update: having now published those posts I’ve updated these links.)