Re:JS assessment: A test-driven approach to assessing JS skills
by speg on Friday April 13, 2012 @07:35AM
(#3836230)
I agree, I also thought it wasn't clear if we were supposed to be writing tests, or code that was to be tested. Instead of modifying the test cases have them fill out a functions file and then run the random tests against those.
Re:JS assessment: A test-driven approach to assessing JS skills
by rmurphey3 on Friday April 13, 2012 @11:27AM
(#3837155)
My fear with doing that is that if the functions file is separated from the tests file, then it becomes difficult to see at a glance what the function needs to do in order to make the test pass. That said, I agree that what you're supposed to do could be more clear -- would you care to open an issue so we can discuss it on the repo?
Re:JS assessment: A test-driven approach to assessing JS skills
by rmurphey3 on Friday April 13, 2012 @10:54AM
(#3836990)
Thanks for the great feedback -- it occurred to me that people could simply hard-code the "right" answers into their function. However, if I am using this to assess a candidate, I plan to actually read the code that they write :) And if a person is using this to assess their own skills, I trust that they know that an answer like the one above hasn't taught them anything.
Your guess about why I chose something that involves a little bit of setup is right on target, too. Being able to follow the instructions in a readme and get a simple project like this set up is a key skill to have, too.
What I'm more concerned is the idea that this is apparently structured like an automated test. If you used it that way, then here is a function which would pass the first test file:
It was built by just looking at the "expect" calls, finding the input to the function and the output from it, and duplicating that output.That's obviously not what you want to test. You really want to say, "you give me an object, and I'm going to generate a couple random test vectors and make sure you do the right thing with those vectors." You shouldn't hardcode the result, but the right algorithms, so that someone else's solutions can be measured against the right way to do things. And then you need to ask people not to modify the right solutions, but to duplicate them.