Would you guys invest time in testing properly your app with TDD or other methods while bootstraping a complex solution, for 2 dev or more i think you must but as a single dev its iffy
I think the IH way is just do what is more productive for you.
If manual testing and clicking around after a tiny change is not a problem for you - ignore tests.
My approach would be
As a backend dev, I noticed that I am very slow without tests. Unit tests give me the assurance that what I built works well as expected and doesn't break existing features. I would not want to go about manually testing other features when I add a new feature.
I recently build an MVP to validate an idea and it had good tests. My partner thought it was a waste of time but to me it was a good time investment. I wouldn't want to open Graphiql or postman every time and keep meddling with those headers just to test that my new endpoint works, that's a lot of context switching and if I swipe to the right instead of the left and land on Twitter, now I have another battle in my head to fight, check that DHH tweet or continue coding.
There is no such thing as "throw-away code". That implies that the POC/MVP/basic working example you build will be discarded as soon as you validate the idea. Are you planning on completely rewriting the codebase once you validate the idea?
It's like brushing your teeth or exercising. Build the habit from the beginning then there is no extra cost (mental or time) because you already do it.
TDD is the only development methodology I've found with actual, documented proof of improving your ROI. The hard part is building the habit of doing it from the start.
I do have to ask, why, as a single dev is it iffy?
As a team of devs working on same project there is much more probability to break stuff without noticing , when you are a competent single dev you could easly detect fragile areas while working on them and test them manually but in the end we all know when you move forward quickly you break stuff, so thats the iffy part
If it is a complex solution, I don't think I agree. I assume that when I am a few weeks removed from a given piece of functionality, working on a different piece of functionality - that I will forget at least some of the details of my prior work. It's almost a running joke with many developers that I know. "I don't remember, that was last month. What do the tests say?"
I have encountered a few developers over the years that have much better recall of the details of their prior code. Just not very many of them.
I would be very interested to see the "actual, documented proof of improving your ROI"
This is really interesting.
I'm totally up to testing, this is super important for mature products. But what ROI improvement proof do you see? The fact that if something breaks, it's easier to debug?
This SO question has several responses that are a good starting point to find out more information: https://stackoverflow.com/q/237000/1222805
This comment was deleted 6 years ago
As I said, "only development methodology I've found". I'm digging into code reviews and pair programming now to see what I can find.
If you can provide any links, that would be awesome.
I found these entries in Wikipedia that have some citations:
https://en.wikipedia.org/wiki/Code_review
https://en.wikipedia.org/wiki/Pair_programming#Studies
For me, testing is a matter of return on investment, or how the cost (in hours, dollars, or whatever) of validating the code compares to the potential loss from a failure.
The rule I've generally used (on my own/as a contractor/as an employee) is that code expected to bring in money (literally or indirectly) needs some sort of validation, with more attention/rigor warranted for more money. Anything else, I judge by how inconvenient it would be (for me, specifically) if the code fails. If it doesn't meet either of those criteria, it'll get tested in its normal usage.
Are you scaling your product? If not, no. You should be focusing on validating the product and getting to product market fit. Investing time into testing is a waste if that code is throwaway. If the software is complex find a way to simplify the concept and do things manually until you know for a fact customers want that thing enough to pay for it.
I'd still do it. TDD isn't just about investing in tests, it's about investing in good design. But there's an art to it. Testing the right things is productive. Testing the wrong things can seize up a codebase and slash productivity.
I wouldn't get bogged down worrying about coverage percentages or following a strict tests-first approach. I do think that having some tests (and error reporting!) improves my "ship it" confidence: can I write some code, release it, and move on to something else really quickly without worrying about whether I just broke something important in a flow I can't easily test manually? I don't want to hesitate to do a release several times a day because I need to manually test things.
This comment was deleted 6 years ago