I like this.
I do have some proposed rephrasing and re-arranging, but its less critique, and more suggestions.
You can take or leave most of it.
Proposed changes of bullets 1 & 2:
1. Design.
It forces you to think first about the design of the interface to the code, instead of jumping straight to the implementation.
Having a well-designed (and testable!) interface is often more important than having an efficient implementation.
2. Discipline.
Writing tests is often seen as a chore or an afterthought; writing the tests _first_ guarantees that at the end of the day you will have written enough unit tests to cover most or all of your codes functionality (rather than possibly never getting around to it).
Proposed changes of How does Exercism apply TDD?
We've done the work of writing a unit test suite for you.
Your goal is to write a solution that contains just enough code to make all those unit tests pass, and no more.
Should you choose to work with a mentor (and we encourage you to do that once you get the tests passing), they can help you refactor and refine your initial implementation, or even propose new unit tests.
Proposed changes to The tests are the requirements!
:
## The tests *are* the requirements!
Each exercise you work on will have some instructions describing in general terms what you need to do.
By design, these instructions do not account for programming-language-specific implementation details because they are shared by all of Exercism’s language tracks.
Sometimes, a language track will append more specific details for you, but it is not a requirement that they do so.
When you start working on an exercise, give the instructions a careful read.
They will give you a broad overview of how you go about implementing a solution.
But you will have to read the _tests_ to understand the full and exact requirements:
- Must the output be in a particular kind of data structure?
- Must the output be sorted in some order?
- How are you expected to handle exceptions? And so on.
You have solved an exercise when all the provided tests run and pass.
In other words, you are required to write a program that **satisfies the given tests**, not an interpretation of the instructions.
**The tests represent the complete requirements for the exercise.**
Proposed changes of the Working in the online editor
and Working locally
sections (also propose flipping the order):
## Working in the online editor
When you’re working in the code editor on Exercism’s website, you can read the tests but you are not able to edit them.
All tests will be executed each time you run them, regardless of any “skip” mechanisms noted in the test file.
Test results will default to expanding the first failed test message (although what is displayed varies by track).
Don’t be discouraged by a large number of failing tests.
Focus on making them pass one-by-one.
## What about working locally?
Many tracks use “skipped” tests in their test files.
Initially, only the first test is “active” and the remaining are deactivated (how this happens varies by track).
When you run the test suite in your environment, only the first test runs.
We do this to encourage you to follow this workflow:
1. Before adding any new code, run the test suite: you should see a failing test.
2. Add *just enough* code to pass the test.
3. Run the test suite. If the test still fails, repeat the last step.
4. Review your code and refactor as desired, making sure the tests still pass.
5. Once you have passed all the tests, congratulations you’re done!
6. Otherwise, “unskip” the next test and goto 1.
Exactly how tests are “unskipped” (or selected) depends on the track.
For some tracks, it might be commenting or removing an annotation.
For some tracks, it might be changing an attribute from true to false.
Take the time to read the track documentation: it will explain these details.
Propose moving The tests are the requirements
to right after How does Exercism apply TDD?
, since I think that message is more important than the details of working locally and in the editor. I also think that the working locally / working in editor should be at the same level as all the other headers – just toward the end of the doc, right above the Further reading
section.