Abstract
Domain-specific languages (DSLs) offer several advantages by providing idioms that are similar to the abstractions found in a specific problem domain. However, a challenge is that tool support for DSLs is lacking when compared to the capabilities offered in general-purpose languages (GPLs), such as Java and C++. For example, support for unit testing a DSL program is absent and debuggers for DSLs are rare. This limits the ability of a developer to discover the existence of software errors and to locate them in a DSL program. Currently, software developers using a DSL are generally forced to test and debug their DSL programs using available GPL tools, rather than tools that are informed by the domain abstractions at the DSL level. This reduces the utility of DSL adoption and minimizes the benefits of working with higher abstractions, which can bring into question the suitability of using DSLs in the development process. This paper introduces our initial investigation into a unit testing framework that can be customized for specific DSLs through a reusable mapping of GPL testing tool functionality. We provide examples from two different DSL categories that serve as case studies demonstrating the possibilities of a unit testing engine for DSLs.
Chapter PDF
Similar content being viewed by others
References
ANTLR, ANother Tool for Language Recognition (2008), http://www.antlr.org/
Attali, I., Courbis, C., Degenne, P., Fau, A., Fillon, J., Parigot, D., Pasquier, C., Coen, C.S.: SmartTools: a Development Environment Generator based on XML Technologies. In: ICSE Workshop on XML Technologies and Software Engineering, Toronto, Canada (2001)
Batory, D., Lofaso, B., Smaragdakis, Y.: JTS: Tools for Implementing Domain-Specific Languages. In: Fifth International Conference on Software Reuse, Victoria, Canada, pp. 143–153 (1998)
Bentley, J.: Little Languages. Communications of the ACM 29(8), 711–721 (1986)
Bodeveix, J.P., Filali, M., Lawall, J., Muller, G.: Formal methods meet Domain Specific Languages. In: Romijn, J.M.T., Smith, G.P., van de Pol, J. (eds.) IFM 2005. LNCS, vol. 3771, pp. 187–206. Springer, Heidelberg (2005)
Bravenboer, M., Visser, E.: Concrete Syntax for Objects: Domain-Specific Language Embedding and Assimilation without Restrictions. In: Object-Oriented Programming, Systems, Languages, and Applications, Vancouver, Canada, pp. 365–383 (2004)
Burnett, M., Cook, C., Pendse, O., Rothermel, G., Summet, J., Wallace, C.: End-User Software Engineering with Assertions in the Spreadsheet Paradigm. In: International Conference on Software Engineering, Portland, OR, pp. 93–105 (2003)
CUP User Manual (2007), http://www.cs.princeton.edu/~appel/modern/java/CUP/manual.html
Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Techniques, and Applications. Addison-Wesley, Reading (2000)
Dmitriev, M.: Design of JFluid: A Profiling Technology and Tool Based on Dynamic Bytecode Instrumentation. Sun Microsystems Technical Report. Mountain View, CA (2004), http://research.sun.com
Domain-Specific Language Testing Studio (2009), http://www.cis.uab.edu/softcom/DDF
Eclipse (2008), http://www.eclipse.org
End-Users Shaping Effective Software Consortium (2007), http://eusesconsortium.org
Gamma, E., Beck, K.: Contributing to Eclipse: Principles, Patterns, and Plug-Ins. Addison-Wesley, Reading (2003)
Gelperin, D., Hetzel, B.: The Growth of Software Testing. Communications of the ACM 31(6), 687–695 (1988)
Harrison, W.: The Dangers of End-User Programming. IEEE Software 21(4), 5–7 (2005)
Henriques, P., Pereira, M., Mernik, M., Lenič, M., Gray, J., Wu, H.: Automatic Generation of Language-based Tools using LISA. IEE Proceedings – Software 152(2), 54–69 (2005)
Hilzenrath, D.: Finding Errors a Plus, Fannie says: Mortgage Giant Tries to Soften Effect of $1 Billion in Mistakes, The Washington Post (2003)
JDB, The Java Debugger (2008), http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/jdb.html
JUnit (2006), http://www.junit.org
Kieburtz, B.R., Mckinney, L., Bell, J.M., Hook, J., Kotov, A., Lewis, J., Oliva, D., Sheard, T., Smith, I., Walton, L.: A Software Engineering Experiment in Software Component Generation. In: International Conference on Software Engineering, Berlin, Germany, pp. 542–552 (1996)
Lämmel, R., Schulte, W.: Controllable Combinatorial Coverage in Grammar-Based Testing. In: IFIP International Conference on Testing Communicating Systems, New York, NY, pp. 19–38 (2006)
Mernik, M., Heering, J., Sloane, A.: When and How to Develop Domain-Specific Languages. ACM Computing Surveys 37(4), 316–344 (2005)
Mernik, M., Lenič, M., Avdičauševič, E., Žumer, V.: LISA: An Interactive Environment for Programming Language Development. In: Horspool, R.N. (ed.) CC 2002. LNCS, vol. 2304, pp. 1–4. Springer, Heidelberg (2002)
Mernik, M., Žumer, V.: Incremental Programming Language Development. Computer Languages, Systems and Structures 31, 1–16 (2005)
NUnit Project Page (2008), http://www.nunit.org/
Olan, M.: Unit Testing: Test Early, Test Often. Journal of Computing Sciences in Colleges 19(2), 319–328 (2003)
Rebernak, D., Mernik, M., Wu, H., Gray, J.: Domain-Specific Aspect Languages for Modularizing Crosscutting Concerns in Grammars. In: IET Software (Special Issue on Domain-Specific Aspect Languages) (2009) (in press)
Scaffidi, C., Shaw, M., Myers, B.: Estimating the Numbers of End Users and End User Programmers. In: Symposium on Visual Languages and Human-Centric Computing, Dallas, TX, pp. 207–214 (2005)
Schmitt, R.B.: New FBI Software May Be Unusable. Los Angeles Times (2005)
Sebesta, R.W.: Concepts of Programming Languages. Addison-Wesley, Reading (2003)
Tassey, G.: The Economic Impacts of Inadequate Infrastructure for Software Testing. NIST Planning Report 02-3 (2002), http://www.nist.gov/director/prog-ofc/report02-3.pdf
Thai, T.L., Lam, H.: Net Framework Essentials. O’Reilly, Sebastopol (2002)
Tillmann, N., Schulte, W.: Parameterized Unit Tests with Unit Meister. In: European Software Engineering Conference (ESEC)/Symposium on the Foundations of Software Engineering, Lisbon, Portugal, pp. 241–244 (2005)
Van Den Brand, M., Heering, J., Klint, P., Oliver, P.: Compiling Language Definitions: The ASF+SDF Compiler. ACM Transactions on Programming Languages and Systems 24(4), 334–368 (2002)
Van Deursen, A., Klint, P.: Little Languages: Little Maintenance? Journal of Software Maintenance 10(2), 75–92 (1998)
Van Deursen, A., Klint, P.: Domain-Specific Language Design Requires Feature Descriptions. Journal of Computing and Information Technology 10(1), 1–17 (2002)
Van Deursen, A., Klint, P., Visser, J.: Domain-Specific Languages: An Annotated Bibliography. ACM SIGPLAN Notices 35(6), 26–36 (2000)
Van Wyk, E., Krishnan, L., Schwerdfeger, A., Bodin, D.: Attribute Grammar-based Language Extensions for Java. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 575–599. Springer, Heidelberg (2007)
Wile, D.S.: Lessons Learned from Real DSL Experiments. Science of Computer Programming 51(3), 265–290 (2004)
Wile, D.S., Ramming, J.C.: Guest Editorial: Introduction to the Special Section “Domain-Specific Languages (DSLs)”. IEEE Transactions on Software Engineering 25(3), 289–290 (1999)
Wu, H., Gray, J., Roychoudlhury, S., Mernik, M.: Weaving a Debugging Aspect into Domain-Specific Language Grammars. In: Symposium for Applied Computing (SAC) – Programming for Separation of Concerns Track, Santa Fe, NM, pp. 1370–1374 (2005)
Wu, H., Gray, J., Mernik, M.: Grammar-Driven Generation of Domain-Specific Language Debuggers. Software: Practice and Experience 38(10), 1475–1497 (2008)
Xie, T., Marinov, D., Schulte, W., Noktin, D.: Symstra: A Framework for Generating Object-Oriented Unit Tests Using Symbolic Execution. In: Halbwachs, N., Zuck, L.D. (eds.) TACAS 2005. LNCS, vol. 3440, pp. 365–381. Springer, Heidelberg (2005)
Xie, T., Zhao, J.: A Framework and Tool Support for Generating Test Inputs of AspectJ Programs. In: International Conference on Aspect-Oriented Software Development, Bonn, Germany, pp. 190–201 (2006)
Zhu, H., Hall, P.A.V., May, J.H.R.: Software Unit Test Coverage and Adequacy. ACM Computing Surveys 29(4), 366–427 (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 IFIP International Federation for Information Processing
About this paper
Cite this paper
Wu, H., Gray, J., Mernik, M. (2009). Unit Testing for Domain-Specific Languages. In: Taha, W.M. (eds) Domain-Specific Languages. DSL 2009. Lecture Notes in Computer Science, vol 5658. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03034-5_7
Download citation
DOI: https://doi.org/10.1007/978-3-642-03034-5_7
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-03033-8
Online ISBN: 978-3-642-03034-5
eBook Packages: Computer ScienceComputer Science (R0)