Lecture 3 Flashcards
Why does testing need to be automated?
Manually testing sofware is inefficient, expensive and will have huge impact on metrics such as lead time for changes, change failure rate
Why does DevOps adopt the ‘Shift Left Testing’ approach?
Because the closer to production you are, the more expensive defects will be to fix
What is an example of a local environment?
A developer’s own machine
What is a development environment?
The first environment the code reaches after leaving the developer’s machine
What is a staging environment?
Should be as close to the production environment as possible
What is the production environment?
Where you serve customer traffic
What has a larger number of tests, unit tests or E2E tests?
Unit tests
What has more integration/execution time and higher costs, E2E tests or integration tests?
E2E
What is unit testing?
A way of testing small units of code that will be logically isolated in a system
What is an example of a type of testing that’s relatively cheap and fast?
Unit testing
What are examples of different frameworks used for writing automated tests?
NUnit, JUnit, Pytest
What are the main features of a test framework?
-Library
-Test runner
-Reporting
In the context of unit testing, what does code coverage mean?
To what degree the unit tests executes the source program
What is important to remember about the reliability of code coverage?
Just because the code coverage of a test is 100% that doesn’t mean every possible behaviour can be predicted; code coverage can be 100% but doesn’t test to see what happens if we divide by 0 for example
What is the difference between statement coverage and branch coverage?
Statement coverage means all lines of code are executed, branch coverage can be all if-statements for example