What I learned from creating a Merge Queue

What is a Merge Queue?

When your team wants to ensure all tests are passing before their changes are merged into main/master/trunk it can be helpful to have an automated process to trigger those tests and ensure they pass before merging. A lot of Pull Request systems can do this for you with a check that the tests must pass before merging. There isn’t any reason to consider a merge queue unless the test take a long time to run. Waiting 5 minutes between updating a pull request and merging it in is usually fine but waiting a hour can become a problem. Especially when there are a lot of other people working on the same code base.

Continue reading “What I learned from creating a Merge Queue”

Can Programmers Test?

I spend a lot of time working closely with programmers on the software testing process. Much of my career mission is to get more people embracing techniques like Test Driven Development. As I push more and more of the testing demands onto the developers I sometimes run into people who say they need a tester for “independent testing”.

Continue reading “Can Programmers Test?”

Are mocks/fakes reusuable?

Programming 101 states:
Don’t copy and paste code. If you find yourself doing something repetitive then do it right so you can reuse the same code. Functions, classes and even separate files all serve this end.

Now that I’m writing tests all the time I often find myself creating Mocks. Mocks are where you tell code to use a pretend version of some functionality instead of the real one. It could be because the real one does something you don’t want in your tests (writes files, reads a database) or it could be that you’ve got some messy legacy code you can’t to pull into your tests (yet). There’s other reasons too but you get the idea.

So if I make a Mock version of a class it makes sense to try and share that with everyone else that might be trying to test with that same class. Or does it?

Continue reading “Are mocks/fakes reusuable?”