jargon

Comparison

Humble objectvsModel-view-presenter

Humble object

the class that touches the framework has no logic in it, so the logic is testable without the framework.

Splitting hard-to-test code into a very thin piece that touches the untestable thing and a piece holding all the behaviour. It is the general principle under passive views, thin controllers and hexagonal adapters. It is the most useful single idea for anyone whose tests are slow: find the smallest object that has to touch the boundary and take everything else out of it.

Full entry →

Model-view-presenter

the view is an interface with setTitle and showError on it, and the presenter is what you actually unit test.

A variant of MVC where the view is passive and holds no logic, and a presenter reads from the model and pushes formatted values into it through an interface. The point is testability: the presenter can be tested against a fake view with no UI framework at all. It costs a method on the view interface for every field on the screen, which is why it faded once binding-based approaches arrived.

Full entry →

Related comparisons