Wednesday, 10 February 2016

How I would interview developers now

I have done my fair share of interviews. I recently realised I was doing it all wrong.

Now, I would only talk about testing. It's a much better gauge of a developer than anything else.

If the developer is describing manual testing, I'm thinking Junior. At best.

Everyone has heard of unit testing, so I'm interested in the level they have taken this to. Have they only done unit testing on green field projects? Did they add functionality to a project that already had good coverage? Did they have to bring up the coverage of something that already existed?

If they had to add tests to something that existed, how did they deal with architectures that didn't have testing in mind? Did they use any patterns to help with the transition? How did they negotiate the risk of refactoring code that had no tests? Did they form a strategy for ensuring the functionality was the same before and after - what was it? Did it work? What did they learn?

Test driven development usually comes up too. Describe it to me - I'm interested. How did you get started with it? Do you use it for everything? TDD is hard and you can loose the discipline quickly. I have come across only a few developers who really did TDD - the rest write unit tests after their implementation, which is not the same. What's the difference? Is it OK to do it this way - sell it to me.

So you're writing tests. I'm now thinking you are developer with a few years experience - you've seen things, you have scars.

Again, I'm interested. What does a good test look like? How would you name a test? This is particular PITA since we all know naming things is haaaard. I want to know the thought process though. How have you managed hundreds of tests? How about thousands? How did you structure these, how did you evolve this over time and what did you learn? Did you group tests together - what has worked for you in the past?

Let's talk smells.

What does a really long test tell you about the code you are testing? If you have initialise half the app to do the test what's going through your head? If lots of your tests are using the same dummy data, what might you expect to happen in the future? What would you think if you saw multiple asserts - is that OK? If not, can you think of any examples where it might be OK?

Tools can also be a topic of conversation. What frameworks have you used? Can you do unit testing without them? How would you go about that? What's the difference between a fake, a mock and a stub? How would you use each?

Getting more interested. You've probably refactored some tests - maybe had to teach people. Maybe had to be the sheriff at times. All good - I thinking more senior now. You've probably had more responsibility or accepted more for 'the cause'.

We're in integration land now. How have you set the state of a test - what strategies did you use and why? How do you deal with large databases during tests? How did you deal with specific customer configurations? How can you structure tests around failures - how does this affect automated runs? What happens when you have too much to run in a single night?

Depending on your flavour we might be talking API or UI. Have you had to apply tests to a legacy Windows application? What challenges did you face? Have you tested Web applications? Is there anything you had to differently to allow the UI to be automated? What mistakes did you make or uncover? How about mobile applications? How did you deal with apps that were for multiple OS's and ensure conformity?

Integration testing is often tool heavy. What did you use? What's your favourite? What features really helped you? Did you write anything to enhance your toolset? What did it do?

If we get here, I really thinking lead. I'm liking the embedded approach to your thinking - QA is a part of your thought process and experience.

Testing is a part of team life. Agile teams own quality. They nail it in the sprint - it is a part of the DoD, one guy in the team cannot do all of it. How far on this journey are they? How do they plan testing in their team? How do they estimate it?

Think about what I'm REALLY asking. If you are not testing anything yourself, I'm wondering about your code - to be honest, I'm wondering if I could understand it and maintain it. If we are talking unit tests, you have probably had to confront this and do something about it. We all have had that "who wrote this rubbish?!" moment only to discover it was us.

Talking about unit tests means, I'm pretty sure you are familiar with Dependency Injection, if you can describe smells you probably also get Single Responsibility Principle too. You might have had struggles with the Open/Closed Principle and realised the pitfalls of inheritance and how this affects what we are testing. So we are also touching on OO principles like encapsulation and composition which influence how we structure code so it can be tested. I don't need to ask you any basic questions because if we got here, I'm pretty sure you know that!

I'm also getting direct feedback on how you regard quality. This is not the QA's job - it is everybody's job. It is core to delivering product. Quality is embedded into each line - code is crafted to be tested, products are designed to tested, developers need to think in terms of delivery - the output of which is also tested.

Anyone can rattle off definitions but describing how you apply these to deliver software is easier to gauge if we only talk tests. It's also really hard to fake.

1 comment:

  1. Good post.

    I would also like to hear them tell me what they wouldn't test, how they determine if there is value in writing a test and how they decide whether to do test first or test afterwards.

    ReplyDelete