UUM-2978 A Tale about The Evil Partial Mock, and the Separation by Levels of Abstraction Principle of TDD | Devoxx

A Tale about The Evil Partial Mock, and the Separation by Levels of Abstraction Principle of TDD

Quickie

method Methodology & Culture

Room 4 (Grand Parade)

Wednesday from 13:10 til 13:25

Do you know what a Partial Mock is ? If you're practicing TDD, you must have faced/heard of it. And you probably have heard that it's Evil, and you should avoid it. People use it to avoid overlapping tests in a Large class, e.g. to mock a private method. But if it's Evil, what to use instead? You don't want to overlap your tests, so you really don't want your new test to run through all those little methods you've already covered with unit tests.

It's called Separation on the Level of Abstraction, and it's one of the most powerful (yet not-so-known) techniques that allow your Tests to drive your Design. TDD, remember? :) Join me for a quick discussion on a simple example (LIVE CODING), spiced with notes on SRP, DRY and other Clean Code principles. You'll love it!

Victor Rentea Victor Rentea

Java Craftsman. Sr. Engineer & Technical Lead at IBM. Independent Trainer & Coach. I worked on backend systems over the last 10 years, solving challenges of a broad range of enterprise Java applications as a developer, lead and consultant. 4 years ago I joined the ‘coding craftsmanship’ move, and soon after I started preaching about it as an independent trainer/coach. For hundreds of days I’ve trained more than 1000 trainees in all kinds of settings (including academic), usually bundled with other training modules in my curricula. My experience as a trainer allowed me to refine a very entertaining presentation style, spiced with jokes, non-IT-world analogies, and examples that is able to convey even the most complex ideas