Testing and modularity

One of the nice advantages of TDD is that it forces you to write modular code; it is not easy to test code that is not modular. Thus, either you give up on testing (an option, which I hope you will never consider) or you decouple modules to easily test them. If you did not adopt this methodology from the beginning, remember that it is always possible to refactor the code to make it more modular and more testable. Thus, TDD and modular/decoupled design go hand in hand and drive quality; well designed modular code is easier to test and well-tested code has a known quality.

When evaluating whether to accept this programming methodology, you should also take into consideration that testing UI aspects is usually harder. Thus, ...

Get Implementing Domain-Specific Languages with Xtext and Xtend - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.