Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Specification by Example by Gojko Adzic.pdf
Скачиваний:
198
Добавлен:
12.03.2016
Размер:
13.4 Mб
Скачать

Chapter 9 Automating validation without changing speciications 139

When deciding whether to automate the validation of speciications using a technical tool or one for executable speciications, think about which beneits you want to get out of it. If we automate examples with a technical tool, we get easier automation and cheaper maintenance but lose the ability to use them for communication with business users later. We get very good regression tests, but the speciications will be accessible only to developers. Depending on your context, this might or might not be acceptable.

Automating validation of speciications without changing them is a key part of getting to living documentation. Without it, we can’t guarantee the correctness of hu- man-readable speciications. For many teams, the long-term beneit of Speciication by Example comes from living documentation. Instead of dropping automation that preserves the original speciications, we can work on controlling the cost of maintenance. You’ll ind many good techniques that teams used to reduce long-term maintenance costs in the “Managing the automation layer” section later in this chapter, as well as in chapter 10.

Starting with automation

Automated validation of executable speciications is quite different from unit testing, recorded and scripted functional automation that developers and testers are often used to. Automating something but keeping it human readable requires teams to learn how to use new tools and to discover the best way of hooking the automation into their system. Here are some good ideas on how to start to implement the automation process and a look at some mistakes the teams I interviewed commonly made while doing that.

To learn about tools, try a simple project irst

When: Working on a legacy system

Several teams used a simple project or a spike to learn how to use a new automation tool. If you have a small, relatively isolated piece of work in the pipeline, that might be a good strategy.

A small

project minimizes

risk and helps you

focus on learning how to use a t

instead

of dealing with

complex integrations

and business rules.

This approach is especially effective if you want to implement Speciication by Example at the same time as moving to an agile development process.

At uSwitch, they took this approach when introducing Cucumber, another popular tool for automation of executable speciications. They got the entire development team to start converting

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]