Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  - what makes a good test?
  - what makes a bad test?
I'm curious what you consider are possible correct/incorrect answers to these. I don't expect widespread agreement.


So I don't have a fixed good answer for any of these - what I'd like to see is that it's something the interviewee has thought about/read about. I'm also interested in how deep the knowledge goes, can they discuss these things? Have they tried other approaches and so on. That sort of thing is quite experience dependant, of course.

Possible good test answers (I'd expect maybe one or two - bonus points if you can talk about them as lived experience rather than text book)

Tests one thing/clear what causes a failure

Documents the code well

Describes the purpose of the code

Something about naming

Something about BDD

Something about arrange act assert

Something about how quickly it runs

Discussion of relative merits of unit, integration, e2e etc.

What's a Bad test answers...

Brittle (bonus if you mention this in relation to refactoring)

Asserting multiple things

Tautological

Very slow to run (with which I'd follow up with "any exceptions to this)

Plus you'll get lots of points if you bring up something I've not thought of before.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: