Test-driven development

Many developers develop the healthy habit of Test-driven Development (TTD). This practice, inherited from Extreme Programming (XP), is the process of splitting each development stage into small steps and then writing a failing test for every one of them. You make the necessary modifications so that the tests pass again (test are green). You can then refactor your code as long as the tests remain green. The following figure illustrates the TDD cycle:

Test-driven development

You can iterate until the feature is done with very short feedback loops, with the insurance of no regressions, and the guarantee that all the code you write will be tested from ...

Get Spring MVC: Designing Real-World Web Applications 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.