Get the basics of automated testing, why do we have to automate, what are the best practices , how to test legacy applications. How developers can adopt testing methods.
2. TESTING 101
WHAT ARE WE COVERING TODAY
โธ Why do we have to automate testing
โธ What are the qualities of a good test
โธ What are the different types of testing methods
โธ Real tests
โธ Strategy for legacy applications
3. TESTING 101
WHY DO WE HAVE TO AUTOMATE TESTING ?
โธ Repetitive and causes fatigue
โธ Time consuming
โธ Developers are usually gentle on
what they have developed
โธ Under delivery pressure
4. TESTING 101
QUALITIES OF A GOOD TEST
โธ Repeatable: Able to run it several
times with ease
โธ Easily Understandable: Donโt put
too much logic in test => 1+2 = 3
โธ Speci๏ฌc: A failure should indicate a
narrow spectrum where things
could have gone wrong
โธ Fast: Gives feedback within
minutes (and not hours)
5. TESTING 101
TYPES OF TESTS
โธ Unit Testingโจ
Smallest function tested in
isolationโจ
(public methods in a class)โจ
โธ Integration/Acceptance Testingโจ
Functionality as seen by end userโจ
(features - Bonds, OCBC, Real
Estate, Sync)
8. TESTING 101
INTEGRATION TEST SETUP
โธ Launch script
โธ Set environment to โtestingโ
โธ Use test database from Tests folder
โธ Use Api-data from different folder
โธ Kills existing server and test runtime (if running)
โธ Start server
โธ Insert seed data (user, daily exchange rates and equity master)
โธ Run test
โธ Clean up (delete test db, reset environment to development)
9. TESTING 101
WHAT MAKES AN INTEGRATION TEST
โธ Feature test written in English
sentences(feature_name.feature)
โธ Map the sentences to method calls in python (testing.py)
โธ Launch Browser
โธ Background (test data and test setup)
โธ Login
โธ Scenario (assertion)
10. TESTING 101
STRATEGY FOR LEGACY APPLICATIONS
โธ Start adding integration tests to cover key ๏ฌows
โธ All new features should have associated integration tests.
This will be ensured as part of code review.
โธ Integrate integrations tests with code review process
โธ Dev team to take ownership of tests and not rely on one
person.