views:

153

answers:

3

Recently I read some articles about some doubts about benefits of acceptance testing, because it is quite costly compared to what it brings. To form my own opinion, I would like to gather as much benefits of automated acceptance testing as possible. Can you help me?

+3  A: 

What are the benefits of automating acceptance testing?

I am often a one man shop, so from my perspective the primary benefit is having machines do it instead of me.

Sky Sanders
How is learning testing framework, writing testing library and writing automated tests exactly easier than manually testing?I think the biggest problem is that acceptance tests are often run just once, am I right?
Gabriel Ščerbák
@Gabriel, Um... the learning is the hard part and unless you have rubber bumpers between your ears only needs to be done once. the rest is academic. And you have a valid point if you have and will only ever have one release of one product. If only I were so lucky.
Sky Sanders
@Gabriel - also, my definition of acceptance testing somewhat includes smoke testing and edges into functional testing so I may be lax my definition. what do i know, anyway? ;-)
Sky Sanders
I would not say that it is so academic - I need to have good architecture for automated tests and programmers or programming testers to write them, manual test can be done even by less qualified.But I really appreciate your point about future releases of the product, makes some things clear for me, thanks:)
Gabriel Ščerbák
+3  A: 

In general, automated testing makes sense under the condition that the total investment in setting up and maintaining the automated test for the life of the product is lower than the total investment in doing the manual test whenever needed for the life of the product.

Therefore, automated testing becomes more attractive if it is very cheap to create the test compared to running them manually (e.g., fit testing where you essentially create spreadsheets), or if there is going to be a large enough number of executions of the test to offset the cost difference.

Unit testing works well because there is a large enough number of executions - with every minor change or refactoring you want to make sure that there is no new failure.

Acceptance testing is dicier because the likelihood of repeated execution changes significantly from project to project, and business needs affect long-term support and maintenance issues.

If a project is delivered once it passes acceptance testing and there is no further support or changes, then automated acceptance testing might not make sense unless it is very cheap to produce the automated tests.

If, on the other hand, one expects future releases (even to same customer) or a long term support contract, then the initial investment may become worth it over time.

Our company produces trading systems and algorithms for a variety of customers, and new features and products are built on top of old ones. The cost of running all our tests manually is so high, that we are working on adding automated acceptance testing for many scenarios that have previously been tested manually.

Follow up:

IMHO it is important to first have very clear and complete step-by-step test plans (A good QA person or team is critical here). In the case of acceptance testing, the customers may provide their own or QA would have to provide with their customers. I believe that a test plan should often be part of the contract.

Once you have that, it is easier to estimate how long it would take a human to run it (and you can experiment on a human to find out). It is important to pay attention to what steps require "grunt work", and what steps require real human input or discretion.

This is an important distinction. For example, suppose you are building a drawing program. if you tell a human to draw lines in specific coordinates, this can be automated easily. However, if your step says: "Verify that the shape is a flower", a human can do it easily but automating it is almost impossible. Many test cases can be semi-automated. You leave "hooks" for user input and have a tester focus on these. A button starts a series of operations, and the user is presented with "did the correct output come out?".

My experience is that the cost of automation is fairly intuitive. However, there is often a need to modify the existing program to make it more testable. For example, in the above example, if you have an API to allow you to add lines to the canvas, things are great. If you have to write a mouse robot that translates logical coordinates to screen and all that, it is much longer.

Uri
Thank you, exactly my thoughts:) However I did not thought of a real scenario where it would be useful to run acceptance tests more times. I have still few questions: How to determine the cost of automated tests versus manual tests? Have you thought in your scenario about model-based testing?
Gabriel Ščerbák
Gabriel, IMHO it is important to first have very clear and complete step-by-step test plans (A good QA person is useful here). Once you have that, it is easier to estimate how long it would take a human to run it (and you can experiment on human). If the time is very long, then you do an engineering analysis of the cost to automate. It is often fairly intuitive though it might require some changes to the infrastructure to make things more testable.
Uri
indeed, I think testability should be an architectural requirement right from the start, thanks, that last paragraph made my answer acceptance test pass:).
Gabriel Ščerbák
+2  A: 

Writing automated acceptance tests can reap large benefits. In particular, it will:

  • Improve customer confidence in a product which is proven to be stable
  • Lower maintenance costs
  • Reduce the risk and fear of change
  • Allow for faster and more cheaper changes to the system

While you may be 100% familiar with the application now, try putting it down for a few months or years and come back to it to make changes. Believe me, it is much easier being able to run a suite of tests to prove that your new changes haven't broken anything.

Finally, consider writing your acceptance tests before you write the code, ala Test Driven Development fashion. Not only will this give you better code but you'll have full test suite coverage when your finished.

Don't kid yourself about the costs. Yes, it takes time, commitment and energy to write and maintain an automated acceptance test suite. But this is cheaper than alternative which is no tests and no idea what happens if you change something and what knockon effect it will have. What is your customer confidence worth? What is the real cost of fixing a bug after its been shipped?

Chris Knight
How is my customer more confident about the stability of the system? What about automated tests makes my sstem stable?Which maintainance costs will be spared? Automated tests can be seen as more code to maintain, which is quite the opposite.I grant the risk of change is lower, because I can see which scenarios get affected by the change.I do not think the change will be cheaper - often you have to change the tests as well.Writing acceptance tests beforehand might be hard if there is not support for testing all interactions.Cost is no problem for me, but what about the paying customer?
Gabriel Ščerbák
In my company, the customer is the business who pay for the application to be built, but the point is, if the end customer constantly sees a stable system, they are happier which is valuable. Automate tests make a system stable by identifying bugs early thereby helping prevent unexpected issues from cropping into your builds or allowing for early identification when they do. Change is cheaper because you are less likely to introduce bugs which can be costly to fix and less manual regression testing is required after making the change. Finally, well written tests avoid high test maintenance.
Chris Knight
The paying customer always cares about cost. What's important is that by paying more upfront they are avoiding costly unexpected scenarios in the future (whether this is downtime due to bugs, or missed deadlines because manual regression testing takes longer). Think of it like getting your car serviced regularly. By doing so you identify problems earlier, allowing you to budget time and money to address any problems early instead of unexpectedly breaking down which costs a lot more time and money and who knows what else (maybe you were driving to a wedding, for ex.).
Chris Knight