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
What is TDD?
Software development process that relies on the repetition of a very short development cycle
What does integration testing do?
Tests that different components of a software work together as a group
If we need to do integration testing but all components aren’t finished, what can we use?
Stubs or drivers
What is the difference between bottom up and top down integration testing?
Top down starts at the top of the module hierarchy, bottom up starts with modules that have the least amount of dependencies
What is the Big Bang approach to integration testing?
Waiting until all of the components are finished to test
What are APIs?
Entry-point to an application
What are two examples of APIs exposed over a network? (Web services)
-REST
-SOAP
Why do we need to test APIs?
To verify business logic verification, data integrity and correctness
What is Swagger used for?
API testing
How is API testing similar to Unit testing?
-AAA pattern
-Avoid anti patterns