PHP / Zend Conference, San Jose, 2006
Is your code easy to change? Can you get nearly instantaneous feedback when you do change it? If the answer to any of these questions is no, you have legacy code, and it is draining time and money away from your development efforts.
Technical debt is a measure of how untidy or out-of-date the development work area for a product is. It builds up to create legacy code.
Michael Feathers : Working Effectively with Legacy Code .
You can invest in tools but these don't add value over time : there's no interest over time.
We value individuals and interactions over processes and tools.
Extract from the Agile Manifesto.
Here's probably what you want to avoid :
Here's probably what automated developer testing can do to you :
Check out other satisfied people.
Confidence and serenity are the magic words here.
You know it works, and you know when it works. So developer testing is good for you.
It may also be a nice way to fight spam at the roots.
Once we eradicate spam about hair loss, we can think of a way of making viagra a thing of the past.
Version 1.0 : Communication - Simplicity - Feedback - Courage.
Version 2.0 : Communication - Simplicity - Feedback - Courage - Respect.
|
We'll be back here... with SHIFT + ESC + h
A computer is dumb.
It's actually a strength, so use it.
Tip : automate.
We'll distinguish between two types of tests : unit and acceptance -- Kent Benk calls this Developer Testing.
Also functionnal test : c2 wiki
The SimpleTest documentation and tutorial are really good (I know, I have translated them ;-). Exemples come from those : my goal today is to try and convince you reading those...
<?php require_once('simpletest/unit_tester.php'); require_once('simpletest/reporter.php'); require_once('../classes/log.php'); class TestOfLogging extends UnitTestCase { function testCreatingNewFile() { @unlink('/temp/test.log'); $log = new Log('/temp/test.log'); $this->assertFalse(file_exists('/temp/test.log')); } } $test = &new TestOfLogging(); $test->run(new HtmlReporter()); ?>
What do we get?
Once you've written a few test, it may seem tedious at the beginning. Then one day something incredible happen : you modify some code somewhere, then run your test suite and a red bar appears at the other end of your code. You were on the fringe of introducing a new bug and it was discovered automatically. From then on, your investment starts paying back.
You're about to become "test infected".
Writing a test before any code is now your new motto. It has a special rhythm to it :
Well actually, it's more something like :
For another such list : Keith Ray.
Using Selenium (a javascript-based tool driving the browser)
<table><tbody> <tr> <td>open</td> <td>http://localhost/app/logout.php?origin=index.php</td> <td></td> </tr> <tr> <td>type</td> <td>loginname</td> <td>admin</td> </tr> <tr> <td>clickAndWait</td> <td>//input[@value='login']</td> <td></td> </tr> <tr> <td>verifyTextPresent</td> <td>Logged in as : admin</td> <td></td> </tr> </tbody></table>
...we are fighting entropy.
Go into maintenance mode.
The tube in NY has two lines for each direction : it can used 24 hours a day.
You liked Netscape ? you'll love Vista ! The opposition (IE on the browser market and Apple / Ubuntu on the OS market) did / do release something and continued / continue to do so frequently.
Vista© ? First it was 2003 then
In the mean time, Ubuntu©
How many times will it be "once and now" ?
$ pear update <paquet>
What do you mean "update" ?
Also a "fire and forget" mentality can be dangerous security wise :
FTP is easy enough : can you do better ?
Thank you so much Sara Golemon for SSH2
: write
: build
: grow
Good metaphor are hard to find and event more difficult to overcome aftewards : the Desktop dates back 1968 and we haven't seen anything better yet.
Paper based stickies : write / rub / scratch / reorder / share / look closer & further / destroy
Question : tired or bored ?
Pair programming is draining a lot of energy : developers are constantly concentratring very hard (as-you-write compiler).
Someone Is GOing TO Need It.
PHP was built upon this simplicity.
The no-framework PHP MVC framework : using a framework is expensive. Just start looking for the good one : Taking a look at ten different PHP frameworks
If you had to remember one thing : DRY, pour Don't Repeat Yourself. Then and only then, will you find out about the true power of design patterns (crutches for your language).
Careful, it's a trap question : documentation is very often a scape-goat.
PHP has a very good doc : the cost ?
Ask your end-users and find the right dose (ie. PHPDoc is not always THE solution).
Note : never tell your boss about the "blame" command if you don't pair programm
Bindings between SVN and PHP do exists : sometimes very useful (as well as post-commit stuff).
Welcome to the green light district.
Some tools : CruiseControl and Rephlux
Start with PEAR "coding standards" (pear.php.net)
class t_w_d_a() {
function f() {
...
return $b_number;
}
function __() {
}
}
class travel_with_delta_airlines() {
function wait_15_minutes_on_the_plateform() {
...
return $before_it_s_too_late;
}
}
And think about what the rest of the world will do to you when PHP6 comes along.
Ruby on Rails : power to conventions fighting against power to XML based configuration in Java Wonderland.
email [fr | en] : perrick@noparking.net
box [fr] : No Parking
blog [fr] : :: onpk ::
contrib [en] : SimpleTest