getting started with tdd - confoo 2014
DESCRIPTION
Introduction to Test Driven Development. I gave that talk on February 2014 at Confoo.TRANSCRIPT
![Page 1: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/1.jpg)
Getting Started With TDDEric Hogue - @ehogue
Confoo - 2014-02-27
![Page 2: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/2.jpg)
TDD
![Page 3: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/3.jpg)
Where should I Start?
![Page 4: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/4.jpg)
1. Unit tests2. Test Driven Development3. What’s next?
![Page 5: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/5.jpg)
Unit Tests
![Page 6: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/6.jpg)
Unit Test
a method by which individual units of source code [...] are tested to determine if they are fit for use
http://en.wikipedia.org/wiki/Unit_testing
![Page 7: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/7.jpg)
Don’t Cross boundaries
![Page 8: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/8.jpg)
Tools
● SimpleTest● atoum● PHPT● PHPUnit
![Page 9: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/9.jpg)
![Page 10: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/10.jpg)
Installation - Phar
$ wget
https://phar.phpunit.de/phpunit.phar
$ chmod +x phpunit.phar
$ mv phpunit.phar /usr/local/bin/phpunit
![Page 11: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/11.jpg)
Installation - Pear
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
![Page 12: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/12.jpg)
Installation - Composer
# composer.json
{
"require-dev": {
"phpunit/phpunit": "3.7.*"
}
}
$ composer install
![Page 13: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/13.jpg)
PHPUnit
FactorialTest.php
<?php
class FactorialTest extends
\PHPUnit_Framework_TestCase {
}
![Page 14: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/14.jpg)
public function testSomething() {
}
/** @test */
public function somethingElse() {
}
![Page 15: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/15.jpg)
● Arrange● Act● Assert
![Page 16: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/16.jpg)
Arrange
/** @test */
public function factOf1() {
$factorial = new Factorial;
}
![Page 17: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/17.jpg)
Act
/** @test */
public function factOf1() {
$factorial = new Factorial;
$result = $factorial->fact(1);
}
![Page 18: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/18.jpg)
Assert
/** @test */
public function factOf1() {
$factorial = new Factorial;
$result = $factorial->fact(1);
$this->assertSame(1, $result);
}
![Page 19: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/19.jpg)
PHPUnit Assertions
● $this->assertTrue();● $this->assertEquals();● $this->assertSame();● $this->assertContains();● $this->assertNull();● $this->assertRegExp();● ...
![Page 20: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/20.jpg)
Preparing For Your Tests
setup() -> Before every teststeardown() -> After every tests
setUpBeforeClass() + tearDownAfterClass()Once per test case
![Page 21: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/21.jpg)
phpunit.xml
<phpunit bootstrap="bootstrap.php"
colors="true"
strict="true"
verbose="true"
>
...
</phpunit>
![Page 22: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/22.jpg)
phpunit.xml
<phpunit>
<testsuites>
<testsuite name="My Test Suite">
<directory>path</directory>
<file>path</file>
<exclude>path</exclude>
</testsuite>
</testsuites>
</phpunit>
![Page 23: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/23.jpg)
![Page 24: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/24.jpg)
TDD
![Page 25: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/25.jpg)
Red - Green - Refactor
Red Write a failing test
![Page 26: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/26.jpg)
Red - Green - Refactor
GreenMake it pass
![Page 27: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/27.jpg)
Red - Green - Refactor
RefactorFix any shortcuts you took
![Page 28: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/28.jpg)
/** @test */
public function create() {
$this->assertNotNull(new Factorial);
}
![Page 29: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/29.jpg)
class Factorial {
}
![Page 30: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/30.jpg)
/** @test */
public function factOf1() {
$facto = new Factorial;
$this->assertSame(1,
$facto->fact(1));
}
![Page 31: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/31.jpg)
public function fact($number) {
return 1;
}
![Page 32: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/32.jpg)
Duplication
public function create() {
$this->assertNotNull(new Factorial);
}
public function factOf1() {
$facto = new Factorial;
...
![Page 33: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/33.jpg)
public function setup() {
$this->facto = new Factorial;
}
/** @test */
public function factOf1() {
$this->assertSame(1,
$this->facto->fact(1));
}
![Page 34: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/34.jpg)
/** @test */
public function factOf2() {
$this->assertSame(2,
$this->facto->fact(2));
}
![Page 35: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/35.jpg)
public function fact($number) {
return $number;
}
![Page 36: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/36.jpg)
More duplication/** @test */
public function factOf1() {
$this->assertSame(1,
$this->facto->fact(1));
}
/** @test */
public function factOf2() {
$this->assertSame(2,
$this->facto->fact(2));
}
![Page 37: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/37.jpg)
public function factDataProvider() {
return array(
array(1, 1),
array(2, 2),
);
}
![Page 38: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/38.jpg)
/**
* @test
* @dataProvider factDataProvider
*/
public function factorial($number,
$expected) {
...
![Page 39: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/39.jpg)
…$result =
$this->facto->fact($number);
$this->assertSame($expected,
$result);
}
![Page 40: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/40.jpg)
public function factDataProvider() {
…array(2, 2),
array(3, 6),
...
![Page 41: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/41.jpg)
public function fact($number) {
if ($number < 2) return 1;
return $number *
$this->fact($number - 1);
}
![Page 42: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/42.jpg)
It’s a lot of work
![Page 43: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/43.jpg)
![Page 44: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/44.jpg)
Dependencies
![Page 45: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/45.jpg)
Problems
class Foo {
public function __construct() {
$this->bar = new Bar;
}
}
![Page 46: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/46.jpg)
Dependency Injection
![Page 47: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/47.jpg)
Setter Injection
class Foo {
public function setBar(Bar $bar) {
$this->bar = $bar;
}
public function doSomething() {
// Use $this->bar
}
}
![Page 48: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/48.jpg)
Constructor Injection
class Foo {
public function __construct(
Bar $bar) {
$this->bar = $bar;
}
public function doSomething() {
// Use $this->bar
}
}
![Page 49: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/49.jpg)
Pass the dependency directly
class Foo {
public function doSomething(
Bar $bar) {
// Use $bar
}
}
![Page 50: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/50.jpg)
File System
![Page 51: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/51.jpg)
vfsStream
Virtual Files System
composer.json
"require-dev": {
"mikey179/vfsStream": "*"
},
![Page 52: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/52.jpg)
Check if a folder was created
$root = vfsStream::setup('dir');
$parentDir = $root->url('dir');
//Code creating sub folder
$SUT->createDir($parentDir, 'test');
$this->assertTrue(
$root->hasChild('test'));
![Page 53: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/53.jpg)
Reading a file
$struct = array(
'subDir' => array('test.txt'
=> 'content')
);
$root = vfsStream::setup('root',
null, $struct);
$parentDir = $root->url('root');
...
![Page 54: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/54.jpg)
Reading a file
…
$content = file_get_contents(
$parentDir . '/subDir/test.txt');
$this->assertSame('content',
$content);
![Page 55: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/55.jpg)
Databases
![Page 56: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/56.jpg)
Mocks
Replaces a dependency
● PHPUnit mocks● Mockery● Phake
![Page 57: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/57.jpg)
Creation
$mock = $this->getMock('\NS\Class');
![Page 58: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/58.jpg)
Creation
$mock = $this->getMock('\NS\Class');
Or
$mock = $this->getMockBuilder
('\Namespace\Class')
->disableOriginalConstructor()
->getMock();
![Page 59: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/59.jpg)
$mock->expects($this->once())
->method('methodName')
![Page 60: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/60.jpg)
$mock->expects($this->once())
->method('methodName')
->with(1, 'aa', $this->anything())
![Page 61: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/61.jpg)
$mock->expects($this->once())
->method('methodName')
->with(1, 'aa', $this->anything())
->will($this->returnValue(10));
![Page 62: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/62.jpg)
Mocking PDO
$statement = $this->getMockBuilder
('\PDOStatement')
->getMock();
$statement->expects($this->once())
->method('execute')
->will($this->returnValue(true));
...
![Page 63: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/63.jpg)
...
$statement->expects($this->once())
->method('fetchAll')
->will(
$this->returnValue(
array(array('id' => 123))
)
);
...
![Page 64: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/64.jpg)
$this->getMockBuilder('\PDO')
->getMock();
![Page 65: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/65.jpg)
…$pdo = $this->getMockBuilder(
'\stdClass')
->setMethods(array('prepare'))
->getMock();
$pdo->expects($this->once())
->method('prepare')
->will(
$this->returnValue($statement));
![Page 66: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/66.jpg)
class PDOMock extends \PDO {
public function __construct() {}
}
$pdo = $this->getMockBuilder
('\PDOMock')
->getMock();
![Page 67: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/67.jpg)
mysql_*
![Page 68: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/68.jpg)
DbUnit Extension
extends PHPUnit_Extensions_Database_TestCase
public function getConnection() {
$pdo = new PDO('sqlite::memory:');
return $this->
createDefaultDBConnection(
$pdo, ':memory:');
}
![Page 69: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/69.jpg)
public function getDataSet() {
return $this->
createFlatXMLDataSet('file');
}
![Page 70: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/70.jpg)
API
![Page 71: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/71.jpg)
● Wrap all call into a class○ Zend\Http○ Guzzle○ Simple class that uses curl
● Mock the class○ Return the wanted xml/json
![Page 72: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/72.jpg)
Pros and Cons
![Page 73: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/73.jpg)
Pros
● Less regressions
![Page 74: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/74.jpg)
Pros
● Less regressions● Trust
![Page 75: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/75.jpg)
Pros
● Less regressions● Trust● Low coupling
![Page 76: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/76.jpg)
Pros
● Less regressions● Trust● Low coupling● Simple Design
![Page 77: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/77.jpg)
Cons
● Takes longer
![Page 78: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/78.jpg)
“If it doesn't have to work, I can get it done a lot faster!”- Kent Beck
![Page 79: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/79.jpg)
Cons
● Takes longer● Can be hard to sell to managers
![Page 80: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/80.jpg)
Cons
● Takes longer● Can be hard to sell to managers● It’s hard
![Page 81: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/81.jpg)
Prochaines étapes?
![Page 82: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/82.jpg)
Continuous Testing - Guard
![Page 83: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/83.jpg)
Continuous Integration
![Page 84: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/84.jpg)
Continuous Integration
● Run your tests automatically ○ Unit Tests○ Acceptance Tests○ Performance Tests○ ...
![Page 85: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/85.jpg)
Continuous Integration
● Run your tests automatically ○ Unit Tests○ Acceptance Tests○ Performance Tests○ …
● Check Standards○ phpcs
![Page 86: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/86.jpg)
Continuous Integration
● Run your tests automatically ○ Unit Tests○ Acceptance Tests○ Performance Tests○ …
● Check Standards○ phpcs
● Check for "code smells"○ phpcpd○ PHP Depend○ PHP Mess Detector
![Page 87: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/87.jpg)
Twitter:@ehogue
Blog:http://erichogue.ca/
Slides: http://www.slideshare.net/EricHogue
Questions
![Page 88: Getting started with TDD - Confoo 2014](https://reader038.vdocuments.site/reader038/viewer/2022102805/55580fd6d8b42a5e468b47c8/html5/thumbnails/88.jpg)
Credits● Paul - http://www.flickr.com/photos/pauldc/4626637600/in/photostream/● JaseMan - http://www.flickr.com/photos/bargas/3695903512/● mt 23 - http://www.flickr.com/photos/32961941@N03/3166085824/● Adam Melancon - http://www.flickr.com/photos/melancon/348974082/● Zhent_ - http://www.flickr.com/photos/zhent/574472488/in/faves-96579472@N07/● Ryan Vettese - http://www.flickr.com/photos/rvettese/383453435/● shindoverse - http://www.flickr.com/photos/shindotv/3835363999/● Eliot Phillips - http://www.flickr.com/photos/hackaday/5553713944/● World Bank Photo Collection - http://www.flickr.com/photos/worldbank/8262750458/● Steven Depolo - http://www.flickr.com/photos/stevendepolo/3021193208/● Deborah Austin - http://www.flickr.com/photos/littledebbie11/4687828358/● tec_estromberg - http://www.flickr.com/photos/92334668@N07/11122773785/● nyuhuhuu - http://www.flickr.com/photos/nyuhuhuu/4442144329/● Damián Navas - http://www.flickr.com/photos/wingedwolf/5471047557/● Improve It - http://www.flickr.com/photos/improveit/1573943815/