Commit ea996dc1 by Dinh Thanh Truc

Update BasicTesting.md

parent c0d46184
...@@ -4,13 +4,99 @@ ...@@ -4,13 +4,99 @@
3.Experience-based testing:it is based on the experience of technical, business and similar systems 3.Experience-based testing:it is based on the experience of technical, business and similar systems
4.Gray-box testing: have some knowledge of the internal structure but not in detailed to design test cases and test the application from the outside 4.Gray-box testing: have some knowledge of the internal structure but not in detailed to design test cases and test the application from the outside
## Simple techniques ## Simple techniques
-Specfication-based testing (black box): - Specfication-based testing (black box):
1.Equivalence partitioning:divide a set of test conditions into groups or sets that can be considered the same ( the system handle them equivalently). We need test only one condition from each partition. If one in a parttion does not work, we assume none in that partition work. You may try more than one value from a partition. 1. Equivalence partitioning:You divide a set of test conditions into groups or sets that can be considered the same ( the system handle them equivalently). We need test only one condition from each partition. If one in a parttion does not work, we assume none in that partition work. You may try more than one value from a partition.
Ex:Test the software that calculate the interest due, identify the range of balance values that earn the different rates of interest. $0-$100: 3% interest rate, $100-$1000: 5% interest rate, >=1000$: 7% interest rate. Ex:Test the software that calculate the interest due, identify the range of balance values that earn the different rates of interest. $0-$100: 3% interest rate, $100-$1000: 5% interest rate, >=1000$: 7% interest rate.
Invalid partition Valid (3%) Valid(5%) Valid(7%) * Invalid partition:-$0.01
* Valid (3%):$0.00-$100.00
* Valid(5%):$100.01-$999.99
* Valid(7%):$1000.00
-$0.01 $0.00-$100.00 $100.01-$999.99 $1000.00 2. Boundary value analysis:it is based on testing at the boundaries between partitions
- White box Ex:The same as the previous example. The boundaries will be: -$0.01,$0.00,$100.00,$100.01,$999.99,$1000.00
\ No newline at end of file
3. Decision tables: Combine the input conditions and indentify the outcomes.
Ex:If you are a new customer opening a credit card account, you will get a 15% discount on all your purchases today. If you are an existing customer and you hold a loyalty card, you get a 10% discount
New * * * * * |T |T |F |F |
Loyalty * * * |T |F |T |F |
Discount % |X |15|10|X |
4. Use case testing: Use cases describe the process flows through a system based on its most likely use. This makes the test cases derived from use cases particularly good for finding defects in the real-world use of the system (i.e. the defects that the users are most likely to come across when first using the system)
- Structure-based testing(white-box):
1. Statement coverage and statement testing:
__Statment Coverage=(Number of statements exercised/Total number of statements) X 100%__
Ex:
1 READ A
2 READ B
3 C =A + 2*B
4 IF C> 50 THEN
5 PRINT large C
6 ENDIF
We have two read statements,one assignment statement, and then one IF statement on three lines. Analyze the the coverage of the following test cases:
* Test 1: A = 2, B = 3
* Test 2: A =0, B = 25
* Test 3: A =20, B = 25
In Test 1, the value of C will be 8, so we will cover the statements on lines 1 to 4 and line 6, we have 83% statement
coverage
In Test 2, the value of C will be 50, so we will cover exactly the same state ments as Test 1.
In Test 3, the value of C will be 70, so we will print 'Large C and we will have exercised all six of the statements, now statement coverage = 100%
Test 3 is more effective than the first 2 tests together, you just take Test 3 because it can reach the goal of 100% coverage with only one test case.
2. Decision coverage and decision testing:
__Decision Coverage=(Number of decision exercised/Total number of decision) X 100%__
A decision is an IF statement, a loop control statement (e.g. DO-WHILE or REPEAT-UNTIL), or a CASE statement, where there are two or more possible exits or outcomes from the statement.Decision coverage is stronger than statement coverage, 100% decision coverage always guarantees 100% statement coverage.
Ex:
1 READ A
2 READ B
3 C=A-2*B
4 IFC <0THEN
5 PRINT "C negative"
6 ENDIF
With Test 1: A = 20, B = 15 the value of C will be -10, we will print "C negative" and we have 100% statement coverage. But we only cover the True outcome of IF statement, we have not checked the False outcome. So we have to add another test:
Test1: A=20, B=15
Test2: A=10, B=2
This now covers both of the decision outcomes True and False.
- Experience-based testing:
1. Error guessing:
Error guessing is a technique that is used as a complement to other more formal techniques. There are no rules for error guessing. The tester should think of situations in which the software may work incorrectly.Typical conditions includes division by zero, blank input, empty files and the wrong kind of data (e.g. alphabetic characters where numeric are required).
2. Exploratory testing:
Exploratory testing is an approach in which the test design and test execution activities are performed in parallel without formally documenting the test conditions, test cases or test scripts. It is most useful when there are no or poor specifications and when time is severely limited. It can also serve to complement other formal testing, helping to establish greater confidence in the software.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment