The Codeless Code: Case 7 The enemy of the good(测试:善良的敌人)

The monks of the Laughing Monkey Clan approached the Java master with a list of grievances.

笑猴部落的僧侣们带着一堆抱怨来到Java大师面前。

“Our greatest frustration is the testing process,” insisted the youngest monk. “Manual testing is tedious, and automated tests are troublesome to compose. Both are distractions from the authorship of code.”

“我们最挫败的地方就是检测的环节”,最年轻的那个僧侣坚定的说道,"综合所有的开发者都面对的焦虑:手工的去检测非常沉闷,但自动化的去测试每个环节又特别麻烦。"

The master considered this, and said: “It is certain that we could forgo testing altogether, if we knew our code to be perfect. How, then, may we achieve perfection?”

大师考虑了一会儿说道:"如果我们可以知道我们自己写的代码是完美的,我们的确应该把检测的环节给整个儿丢弃掉,但是,我们怎样能所写的代码都变成完美的呢?"

“Through practice,” said one monk.

一个僧侣说道:“通过多多实践”。

“Through diligent study,” said another

另一个僧侣说道:“通过勤奋的学习”。

“Through the appeasement of the proper gods,” said a third.

第三个僧侣说道:"通过对神明所提出的那些规则进行适当的放宽(这里指的是不必太严守编程的原则)"。

An old white-bearded monk, who had been sitting quietly in the corner, raised his head:

这时,一直安安静静的坐在角落的白胡子僧侣老者,抬起头说道:

“I know how perfection may be achieved,” he said. “But I fear that all who hear my answer will be forever unconvinced of its truth unless I speak exactly the right words, with the most pleasing of intonations, at the most propitious time of day. I must now consider how this is best done.”

“我知道该怎样让我们所写的代码变的完美”,他接着说,“但我担心,所有听到我回答的人,将永远不相信我的话是真的,除非我在一天中最有利的时候,用最令人愉悦的语调,准确地说出正确的话。所以,现在我必须要好好考虑下我该怎么说才好。”

The old monk fell silent for a long time. Eventually the dinner-bell sounded.

于是,老僧侣陷入了久久的深思当中。最终,一直等到晚饭的钟声都敲响了,老僧侣还没想出来。

“How long will this take?” asked one of the novices.

“需要想多久啊?”一个刚入门的僧侣问道。

“No more than a hundred years,” came the old monk’s reply.

“很快,不会超过一百年的”,老僧侣回答到。。。。。

The Codeless Code: Case 7 The enemy of the good(测试:善良的敌人)