Par Bastien DURAND
test
beta test
performance test
stress test
test d'integration
test de non régrétion
public function calculateLoan(
$amount, $months, $interestRate)
{
// ... some code
// ...
}
calculateLoan(20000, 60, 5.0);
// is result 382.02?
calculateLoan(6000, 12, 10.0);
// is result 527.50?
calculateLoan(20000, 60, 5.0);
// is result 382.02?
calculateLoan(6000, 12, 10.0);
// is result 527.50?
public function calculateLoan(
$amount, $months, $interestRate)
{
// ... some code
// ...
}
“Le TDD s'applique-t-il à tout?”
“Dois-je écrire tous mes tests en premier ?”
“Nous avons des testeurs, doivent-ils écrire ces tests ?”
class Tester {
//example
MyClass obj = new MyClass();
int result = obj.someMethod();
if ( result > 50 ) {
log("success!");
} else {
log("test failed!");
}
}
SUnit
Smalltalk
JUnit
Java
NUnit
.Net
CppUnit
C++
OCUnit
Objective-C
PHPUnit
PHP
(etc...)
SUnit
Smalltalk
JUnit
Java
NUnit
.Net
CppUnit
C++
OCUnit
Objective-C
PHPUnit
PHP
(etc...)
xUnit frameworks
assertEquals(arg1, arg2);
assertEquals(1, 1); //pass do nothing
assertEquals(1, 2); //fail, error
assertArrayEquals(array1, array2);
assertNotNull(obj1);
assertNull(obj1);
assertSame(obj1, obj2);
assertTrue(condition);
assertFalse(condition);
Demo