#Choosing the right testing approaches

3 messages · Page 1 of 1 (latest)

spring glade
#

Hi,

I know the difference between end-to-end and unit testing and it's bad practice to do tests later, no need to give me a lecture on that
I will tell you my story first: I have an web app, build with Flask and Svelte, where Flask is acting like an API, and JS is doing all the requests - long story short, no SSR or such. I'm not thinking of how much of my application should I test with unit tests and end-to-end tests.
Right now I'm thinking that API endpoints should definitely be tested as units, some UI parts (form validation, displaying the data my app has got from Flask) as unit tests, and the latter, aka all the other interacting with all db, frontend, backend (choosing a date from a calendar, searching by name, sending form) would all be end-to-end tests.
I'm asking if this would be suitable testing for my app? Or should I dump UI tests and do these as end-to-end as well?

azure spruce
#

unit tests are usually limited to testing a particular function/class, not the whole endpoint. but doing unit tests on your different functions, then maybe some general end to end/integration tests doing some negative tests and positive tests against your endpoints. also if you do UI tests with it connected to your backend, I think it's suitable to call those end-to-end tests and do those instead of testing directly against your endpoint, though you will probably miss some negative test-cases doing it this way

spring glade