InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

High abstraction level of DSLs to reduce the testing burden?

Posted by Sadek Drobi on Oct 18, 2007

Sections
Enterprise Architecture,
Process & Practices,
Development,
Architecture & Design
Topics
Domain Specific Languages ,
Agile ,
Unit Testing ,
Modeling ,
Design ,
Agile Techniques ,
Architecture
Tags
TDD ,
Business Models ,
Collaborative Technologies ,
Language Oriented Programming

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?

it's just a new automation strategy by jiang yan Posted
  1. Back to top

    it's just a new automation strategy

    by jiang yan

    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

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.