Readme-Driven Development (2010)
tom.preston-werner.com
tom.preston-werner.com
It's very important when you're building something that you answer both questions in your test activities. So you might write your Readme for your new project, and then as a validation activity before you build your project you shop your Readme around to the target audience of the tool and ask them if the tool sounds useful. You might also elicit feedback about how features could be more useful, or if there are other features that could be added.
From your Readme and your initial validation, you start an initial architecture of the system, laying out the pieces you think you'll need and describing how they will interoperate in broad strokes. Other developers can join you at this point, and knowing your architecture design and implement specific pieces of the tool. All design work references the Readme as a functional specification. And all of your verification activities verifies that the design was implemented and that the implementation satisfies the Readme.
As you're iterating and building new functionality, you integrate periodically and perform validation and verification against integrated versions of your system. And the verification tells you that you're following your Readme, while the validation tells you that your users indeed find the tool that you spec'ced useful.
The only real difference between Waterfall and Agile in this model is the cycle time. Waterfall has a very long cycle time in the specify-design-implement-test-validate cycle, whereas Agile has a very small cycle time. And so the chunks of the system vary in scope as well.
- validation is checking that there exists at least an end user who will need what you are building;
- verification is checking that what you have built so far will meet or continue to meet their needs and other end users similar to them.
https://www.allthingsdistributed.com/2006/11/working_backwar...
Even later, when TeX completely changed between its earlier version (the one written in SAIL, aka TeX78) and the current version (written in WEB, aka TeX82), the program has completely changed, but the manual he wrote for TeX78 is still very similar to the latest version of The TeXBook. Since declaring TeX "done", he's generally been willing to make only changes that don't change The TeXbook much.
Yeah I never got in gear with CWEB either.
In particular, I've been picking up The Stanford Graphbase book recently and finding that after I have gotten used to reading more parts, the programs are getting a bit easier to understand. In ways that don't litter my mental model with tons of surface complexity.
What I mean by that is that if you look at the javadoc or "function/method" base of a complete system, it is easy to lose site of the whole. Granted, getting started with the larger texts of some other documents can have similar problems in reverse. It is hard to really get a handle on where in the system you are to start.
Also thanks for the reference.
If you pick up a copy, have fun reading it! :)
I also recommend reading some of the programs he has posted to his site. I have not picked up the rendering book done in a literate style. Is on my ambitions list.
So many times I've looked at a peer's code and had a hard time reconciling what the comments and wiki articles said with what their code was attempting to do.
This mindset is probably a godsend to QA teams.
/** @brief Prints character ch with the specified color
* at position (row, col).
*
* If any argument is invalid, the function has no effect.
*
* @param row The row in which to display the character.
* @param col The column in which to display the character.
* @param ch The character to display.
* @param color The color to use to display the character.
* @return Void.
*/
void draw_char(int row, int col, int ch, int color);
Here is the class's guide to doxygen https://www.cs.cmu.edu/~410/doc/doxygen.htmlso for a given method or class, you have a couplefew paragraphs which explain how to use it, with invocations that are run as part of the test suite.
sometimes there end up being too much acrobatics for this to be as useful as i'd like, but the basic idea is really neat, IMO.
If you are a public library it also results in the infuriating situation of knowing an API will do what you want but not knowing how to get a parameter or class it requires.
When creating the project, I put in the README a general description, project goals, a TODO list, contact info (email...), requirements (like node, ruby...). Often, I write the readme, and leave the project a few hours to a few days, when coming back, I read the readme and it should "enlight" me.
For example, the same product will be paraphrased in different ways by your customer, your marketing dept, your business team, your tech team, etc.
On the contrary, Amazon had been quite successful with their 'Working Backwards' model of development because they always document from the customer's perspective. This I believe is the right approach.
I have created my own model on the above premise to make SaaS product development more effective. You can read more about it here - https://medium.com/jugaads/the-stoics-cube-for-saas-product-...
When I was writing out the examples and trying to see them through the eyes of a new reader, I noticed that some simple tasks took too many lines of code, and would be a turn-off to potential users of the engine.
I felt like I should get this down to N lines, and that led me to revising the API until it could be illustrated in "prettier" examples (though there's still some work to be done.)
So yes, writing out the documentation and looking at it while "away" from the project (e.g. reading it on another device, an iPad in bed in my case, rendered on GitHub etc.) can definitely help you improve other parts of the project.
- "Stay away from the computer" - Start by asking: "what is the problem?"
BDD is almost a poisoned term at this point because it’s become associated with tooling and opinionated holistic processes. But if you think of Specification by Example as readmes with a Given-When-Then structuring, then you have a strategy (document before writing) combined with a language definition to assure your strategy is executed at the right level of detail. Which solves the entangled problem of what do I do first (document) with what level of detail (enough to describe all the input behaviors to whatever I’m working on)
in all the teams I worked most successful were ones that insisted on writing wiki / readme pages for each feature and task...
why?
1) project manager (person knowing why we're building) has to do fair amount of explaining to the developer 2) it's easy to verify that developer understands what he/she needs to develop 3) everyone else in the team can easily update themselves
my template was something like this
1) what has to be built 2) for whom - who is the typical user and scenario 3) who will built it and which branch on git 4) what app parts will be changed 5) any information related to deployment (database changes and similar)
doing it upfront meant a lot to the team, discussions and clarity... I would just call this more Wiki development then readme :)
I have seen many engineers write libraries without first having a clue how does using the library would look.
Code examples are very important in these situations.
The main issue I've found is that some times I like the docs I wrote, but I don't do the implementation and feel like I wasted my time by documenting too much. These times it might be because it was just a thought experiment, a wild idea tat I had to write down or I just have other priorities.
I’m not trying to be a jerk here, but TDD does just that. I tried to read the rest of this, but the logical fallacies are strong with this one.