26 Feb '14, 11pm

assert rand() > 0.5 #testing 결정적이어야 한다. 리소스 검증과는 다르게 코드가 안 변하면 테스트 결과는 항상 같아야 함. 제목 잘 짓네. 센스 넘친다.

Jason Morrison August 25, 2009 testing Yeah so you might think it'd be nice to hire a Femfatalatron as your housekeeper, but do you know how the inner circuits work?? DO YOU!! Of course not; it's a strong AI so it's nondeterministic. One day, you will ask why there is a spot on your nice wine glasses. The next day, your house is in shambles. Firey, robot-incinerated shambles. On the flip side, we have our nice, safe test suites. Perfectly deterministic, they run with the same fixture data every time. We rely on this consistent behavior to stay vigilant against regressions and to refactor with confidence. So why would you let nondeterministic code into your test suite? Let's pretend you're testing a class method on a model that returns a list of instances sorted by last name. Let's also say that there is a bug in your implementation. Debugging is hard enough - tossing in ra...

Full article: http://robots.thoughtbot.com/assert-rand-0-5

Tweets

Paul Rand on Art and Aesthetics

designsojourn.com 27 Feb '14, 2pm

We value your comments as they provide different perspectives that we can learn from and/or improve our products as we see...

Paul Rand on Art and Aesthetics: If you can’t s...

designsojourn.com 27 Feb '14, 2pm

We value your comments as they provide different perspectives that we can learn from and/or improve our products as we see...