Testing is something which new developers do not focus on as they take time to setup themselves and again take time to write down.
What to Test
First thing is to be sure what to test. Ideally your tests should be analyzed for code coverage and everything should be covered in unit tests. End to End (E2E) tests however should cover all business use cases as per the requirements / specifications. This should include negative testing as per user behavior expectations.
Choosing when to auto-test
Testing is very important for applications in any one of the following scenarios
– Application is planned to be upgraded / maintained after deployment in live environment.
– There are more than one developers developing the application and application is complex.
– Application development plan is a long and features will take considerable time to develop , you will forget what initial features actually did.
– you are comfortable with a testing suite and have used one in the language you are coding
However if your development does not fall into any of the above categories, you may chose to skip automated testing if you are confident that you will do a thorough one time testing.
When not using automated testing
When you chose not to do automated testing, make sure you do manual tests of code as you develop each feature and only finish a feature once you have tested it in all aspects as per requirement. that means spending that little bit extra time while developing and some extra time at the end of the development to round up the requirements.
When to start adding Tests
Test driven development is good and useful in some scenarios. That means writing the test(s) first and then coding until all tests are successful. A nice tool doing auto-tests in background as you save the document helps speed things up.
For the other type of users , adding tests is important as soon as you start modifying a functionality. That means you only write tests once you revisit a function for further enhancements. That means you only write tests if your application becomes complex enough and skip testing part in initial stages where you might even scrap the idea or the framework you are using.
chosing a testing framework depends on the language you are using and there are tonnes of choices.
Important points to consider when chosing a testing framework are
– usage examples with your choice of languages available to ensure it can work the way you need it to
– You may use one or 2 separate frameworks to run both e2e tests and unit tests.
– ease of use , written in a language you can understand
– has high acceptability in the community for your choice of language.
Even though you have written unit tests, e2e tests and verified that you have sufficient code coverage, you will still need to do user testing that will help you find important information that can help improve your application. Initially friendly user testing and later on proper user feedback will be helpful to cater to these requirements.