Topmost Black magic specialist in Saudi Arabia Or Bangali Amil baba in UK Or...
Testing Zen
1. Testing Zen
Improve software quality
and one's quality of life
with fuzz tests, code coverage,
and a fast in-memory database.
Thomas Müller
Day Software AG
Presentation 6640
12. 4
Why Automated Tests?
1. Less Bugs
2. Can Refactor
3. Nice Code
4. Nice to Work
5. Tests are Samples & Docs
13. 4
Why Automated Tests?
1. Less Bugs
2. Can Refactor
3. Nice Code
4. Nice to Work
5. Tests are Samples & Docs
6. Short Release Cycle
14. 4
Why Automated Tests?
1. Less Bugs
2. Can Refactor
3. Nice Code
4. Nice to Work
5. Tests are Samples & Docs
6. Short Release Cycle
7. Less/No Branching
15. 4
Why Automated Tests?
1. Less Bugs
2. Can Refactor
3. Nice Code
4. Nice to Work
5. Tests are Samples & Docs
6. Short Release Cycle
7. Less/No Branching
8. Predictable Work
16. 4
Why Automated Tests?
1. Less Bugs
2. Can Refactor
3. Nice Code
4. Nice to Work
5. Tests are Samples & Docs
6. Short Release Cycle
7. Less/No Branching
8. Predictable Work
9. Go Home Early
17. 4
Why Automated Tests?
1. Less Bugs
2. Can Refactor
3. Nice Code
4. Nice to Work
5. Tests are Samples & Docs
6. Short Release Cycle
7. Less/No Branching
8. Predictable Work
9. Go Home Early
10. Beer!
24. 8
Fuzz Testing Example
interface DataService {
void create(int k, String v);
String read(int k);
void delete(int k);
}
byte[] b = new byte[100];
random.nextBytes(b);
data = new String(b,
"ISO-8859-1");
25. 8
Fuzz Testing Example
interface DataService { Random r = new Random(123);
void create(int k, String v); for (int i = 0; i < 10000; i++) {
String read(int k); int k = r.nextInt(100);
void delete(int k); switch (r.nextInt(3)) {
} case 0:
ds.create(k, randomString(r));
break;
case 1:
ds.read(k);
byte[] b = new byte[100]; break;
random.nextBytes(b); case 2:
data = new String(b, ds.delete(k);
"ISO-8859-1"); break;
}
}