testing Flashcards
(9 cards)
1
Q
Types of testing in terms of purpose
A
- Functional testing
- User testing
- Performance and load testing
- Security testing
2
Q
functional testing
A
- unit testing
- feature testing
- system testing
- release testing
3
Q
Black-box
A
- equivalence partitioning
- This involves the identification of sets of inputs that will be treated
in the same way by the program - Example: testing a function that checks simple names according to the
following rules:- The length of the name should be between 2 and 40 characters
- The only nonalphabetic separator characters allowed are hyphen and
apostrophe. - Names must start with a letter.
- This involves the identification of sets of inputs that will be treated
4
Q
boundary value analysis
A
- Boundary value analysis is based on testing the boundary values of valid and invalid partitions.
- The behavior at the edge of the equivalence partition is more likely to be incorrect than the behavior within the partition.
- For each input, we check:
● Minimum value
● Just below the minimum value
● Just above the minimum value
● Maximum value
● Just below the maximum value
● Just above the maximum value
5
Q
White-box
A
- statement coverage testing
- Statement coverage is a technique in which all the executable statements in the source code are executed at least once.
- Statement coverage = number of executed statements / total number of statements x 100
- branch coverage testing
- A branch is the outcome of a decision (e.g., an if statement and a loop control statement), so branch coverage simply measures which decision outcomes have been tested.
- Branch coverage = number of executed branches / total number of branches x 100
6
Q
Test automation
A
- Automated testing is based on the idea that tests should be executable.
- An executable test includes the input data to the unit that is being tested, the expected result, and a check that the unit returns the expected result.
- You run the test and the test passes if the unit returns the expected result.
7
Q
Automated tests
A
- It is good practice to structure automated tests into three parts:
- Arrange: You set up the system to run the test. This involves defining the test parameters.
- Action: You call the unit that is being tested with the test parameters.
- Assert: You make an assertion about what should hold if the unit being tested has executed successfully.
8
Q
Test-driven development
A
- Test-driven development (TDD) is an approach to program development that is based around the general idea that you should write an executable test or tests for code that you are writing before you write the code.
- Test-driven development works best for the development of individual program units.
9
Q
Given a functionality the system should have:
A
- Identify partial implementation: Break down the implementation of the functionality required into smaller mini-units. Choose one of these mini-
units for implementation. - Write mini-unit tests: Write one or more automated tests for the mini-unit
that you have chosen for implementation. - Write an incomplete code that will fail test: Write incomplete code that will be called to implement the mini-unit. You know this will fail at first.
- Run all existing automated tests: All previous tests should pass. The test for the incomplete code should fail.
- Implement code that should cause the failing test to pass: Write code to implement the mini-unit, which should cause it to operate correctly.
- Rerun all automated tests: If any tests fail, your code is probably incorrect. Keep working on it until all tests pass.