Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Automated Acceptance Testing > The Application Driver Layer

The Application Driver Layer

The application driver layer is the layer that understands how to talk to your application—the system under test. The API for the application driver layer is expressed in a domain language, and indeed can be thought of as a domain-specific language in its own right.

What Is a Domain-Specific Language?

A domain-specific language (DSL) is a computer programming language that is targeted at solving a problem specific to a particular problem domain. It differs from general-purpose programming languages by having many classes of problems it will be unable to address because it is designed to work only within its particular problem area.

DSLs can be classified into two types: internal and external. An external domain-specific language is one which requires explicit parsing before the instructions in it can be executed. The acceptance criteria scripts that form the top layer in the Cucumber example in the previous section demonstrate an external DSL. Other examples include the XML build scripts of Ant and Maven. External DSLs need not be Turing-complete.

An internal DSL is one that is expressed directly in code. The example in Java below is an internal DSL. Rake is another example. In general, internal DSLs are more powerful because you have the power of the underlying language at your disposal but, depending on the syntax of the underlying language, they can be less readable.

There is some very intriguing work going on in the area of executable specifications which crosses over with a couple of other themes in modern computing: intentional programming and domain-specific languages. You can begin to view your test suite, or rather your executable specifications, as defining the intent of your application. The manner in which you state that intent can be thought of as a domain-specific language, where the domain is application specification.



  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint