Clean code
Keeping your code clean (see the books Martin 2008, 2011) is important for the development of software and this includes modularity, readability, and maintainability. Xtext provides many features to keep your DSL implementation clean and modular, thanks to its decomposition into many customizable aspects. Xtend extremely enhances the ability to write clean code thanks to its syntax and its features such as lambda expressions and extension methods. In this book, we will put much effort into writing clean code when implementing a DSL; in particular, we will try to write small methods and to factor common code into reusable methods.
Tests must be clean as well, since they are part of the development cycle, and they will have to be modified often. Remember that tests also provide documentation, thus they must be easily readable. In this chapter, we tried to write small test methods by relying on reusable utility methods and classes. Note that writing small methods does not necessarily...