https://martinfowler.com/bliki/HumbleObject.html
[mf-name-wh]
[ ]
* Refactoring
* Agile
* Architecture
* About
* Thoughtworks
*
*
*
[ ]
Topics
Architecture
Refactoring
Agile
Delivery
Microservices
Data
Testing
DSL
about me
About
Books
FAQ
content
Videos
Content Index
Board Games
Photography
Thoughtworks
Insights
Careers
Products
follow
Twitter
RSS
Mastodon
HumbleObject
29 April 2020
[mf]
Martin Fowler
testing
Some program elements are inherently difficult, or even impossible to
test. Any logic in these elements is thus prone to bugs and difficult
to evolve. To mitigate this problem, move as much as logic as
possible out of the hard-to-test element and into other more friendly
parts of the code base. By making untestable objects humble [1], we
reduce the chances that they harbor evil bugs.
[sketch]
[meszaros]
A common example of this is in the user-interface. Some platforms
provide no hooks to enable us to run automated tests against UI
controls. Even those that do often make it difficult, with complex
setup, special frameworks, and slow-running tests. But we can often
test effectively by ensuring these controls have the absolute minimum
of behavior, using patterns like Presentation Model (MVVM) and
Passive View.
For more details on this approach the key source is Gerard Meszaros's
xUnit Test Patterns book - the entry on Humble Object is online and
includes much more depth including variations and examples.
Notes
1: The use of the word "humble" originated in an article by Michael
Feathers .
[ ]
Topics
Architecture
Refactoring
Agile
Delivery
Microservices
Data
Testing
DSL
about me
About
Books
FAQ
content
Videos
Content Index
Board Games
Photography
Thoughtworks
Insights
Careers
Products
follow
Twitter
RSS
Mastodon
[thoughtwor]
(c) Martin Fowler | Privacy Policy | Disclosures