From 361d73117b2800d2e6b891cef9dca65ba37e6d8b Mon Sep 17 00:00:00 2001 From: Chris Hartjes Date: Wed, 11 Jul 2012 17:19:31 -0400 Subject: [PATCH 1/3] Removed link to Selenium, added link to Codeception --- _posts/08-03-01-Behavior-Driven-Development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/08-03-01-Behavior-Driven-Development.md b/_posts/08-03-01-Behavior-Driven-Development.md index 28cc83d..9fb44fa 100644 --- a/_posts/08-03-01-Behavior-Driven-Development.md +++ b/_posts/08-03-01-Behavior-Driven-Development.md @@ -19,4 +19,4 @@ by the [RSpec project](http://rspec.info/) for Ruby. * [Behat](http://behat.org/) is inspired by Ruby's [Cucumber](http://cukes.info/) project * [PHPSpec](http://www.phpspec.net/) the SpecBDD framework for PHP -* [Selenium](http://seleniumhq.org/) is a browser automation tool, which can be [integrated with PHPUnit](http://www.phpunit.de/manual/3.1/en/selenium.html) +* [Codeception](http://www.codeception.com) is a full-stack testing framework that uses BDD principles From f1f9e07e06ce9a4af884a629aff69b0818bde59d Mon Sep 17 00:00:00 2001 From: Chris Hartjes Date: Wed, 11 Jul 2012 17:20:17 -0400 Subject: [PATCH 2/3] Reworked TDD section to be clearer and expand on the different testing types --- _posts/08-02-01-Test-Driven-Development.md | 37 +++++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/_posts/08-02-01-Test-Driven-Development.md b/_posts/08-02-01-Test-Driven-Development.md index af40718..7d9ff3a 100644 --- a/_posts/08-02-01-Test-Driven-Development.md +++ b/_posts/08-02-01-Test-Driven-Development.md @@ -4,6 +4,14 @@ isChild: true ## Test Driven Development +From Wikipedia: + +>> Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards. Kent Beck, who is credited with having developed or 'rediscovered' the technique, stated in 2003 that TDD encourages simple designs and inspires confidence + +There are several different types of testing that you can do for your application + +### Unit Testing + Unit Testing is a programmatical approach to ensure functions, classes and methods are working as expected, from the point you build them all the way through the development cycle. By checking values going in and out of various functions and methods, you can make sure the internal logic is @@ -19,12 +27,31 @@ The other use for unit tests is contributing to open source. If you can write a functionality (i.e. fails), then fix it, and show the test passing, patches are much more likely to be accepted. If you run a project which accepts pull requests then you should suggest this as a requirement. -PHPUnit is the most popular and has become a de facto standard with its popular adoption amongst [PHP -frameworks][phpfws] and [Composer][composer] component developers, but there are a few alternatives around. +[PHPUnit](http://phpunit.de) is the de-facto testing framework for writing unit tests for PHP +applications, but there are several alternatives -* [PHPUnit](http://phpunit.de/) +* [SimpleTest](http://simpletest.org) * [Enhance PHP](http://www.enhance-php.com/) * [PUnit](http://punit.smf.me.uk/) -[phpfws]: /#libraries_and_frameworks -[composer]: /#composer_and_packagist \ No newline at end of file +### Integration Testing + +From Wikipedia: + +>> Integration testing (sometimes called Integration and Testing, abbreviated "I&T") is the phase in software testing in which individual software modules are combined and tested as a group. It occurs after unit testing and before validation testing. Integration testing takes as its input modules that have been unit tested, groups them in larger aggregates, applies tests defined in an integration test plan to those aggregates, and delivers as its output the integrated system ready for system testing. + +Many of the same tools that can be used for unit testing can be used for integration testing as many +of the same principles are used. + +### Functional Testing + +Sometimes also known as acceptance testing, functional testing consists of using tools to create automated +tests that actually use your application instead of just verifying that individual units of code are behaving +correctly and that individual units can speak to each other correctly. These tools typically work using real +data and simulating actual users of the application. + +#### Functional Testing Tools + +* [Selenium](http://seleniumhq.com) +* [Mink](http://mink.behat.org) +* [Codeception](http://codeception.com) is a full-stack testing framework that includes acceptance testing tools From 0eda4b67382b61a7416d10994618a1cd80be3c14 Mon Sep 17 00:00:00 2001 From: Chris Hartjes Date: Wed, 11 Jul 2012 17:24:32 -0400 Subject: [PATCH 3/3] Fixed spelling mistake --- _posts/08-02-01-Test-Driven-Development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/08-02-01-Test-Driven-Development.md b/_posts/08-02-01-Test-Driven-Development.md index 7d9ff3a..d16e632 100644 --- a/_posts/08-02-01-Test-Driven-Development.md +++ b/_posts/08-02-01-Test-Driven-Development.md @@ -12,10 +12,10 @@ There are several different types of testing that you can do for your applicatio ### Unit Testing -Unit Testing is a programmatical approach to ensure functions, classes and methods are working as +Unit Testing is a programming approach to ensure functions, classes and methods are working as expected, from the point you build them all the way through the development cycle. By checking values going in and out of various functions and methods, you can make sure the internal logic is -working correctly. By using Dependecy Injection and building "mock" classes and stubs you can verify that dependencies are correctly used for even better test coverage. +working correctly. By using Dependency Injection and building "mock" classes and stubs you can verify that dependencies are correctly used for even better test coverage. When you create a class or function you should create a unit test for each behaviour it must have. At a very basic level you should make sure it errors if you send it bad arguments and make sure it works if you send it valid arguments.