Test Driven Web Development - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Test Driven Web Development

Description:

Compatibility. PHP has two good tools available: PEAR::PhpUnit and SimpleTest ... or clean up the test environment, raise errors, pass or fail tests etc ... – PowerPoint PPT presentation

Number of Views:82
Avg rating:3.0/5.0
Slides: 22
Provided by: foss
Category:

less

Transcript and Presenter's Notes

Title: Test Driven Web Development


1
Test Driven Web Development
  • Nirav Mehta
  • Linux Bangalore 2004

2
Session Plan
  • Introduction to test driven development
  • Test driven development with PHP
  • How to cope up with test driven development
  • Experiences

3
Test driven development says write test cases
before code!
4
Test before code is actually great way to improve
code quality
5
You may ask how can we do test driven development
in a web project?
  • Very well suited for OO programming
  • Web testing available forms, auth etc
  • Automated tests fit well for repeatitive tests
  • Manual testing otherwise
  • UI
  • Usability
  • Compatibility

6
PHP has two good tools available PEARPhpUnit
and SimpleTest
7
SimpleTest is a set of classes that empower you
to write, run and manage your test cases
8
Here's a small sample
  • class CartTestCase extends UnitTestCase
  • function testAddToCart()
  • cart new Cart()
  • result cart-gtadd(1000, 1)
  • this-gtassertTrue(result, 'Item added')

9
You can assert for true/false, data types,
equality, patterns and errors
10
You can also initialize or clean up the test
environment, raise errors, pass or fail tests etc
11
Let us write and run some simple test cases for
our shopping cart now
12
Faking an object mock objects and server stubs
13
It's easy to test web pages with simple pattern
matching and link following
14
SimpleTest also allows handling simple form
submissions
15
The first thing you need in your web app is
authentication, so you need a way to test and
manage it.
16
Alright, this all sounds good.
  • But does it really work?

17
Yes, test driven development really works,
despite frictions
18
TDD also fits very well with an agile development
methodology
19
Get on with test driven development
20
Questions?
21
Thanks
  • Linux Bangalore Team
  • Resources
  • http//www.lastcraft.com/simple_test.php
  • Contact Me
  • nirav_at_magnet-i.com
Write a Comment
User Comments (0)
About PowerShow.com