Primary Photo for {0} {1}

Refactoring Tests

Presentation byTed M. Young

Tests are code, too, but they don't get as much attention, often leaving messy, hard to understand tests. Poorly factored tests can also make refactoring production code more difficult, resulting in even messier code.

In this session, we'll start with what we need from a good test, using AssertJ and JUnit features to make it readable and maintainable. We'll walk up the ladder from Helper methods, shared Factory Methods, all the way to Test Data Builders, discussing how and when to make the transition between them. We'll look at test "smells" and how to repair them, using Parameterized Tests. If time allows, we'll see how to "retarget" your tests when extracting a new production class from existing code.

While the code is in Java, the principles and techniques apply to most languages.

Presented with these Guilds
Cover Photo for Software Crafters Montréal
Primary Photo for Software Crafters Montréal

Software Crafters Montréal

Discuss: slack.softwarecrafters.org (channel #loc_montréal)

Past meetups notes: github.com/Software-Crafters-Montreal/meetups

Contact: crafters-mtl@googlegroups.com

---

This group is for any developer, whoever you are, and whatever language or technology you're familiar with.

Join us if you are interested in testing, DDD, software architecture, clean code, refactoring, challenges of working with legacy code, pairing/mobbing, etc.

As Software Crafters, we improve professional software development skills through practice and helping others learn the know-how.

We do appreciate the following:

Not only working software, but also well-crafted software. Not only responding to change, but also steadily adding value. Not only individuals and interactions, but also a community of professionals. Not only customer collaboration, but also productive partnerships.

Looking for the left parts, we found that we needed the right parts.

The Manifesto for Software Craftsmanship: http://manifesto.softwarecraftsmanship.org/

Code of Conduct

Our meetup is a harassment-free place for everyone, regardless of gender, gender identity, and expression, age, sexual orientation, disability, physical appearance, body size, race, ethnicity, religion (or lack thereof), or technology choices. We do not tolerate harassment of participants in any form. Sexual language and imagery are not appropriate at any time, including talks, workshops, parties, Twitter, and other online media. Participants violating these rules may be sanctioned or expelled from the meetup at the discretion of the organizers.

Detailed version: https://github.com/socrates-ca/socrates-ca.github.io/wiki/Code-of-Conduct

535Members
Similar Presentations
Primary Photo for {0} {1}

Refactoring Tests

Presentation byTed M. Young

Tests are code, too, but they don't get as much attention, often leaving messy, hard to understand tests. Poorly factored tests can also make refactoring production code more difficult, resulting in even messier code.

In this session, we'll start with what we need from a good test, using AssertJ and JUnit features to make it readable and maintainable. We'll walk up the ladder from Helper methods, shared Factory Methods, all the way to Test Data Builders, discussing how and when to make the transition between them. We'll look at test "smells" and how to repair them, using Parameterized Tests. If time allows, we'll see how to "retarget" your tests when extracting a new production class from existing code.

While the code is in Java, the principles and techniques apply to most languages.

Presented with these Guilds
Cover Photo for Software Crafters Montréal
Primary Photo for Software Crafters Montréal

Software Crafters Montréal

Discuss: slack.softwarecrafters.org (channel #loc_montréal)

Past meetups notes: github.com/Software-Crafters-Montreal/meetups

Contact: crafters-mtl@googlegroups.com

---

This group is for any developer, whoever you are, and whatever language or technology you're familiar with.

Join us if you are interested in testing, DDD, software architecture, clean code, refactoring, challenges of working with legacy code, pairing/mobbing, etc.

As Software Crafters, we improve professional software development skills through practice and helping others learn the know-how.

We do appreciate the following:

Not only working software, but also well-crafted software. Not only responding to change, but also steadily adding value. Not only individuals and interactions, but also a community of professionals. Not only customer collaboration, but also productive partnerships.

Looking for the left parts, we found that we needed the right parts.

The Manifesto for Software Craftsmanship: http://manifesto.softwarecraftsmanship.org/

Code of Conduct

Our meetup is a harassment-free place for everyone, regardless of gender, gender identity, and expression, age, sexual orientation, disability, physical appearance, body size, race, ethnicity, religion (or lack thereof), or technology choices. We do not tolerate harassment of participants in any form. Sexual language and imagery are not appropriate at any time, including talks, workshops, parties, Twitter, and other online media. Participants violating these rules may be sanctioned or expelled from the meetup at the discretion of the organizers.

Detailed version: https://github.com/socrates-ca/socrates-ca.github.io/wiki/Code-of-Conduct

535Members
Similar Presentations