<commit_before>
Test-Driven no-Development
--------------------------

Short story of an epiphany
..........................

A couple of years ago my colleague @kr1 was silently coding when he erupted:
"Man, I can't believe I need to write something like this."

"I know [redacted JS framework name] is total crap.
I shouldn't have accepted to use it, I'm sorry."
I replied without turning.

"No, it's not that.
Have a look at this piece of code that I'm writing...
I'm sure it has been written before.
Probably verbatim. Probably dozens of times already."
His tone was unusually excited.

I turned and looked at his monitor. "Well, sure a lot of people need to do [some common task]."

"Exactly. It's a common task, but not common enough to be found in a library as is."
He remained silent for a few seconds.
"You see, sometimes I feel like we developers spend most of our time re-implementing code
that has already been written somewhere, we just don't know where."

"I see your point...
Let's hope no one builds a search engine for code then.
Or we would be out of business in no time! Ah, ah!"

"That is precisely the point: there's no way to search code by features."

We turned back to our screens, but something had clicked in my mind.

"You can write a test." I said after a few minutes.
And that was my time to be unusually excited.

"What for?"

"To search code by features.
You write a test suite that asserts the features you want from a piece of code.
Then you run your tests on all source code on the internet and
if something passes the test suite it's the piece of code with the features you were looking for."

"Interesting."

"It's like Test-Driven Development, but without the development thing."
I said.
"And since you are going to write the tests anyway,
searching this way it's quite cheap, it doesn't require much additional effort."

"Running a test on, say, all the code on github it's not going to be easy, thou.
You need a lot of resources."

"But it's just processing time... Ah, ah, I sense we have some start-up material in our hands."<commit_msg>Add a reference and improve the prose of tdnd doc.<commit_after>
Test-Driven no-Development
--------------------------

Short story of an epiphany
..........................

A couple of years ago my colleague @kr1 was silently coding when he erupted:
"Man! I can't believe I need to write something like this."

"I know [redacted JS framework name] is total crap.
I shouldn't have accepted to use it, I'm sorry."
I replied without turning.

"No, it's not that.
Have a look at this piece of code that I'm writing --
I'm sure it has been written before. Possibly dozens of times already.
I wouldn't be surprised to find it verbatim on GitHub."
His tone was unusually excited.

I turned and looked at his monitor. "Well, sure a lot of people need to do [some common task]."

"Exactly. It's a common task, but not common enough to be found in a library as is."
He remained silent for a few seconds.
"You see, sometimes I feel like we developers spend most of our time re-implementing code
that has already been written somewhere, we just don't know where."

"I see your point...
Let's hope no one builds a search engine for code then.
Or we would be out of business in no time! Ah, ah!"

"That is precisely the point: there's no way to search code by features.
I remember reading a wild proposal about something like that
by `<NAME> on the erlang mailing list`_."

We turned back to our screens, but something had clicked in my mind.

"You could write a test." I said after a while.
And that was my time to be unusually excited.

"What for?"

"To search code by features.
You write a test suite that asserts the features you want from a piece of code.
Then you run your tests on all source code that you can find on the internet and
if something passes the tests it's the piece of code you were looking for."

"That's interesting."

"It's like Test-Driven Development, but without the development thing."
I said.
"And since you are going to write the tests anyway,
searching for an implementation this way it's quite cheap,
it doesn't require much additional effort."

"Well, running a test on, say, all the code on GitHub it's not going to be easy, thou.
You need a lot of resources."

"Yes, but that it's just dirty cheap CPU time --
We might have some kind of start-up material in our hands."

.. _`<NAME> on the erlang mailing list`: http://erlang.org/pipermail/erlang-questions/2011-May/058768.html
{'fraction_non_alphanumeric': 0.08351942831621259, 'fraction_numerical': 0.0026797677534613666, 'mean_word_length': 3.43026706231454, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5123146', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1169, 'n_words': 765}