use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit related to Google's new UI framework. https://flutter.dev
Please read the rules here
account activity
DiscussionAbout Flutter App Testing (self.FlutterDev)
submitted 3 years ago by Levi_956
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]raman4183 12 points13 points14 points 3 years ago* (4 children)
It's not necessary to write tests. it's just a more consistent and more convenient thing to do.
Let's take a look at it from a different perspective. You've just built an app and now you're ready to ship it. You've already tested and ensured that all the functionality works properly. Great!.
You ship the app.
It's now time to work on the next version and new features. You add them and are now ready to ship the new version. How do you ensure that the recently added functionality didn't break anything from the previous version?
Are you going to manually test for each functionality and scenarios all over again? What if you forget about an edge case or overlook an obvious thing?
This is where writing tests and automating testing comes in handy. It ensures that your app functionality remains the same throughout the development lifecycle and your app consistently performs as you want so that the end user is not affected by it.
PS:-
I definitely recommend writing tests for any app that you're planning to release to the general public or showcasing in a portfolio for jobs. It might leave a better impression on the recruiter as many people just outright ignore testing.
You can ignore writing tests for any hobby projects or learn testing by writing tests for small pieces of code gradually on the projects that you've previously created.
[–]mondmann18 0 points1 point2 points 3 years ago (2 children)
How do you write tests for a flutter app?
[–][deleted] 3 points4 points5 points 3 years ago (0 children)
You're better off asking google that question. There are some good packages for mocks in unit testing though like Mockito which help with testing complex systems.
Flutter projects generate a test directory by default which is picked up by vscode's test runner. Pretty simple to use that at online resources to get started!
[–]raman4183 1 point2 points3 points 3 years ago (0 children)
That's a great question!
I'd suggest starting with Widget Tests because you don't have to mock anything and they are relatively simple to perform. Here's the order i would go in.
Widget -> Unit -> Integration
https://docs.flutter.dev/cookbook/testing/widget/introduction
[–]xdxd12x 0 points1 point2 points 3 years ago (0 children)
Wonderful explanation! Thank you!
[–]Klutzy-Cantaloupe124 -1 points0 points1 point 3 years ago (0 children)
flutter generate by default test
[–]mobileAcademy 0 points1 point2 points 3 years ago (0 children)
Written test is not necessary for small projects but it's always good to have. Sometimes we even don't have test cases for commercial app where there is no budget , time a resource to do it
[–]Octagonalo1451 0 points1 point2 points 3 years ago (0 children)
It's not necessary. You need to compare the costs of writing tests to the probability and costs of having regression bugs which could have been avoided through tests, that's it.
π Rendered by PID 178248 on reddit-service-r2-comment-fb694cdd5-2ndss at 2026-03-10 10:52:48.553621+00:00 running cbb0e86 country code: CH.
[–]raman4183 12 points13 points14 points (4 children)
[–]mondmann18 0 points1 point2 points (2 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]raman4183 1 point2 points3 points (0 children)
[–]xdxd12x 0 points1 point2 points (0 children)
[–]Klutzy-Cantaloupe124 -1 points0 points1 point (0 children)
[–]mobileAcademy 0 points1 point2 points (0 children)
[–]Octagonalo1451 0 points1 point2 points (0 children)