If you create software that is to be developed continuously over several years you'll need a sustainable approach to code quality. In our early days of AEM development, however, we used to struggle with code that is rigid, hard to test and full of LOG.debug calls. In this talk I will share some development best practices we have found that really work in actual AEM based software, e.g. to achieve 100% code coverage and provide high confidence in the code base. Spoiler alert: no new libraries, frameworks or tools are required - once you know the ideas, plain old TDD and the S.O.L.I.D. principles of Clean Code will do the trick. by Andreas Czakaj, mensemedia Gesellschaft für Neue Medien mbH Presented at the adaptTo() 2017 conference in Berlin (https://adapt.to/2017/en/schedule/how-to-write-clean---testable-code-without-losing-your-mind.html). Presentation video can be found on YouTube (https://www.youtube.com/watch?v=JbJw5oN_zL4)