Why is test automation easy to believe but difficult to implement?

Everybody today understands the need for test automation. However, there are many who started with automation but could not meet expectations or found later in the process that it is extremely difficult to implement. The question is why?

Why test automation is difficult to implement?

As far as I can say from my Agile Coach experience: In most cases, the problem lies not in implementing test automation but in implementing it in an effective and efficient way.

Start from the beginning

First of all implementing test automation is really easy if you start implementing it at the very beginning of your project. Sometime it might be extremely hard to implement automated tests in a legacy project. If you already have a lot of legacy code you need to work very hard on refactoring it and making it testable. You can read more about it in Michael Feathers book: “Working Effectively with Legacy Code”.

Test automation maintenance

Many of our clients struggle with the maintenance of test automation just after they developed the first scripts. So always think about maintenance costs and how will you “fix” your tests after your software will change (and it will change for sure). Use patterns like Page Object Pattern for web-based application (this pattern works great for almost any other kind of API).

Testing pyramid

Also test automation need to be whole IT department effort (not only test department). Don’t forget about Testing Pyramid. See my presentation from SQA Days about Reversed Test Pyramid – Testing and dealing with Legacy Code

Lack of knowledge

(…) I can list many reasons like that but…

Problems above start from a lack of knowledge about how to do testing automation properly. The answer to the main question in one sentence would be:
It is difficult to implement test automation because in most cases there is a lack of knowledge about how to do it well.