Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Create, test, secure, repeat

If you build web applications you now have a huge responsibility: everything must be tested and secured. But how do you test and secure legacy applications or how do you get started with a new project using test-driven techniques to maximise quality and security without investing too much time in it.

In this workshop we will start with a clean project and build a simple catalogue application using test-driven and security-hardened techniques to achieve our goal. Once we have achieved our goal, we're going to apply the same on a legacy application.

25.
How to use @group
# Run phpunit only against tests for the Order module
./vendor/bin/phpunit --group Order
# Run phpunit for all tests except for the Order module
./vendor/bin/phpunit --exclude-group Order

33.
For this training
Installation of source code
Clone the repository into your workspace before attending the workshop.
git clone https://github.com/in2it/ctsr-workshop.git
cd ctsr-workshop/
Once you have cloned the training package, make sure you install composer.
curl -sS https://getcomposer.org/installer | php
When the download is done, install required components using composer
php composer.phar install

34.
For this training
Installation of source code
Clone the repository into your workspace before attending the workshop.
git clone https://github.com/in2it/ctsr-workshop.git
cd ctsr-workshop/
Once you have cloned the training package, make sure you install composer.
curl -sS https://getcomposer.org/installer | php
When the download is done, install required components using composer
php composer.phar install
https://www.ﬂickr.com/photos/intelfreepress/13983474320

35.
During the workshop you're asked to solve several exercises. All example codes
are based on a UNIX-like OS, so if you plan to participate this workshop with
another OS, you need to know what changes are required to have the exercises
run on your operating system.
The exercises, the source code and the examples are tested on the following
platforms:
• Windows 7
• Mac OS X
• Ubuntu Linux
When you need to switch to a speciﬁc exercise branch (e.g. ex-0.0), you can do
this with the following command.
git checkout -b ex-0.0 origin/ex-0.0

52.
Chapter 0
What have you learned
• How to install phpunit
• How to conﬁgure phpunit
• How to write your test ﬁrst
• How to modify requirements through testing
• How to debug failures and ﬁx them easily with tests