I'm just wondering how many people add tests to their MVP?
What sort of test. Do you just add integration or unit or end to end or all.
I'm really interested, what is your attitude to testing, do you think it slows you down?
I'll go first and say for my MVP I'm not adding unit testing, because my time is limited and I plan on paying back the tech debt if I get enough approval from it. I know how to develop faster without a TDD approach and I'm not ashamed of saying that.
It's tempting to skip testing, but I think that's a wrong choice.
Testing functionality manually often takes just as much time. Why not just write the test script, that you can keep using going forward?
Keep in mind: MVP doesn't mean low quality.
In my day job I write tests all the time. Being a solo Dev on a side project I know the code inside out. I know there is tech debt, if one day someone joins me on my project or it gets enough interest then I'm totally going to pay the tech debt. It's an office addin and I have been looking into ways to create automated tests
This. Depending on the complexity of your product it might be faster to test independent components instead of going through 5-10 manual steps each time.
Even more so, because you won't be going through those 5-10 manual steps every time.
At SEOly, we decided to write as little code as possible until we have firm validation of the solution. This means that we've sacrificed quite a bit of the usually code quality metrics in favour of business development.
Testing was not one of the things we sacrificed. We never aimed for 100% code coverage (since I believe it's a pointless metric anyway), but we do tend to focus mostly on integration tests. We use an outside-in testing strategy, aiming to cover as much spec room as possible with as fewer tests as possible.
Let me know if you want me to elaborate on any of this
I agree if you hit 100% then that is a bit of a red flag, possibly testing things just for the sake of testing
There's this concept that developing with tests slows you down but, in reality, I think that's just people that are not used to write automated tests. When you develop code, you still spend time starting the services and manually testing. It would be a lot better if if you automated the process, wouldn't it? :) I'd say core functionalities should all be tested, either you go with end-to-end, or unit tests.
I think end to end offer the greatest value upfront for smaller projects
Test the core functionality that keeps my MVP alive.
Thanks for all the replies everyone, some really cool insight here
Regulary I write only test for very complex logic to be able to change it later without the risk of breaking it.
For backend applications I would add some postman because the effort of implementing those is low and it provides a basic safety net.
I skipped in the beginning until every change I made added regressions.
It's clear that I was being slowed down from not testing.
Overall, it depends a lot on the product.
Something that the more engineering-minded won't agree: don't unit test.
Write good Cypress tests on the most important parts of your application. Write tests that give you confidence and skip the non-essential.
Integration tests in their classic definitions are usually too synthetic and miss out the edge cases, in my opinion.
I prefer unit testing the core, most important logic (getting to full coverage for the deepest business logic while neglecting the rest makes sense to me), and using two flavors of system tests for the rest:
This sums up a lot of my thinking: https://kentcdodds.com/blog/write-tests
Tests should give me confidence in my application, but I also want to iterate relatively quickly, so I try and balance that.
I don't write unit or integration tests at all for now. But I do loads of exploratory tests as I change things and I use my own app a lot. I am a single developer, and I don't intend on changing this until someone else joins the team and has to understand and touch the code, in which case tests will be very useful.
I feel the same way, I'm a solo Dev and if someone comes along that needs to touch it then sure. In the end if it succeeds and gets people to sign up then I'll start adding integration tests but that's a long way off
I test when it makes sense. TDD helps me about 50% of the time and when it does, I'm glad I'm doing it.
Don't follow a hard or fast rule. The ROI of testing in the early stages fluctuates based on numerous factors. Some that come to mind are:
So, the answer is, it depends! 🤷♂️
So much about Dev is "it depends" and I totally agree with the above. In my day job I unit test all day long, I think with my project though and being a solo Dev it's a labour of love. If it becomes successful and by that I mean gets enough interest then it would be wholly irresponsible not to add both unit and automated end to end tests
Any complicated/hard to understand/easy to get wrong business logic: Full unit tests.
A component where a lot of bugs seem to be popping up for end-users: Integration tests to ensure correct behavior and ensure regressions don't occur.
If my testing preferences were a pendulum swinging, I'm currently on the lighter side of things. I used to go for 100% unit test coverage with lots of integration tests, and it's not clear to me that they always pay off. Especially in an MVP scenario, where the underlying concept can shift dramatically in a short period of time, you just end up writing a bunch of tests that you immediately throw away.
For personal stuff, my philosophy so far is to test when:
A little bit different opinion here.
I used to write every single tests for both my front and back end codes.
Then I refactored almost entirely my app so that the relevant parts that were tested become deprecated.
And I just caught myself refactoring or changing some features primary behaviors, that lead to a lot of tests rewritings.
So I just decided to stop completely for a while writing tests. I’m aware that I should be writing tests for at least the most crucial parts for my app, but there is just no easy way to test automatically something like Apple Sign In with FaceId, where you ended up just mocking fake authentication without truly test it out.
So now, my app has zero tests written and is at the moment not an MVP, just an app with a few hundreds of MAU.
Instead what I did is to integrate Sentry, to send me in real time errors that happened in the app, and send me directly a Slack notification.
That way, I know exactly where the app bugs/crashes, so I can know the root and fine tune my code.
I consider that within the app there are things that are worth testing (authentication, first onboarding experience etc) and things that are okay not to tests and when it bugs a little bit (a button that randomly doesn’t work the first time you click but does so when reclicking, okay that’s a bad example but you get the idea).
That helps me speeding up the app development, since I’m still at the “features exploration” kind of phase 😯
That is a really cool idea integrating with slack. And yes with creative code or exploring what you're going to build it's easy to double your effort. I'm in the same boat. Thanks for the insight
Yes but mostly for client work or when a project reaches a certain point, a quick MVP I wouldn't bother. I'm not too strict about my test definitions, they're mostly unit tests but I often let them creep into more integration style tests where I'm setting and tearing down databases etc since I find this gives me the most bang for my buck so to speak and tests that the whole system works. I tend to focus on model type code and business logic, I try to build UIs that are logic-less as much as possible and therefore wouldn't bother testing them.
Do you test?
Yes, yes, yes. I don't have the luxury to not have automatic tests.
Do you test MVP?
Here your main goal makes the product as fast as possible. Usually, MVP is not a big product that has only a few features where can be tested by hand. But the moment after you validate MVP next release must have some test coverage.
I would say it depends what your mvp is validating, most of the time it is to validate idea hypotheses and audiences etc. But if you're sure what to build, then you can spend more time on technicals.
This comment was deleted 6 years ago
Totally agree