|
|
|
|
|
by hawleyal
4148 days ago
|
|
I don't see how you can experiment with functionality by writing tests at all. Tests are basically just pseudocode. It's writing the requirement/interface before figuring out what is possible. For example. I was recently trying to figure out how to make an autocomplete list faster, as the database was too slow. I already had a functional test taking in search parameters and returning results. But there would be no way to write a test for the actual implementation of the indexed/faster search classes until I figured out a real approach. In the beginning, I had no idea if this would require a separate daemon process to do indexing, or if it could index realtime, or caching, or memoization, or where it might need to keep an index once created. These are just a couple of the unknowns. Once I figured out a workable concept, I wrote tests for those classes and functions. Then I refactored multiple times, altering the tests accordingly. |
|
You probably even "called your shot" and make guesses about what would be successful before you even approached the problem.
Then you wrote a test and saw whether your guess was right or not. If not, then you misunderstood something and you dug deeper.
Software, in some ways, in simulated science.