'Twas Brillig and the Slithy Tests. . .

'Twas Brillig and the Slithy Tests. . .

Suddenly Alice, who was puzzling over the meaning of strange words like "YAGNI" and "refactoring", and trying very hard to imagine what a wooden timebox might look like, found herself on the edge of a very slippery slope, and completely lost her footing. And before she knew it she had slid halfway down the hill! When she sat up, she found herself face to face with a large (but rather cute and friendly looking) snake.

"Have a nice trip?" said Fangs. "The footing is sometimes a bit manxome around here, especially around brillig when the ssssun gets in your eyes. But I'm frabjously glad that you seem to be uninjured." he said. "Perhapsss you should consssider increasing your coefficient of agility.", he mused, darting out his bifurcated tongue.

"You seem very clever at using words, Sir" said Alice. "Would you tell me the meaning of the poem called 'Beware the Agile Hype'?"

"Let'sss hear it", said Fangs. "I can explain all the agile poemsss that ever were invented -- and a good many that haven't been invented jussst yet."

This sounded very hopeful, so Alice repeated the first verse:

T'was brillig when the YAGNI'd code

did build itself ten times a day.

All flimsy were the index cards,

designs refactored clear away.

"That'sss enough to begin with," Fangs interrupted. "There are plenty of hard words there. Brillig means four o clock in the afternoon -- the time you begin broiling things for dinner."

"That'll do very well," said Alice. "And YAGNI? What's YAGNI'd code?"

"You Aren't Going To Need It", said Fangs.

"How do I know I won't need it if I don't know what it is?"

Fangs screwed his eyes shut. "No. . . YAGNI! YAGNI! YAGNI!"

"What are you doing?" Alice asked, concerned. "Are you quite alright?"

"Oh, it'sss perfectly okay," the slippery-slope serpent replied, opening his eyes to narrow slits. "You sssee, YAGNI is what I repeat when I want to avoid thinking."

"You mean YAGNI is an excuse for developers not to think?" asked Alice, surprised by her own insight.

"I shouldn't have thought to sssay it like that," he said, giving her a venomous look.

"And what about code building itself ten times a day? Whyever should it want to do such a thing?"

"You can't do consssstant rrrefactoring without an automated build processss," the snake hissed, getting into its (legs-free) stride.

Alice remembered that refactoring means to rewrite code that's already finished. "So the code has to rebuild itself in order to be rewritten?"

"How else could the code be rewritten, if not rebuilt after refactoring?"

"I see," said Alice, not wanting to be rude - though she really didn't see. "And anyway, wouldn't all that rewriting of finished code introduce vexatious problems?"

"We guard againsst vexatiousss problemsss with regressssion testsss," the snake hissed, its tongue tying into a knot of circular logic.

"So for every line of code you rewrite, you have to write a test?" asked Alice, who thought the idea more absurd than the idea of unemployment checks creating jobs.[86] "But surely the code actually does things? How can you keep re-running the tests without breaking something?"

"For continuousss tesssting we have mock objectsss. They keep the code from actually doing anything ussseful. And of course you can't tell the mock objectsss without an index card."

"Wouldn't that require a mock index card?" Alice retorted. "And how does that work, anyway?"

"I can't go into detail now, but I promise to tell you later."

"What do you mean?" asked Alice, whose brain was beginning to hurt.

"Now it's later so I can tell you. You write a ssstory on an index card, but unlike a real story it has no details. It isss just a promise for a future conversssation with the cussstomer."

"But what if the customer isn't around then? Why not write down the details while he's there?"

The serpent shook its head. "You poor, ignorant child, that would involve asking the customer to make up his mind, and we cannot demand such commitmentsss from our cussstomersss, or we would be deemed impertinent. Not only that but if the cussstomer made up his mind then the project might actually get done, and we can't be having that, can we? Don't you know that software is never done? Otherwise, we would all be out of work!"

'Twas Brillig and the Slithy Tests. . .

On and on hissed the snake (who had by now contorted his python-like form into a complete circle), explaining the circular "agile hype" logic to the little girl. Alice's attention wandered a bit during the explanation of snack food as a development methodology, and she noticed that a large unit test tree stood a short distance away from where she sat with the circular logic snake. The tree was covered with red unit tests.

As she looked, she noticed that a pair of programmers were working at it, busily painting the tests green, then cutting them from the tree and carrying them over to a large pile, which steadily grew towards the sky. The tree seemed to re-grow new red unit tests almost instantly, budding out from a single line of code. Alice thought this a very curious thing, and began to watch them as Fangs continued with his circular story.

After a time, she heard one of them say "Look out now, JoJo! Don't go splashing paint all over me like that."

"Sorry," said JoJo to Loretta.[87] "You keep bumping my elbow while I'm trying to code. We really need a two-keyboard workstation. But then who would drive and who would snooze?"

"That's right, JoJo. Always lay the blame on others!"

"You'd better not talk at the stand-up meeting!" said JoJo. "I heard Uncle Joe say yesterday that you deserved to go to the regression testing gulag, for not beheading the tests before running them on a headless server."

"Why are those index cards" (for that's what the pair of programmers looked like) "painting those red unit tests green?" asked Alice.

"Yessss," said Fangs. "It's the sssimplest thing that can posssibly work. We paintssss them green, we does, with mock objectsss. We just assssssert that everything's perfectly preciousss."

Alice, who was by now beginning to become very angry indeed, replied; "Why that's the most mind numbingly stupid idea I've ever heard. How are your regression tests going to help you avoid vexatious problems if you just paint the red tests green?"

"Painting the regressssion testsss green helps us avoid vexatiousss problemsss with managementss", replied the snake. "Since they don't really know what'sss going on anyhow, it's easy to convince them that all of our code is working by showing them the pretty green testssss. When the pile of green testsss reaches the sssky, it takes us to Sssshangri-La, where we can reach tesssting nirvana. Care for a bisscuit?"[88]

Just then, the rabbit sprinted past, wearing a tracksuit, and carrying a wooden box under his arm. "We're late, we're late" shouted the rabbit, "my timebox just went off! That's the end of the sprint!" He slowed his velocity enough to iterate in a circle, then opened the box, rummaged around and finally checked his watch as he shouted "So many tests, so little time, it will be a beheading for sure if the Queen finds out. Better start cloning mock objects. Oh dear, oh, dear."

"So that's what they call a timebox?" asked Alice.

"Sssshhhhh" said Fangs. "Not while he's gyrating. Anyhow cussstomers aren't allowed to ssspeak in ssstandup meetingsss, and you are quite unsssureptitiousssly ssstanding."

But before Alice could answer him, the Agility drum-beating began. The noise, like a raging torrent of hype, came from all directions. The air seemed full of it, and it rang through and through her head, louder even than an XP development shop, till she felt quite deafened.

From beyond the clearing a full pack of index-card soldiers ran through the trees towards them, their paper drums pounding as they chanted: "Smell the code! Smell the code!" The rabbit let out a frightened squeak and pitter-pattered from the clearing, muttering "Mary-Ann! Mary-Ann! Time to find a new customer, the burndown chart's gone through the roof and the house is burning down!" as the soldiers gave chase with a great clattering and drumming.

"If that doesn't drum them out of town," Alice thought to herself, "nothing ever will!"



[86] Special thanks to House Speaker Nancy Pelosi for providing us with a notion just as ridiculous as the idea of writing a test for every line of code so that you can rewrite the code (and rewrite each test, of course): www.foxnews.com/politics/2010/07/01/pelosi-unemployment-checks-best-way-create-jobs

[87] For more on the adventures of JoJo, Loretta, Fangs, Uncle Joe and his regression testing gulag "Camp Regretestskiy", we heartily recommend Extreme Programming Refactored: The Case Against XP.

[88] See "Green Bar of Shangri-La": www.theregister.co.uk/2007/04/25/unit_test_code_coverage

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset