The proliferation of testing strategies outside of a broadly agreed set of definitions has caused confusion and a waste of effort by not fully understanding how to apply the fundamentals of unit testing. Let's change that.

In this session, we will cover the five types of test doubles: dummy, fake, stub, spy, and mock, showing code examples of how to use each with PHPUnit and Prophecy. Layered on top of this we will observe the difference between sociable and solitary tests, as coined by Jeffrey Fields. Lastly, we will look at how test smells naturally surface and what strategies can be used to mitigate them, such as Arrange-Act-Assert, object mothers and data builders.

The key takeaway from this session will be a deep knowledge of unit testing: when to apply one double versus another, when to use solitary vs sociable, and how to mitigate test smells.

Comments

Comments are closed.

Dave Buchanan at 13:09 on 17 Mar 2017

I got a lot out of this talk. Being very new to writing tests, I got some good staring points. Especially in the final slides.

Would have liked speaker to start session with the What/Why, like an overview detailing what will be covered. Instead he just seemed to dive right in, which had some great stuff. But not having stated an overview I kept wondering where this was going.

Also this is a bit nit picky but speaker kept correcting himself. Maybe he was nervous. Repeatedly said, "I should have better examples". Next time just have better examples.

Anonymous at 14:01 on 17 Mar 2017

Being new to unit testing, this talk seemed beyond my understanding. Still, I feel like I gained more knowledge about it than when I first walked into the room.

As an entry level course I was expecting it to have a little more overview before jumping in. It was still very valuable and I'm glad I attended.

Becky at 18:22 on 17 Mar 2017

I've been wanting to learn about testing for a while now, but have never had the chance. This talk gave me a good overview of unit testing.

Josh Hartman at 19:20 on 17 Mar 2017

I did learn more about the terminology but feel that I would have understood the examples better if I had experience with the Drupal codebase, of which I have none.

Anonymous at 09:19 on 20 Mar 2017

Jesse Donat at 10:29 on 20 Mar 2017

The talk was in a sort of weird place where it wasn't exactly an intro to testing, but a person like myself who's been testing for a while didn't get a ton out of it either. I think the talk needs a better sense of who it's target audience is.