Why do you write automated tests?
Why do you write automated tests?
Many people say "to find bugs" but it is not true. Tests are not looking for bugs. They just verify correspondence of actual and expected results.
- So? Where is the “looking for bugs” here?
-No, I haven’t seen.
Some time ago I had a conversation about unit and integration tests with one of our developers. In the result we've come to conclusion that they are writing tests to verify contracts between components for convenience, access, usage of the defined data types and some other aspects.
Many people say "to find bugs" but it is not true. Tests are not looking for bugs. They just verify correspondence of actual and expected results.
- So? Where is the “looking for bugs” here?
-No, I haven’t seen.
Some time ago I had a conversation about unit and integration tests with one of our developers. In the result we've come to conclusion that they are writing tests to verify contracts between components for convenience, access, usage of the defined data types and some other aspects.
When you are writing a new code the test will be your first client. If it is easy and comfortable it means that everything is fine.When you are writing test on existing code but facing issues all the time and have to write a lot of workarounds it means that existent code is crap and it requires improving it.
The same is applicable for other automation tests written by testers. You are writing them on the framework which works with the application. Bad framework will just make process of writing autotest more complex. (If you don’t have a layer with the framework it means that it is probably already included into the test tool you are using or you need to start thinking about implementing it in the nearest future)
You can ask “Why do we need to write tests if they are not looking for bugs?”
The answer is very simple:
- Test verifies that "test runner" can go from the start till the end point of test. If he cannot do it it's an indication that something is wrong, but it is not always a bug. It can be:
Thereby the second purpose of test is to signal the situation when "test runner" can NOT go from the beginning to the end of scenario and it is already your task to determine the cause.
You can ask “Why do we need to write tests if they are not looking for bugs?”
The answer is very simple:
- Test verifies that "test runner" can go from the start till the end point of test. If he cannot do it it's an indication that something is wrong, but it is not always a bug. It can be:
- Temporary infrastructure issue
- Misconfiguration of test environment
- Quality of the test (it wasn’t updated after application code changes, invalid scenario, incorrect test data)
- And only in the end it can be a bug.
Thereby the second purpose of test is to signal the situation when "test runner" can NOT go from the beginning to the end of scenario and it is already your task to determine the cause.
Comments
Post a Comment