InfoQ

News

High abstraction level of DSLs to reduce the testing burden?

Posted by Sadek Drobi on Oct 18, 2007 09:20 PM

Community
Architecture,
Agile
Topics
Domain Specific Languages ,
Design ,
Unit Testing ,
Modeling ,
Agile Techniques
Tags
TDD ,
Language Oriented Programming ,
Collaborative Technologies ,
Business Models

Inconsistencies between the user interface and user’s expectations, i.e. the user model, are an important source of bugs. In absence of comprehensive information on how the software works, the user will have an impression that the its behavior is unpredictable. According to Leonardo Vernazza, this results from the fact that the user and the UI do not talk the same language and therefore need translation.

He asserts in his recent blog post that “the bigger the difference between the languages, the bigger is the probability to produce translation errors between them” and the bigger is the testing burden to ensure the consistency of the translation. Hence, in many cases the right approach would be to offer a “high abstraction language” that both the user model and the user inerface would share, i.e. a DSL. This would be instrumental for avoiding translations and the nececessity to test them. More generally speaking, argues Leonardo, upgrading the level of abstraction reduces the testing burden and this can apply to any other models, e.g. software design, implementation, etc.: 

when you express things at the right abstraction level, testing is useless, […] Would you test that the += operator is working properly in C# or Java?. I wouldn't.

Andres Aguiar has also been arguing on his blog that if enough efforts are put in refining the abstraction, there would be no need for TDD and even for Unit Testing. However, some issues should be taken into consideration.

Using DSLs in order to reduce the testing burden requires a thorough testing of the DSL itself. Leonardo Vernazza asserts that “in most of the cases this is a far simpler and better limited task than testing all the user interfaces”. And such approach allows to “redistribute responsibilities”, moving the testing burden onto DSL authors.  Gareth Jones however believes that “many DSL authors won't test a very high number of language variants against their code generators.

Commenting on Andres Aguiar’s post, Scott Bellware also highlighted, that determining “the inherently optimal level of abstraction” is not an easy task whereas Brad Head points out that this is precisely what TTD is about: “challenging your design abstractions by "trying it out"”. Moreover, Ron Scott argues that TDD is instrumental for finding out whether changes in code break something. Bellware stresses indeed that a design-tuned DSL is “statically locked down” and would not deliver the same value if the business or technology environment evolves.

So what do you think about abstraction vs. testing? Can the use of DSLs reduce the testing burden?

Related Sponsor

VersionOne is recognized by Agile practitioners as the leader in Agile project management tools. Companies such as Adobe, BBC, CNN, Dow, HP, IBM, Sony and 3M have turned to VersionOne to help deliver greater value to their customers.
it's just a new automation strategy by yan jiang Posted Oct 23, 2007 9:59 AM
  1. Back to top

    it's just a new automation strategy

    Oct 23, 2007 9:59 AM by yan jiang

    express both requirements(or say use cases) and testcases in DSL, will of course bring us lots of good effects. phase consistent, keywords index, or tags( for category). but speaking of test execute, which means automation, using DSL is nothing more than a new strategy. Before DSL, we use data-driven strategy, and when everything goes into table, it really looks like a DSL draft. actor action result admin login index.page login successful admin delete something things are gone. now we have DSL, sequences of a table will be cut into cases/steps, but still. nothing changed. Problem we face, we still need to face. Maybe, now we don't have testers to do all these development work, we blame DSL-coders when things go wrong. :)

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.