• Complain

Chris Hartjes - The Grumpy Programmers Guide To Building Testable PHP Applications

Here you can read online Chris Hartjes - The Grumpy Programmers Guide To Building Testable PHP Applications full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2013, publisher: leanpub.com, genre: Romance novel. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    The Grumpy Programmers Guide To Building Testable PHP Applications
  • Author:
  • Publisher:
    leanpub.com
  • Genre:
  • Year:
    2013
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

The Grumpy Programmers Guide To Building Testable PHP Applications: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "The Grumpy Programmers Guide To Building Testable PHP Applications" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Chris Hartjes: author's other books


Who wrote The Grumpy Programmers Guide To Building Testable PHP Applications? Find out the surname, the name of the author of the book and a list of all author's works by series.

The Grumpy Programmers Guide To Building Testable PHP Applications — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "The Grumpy Programmers Guide To Building Testable PHP Applications" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
The Grumpy Programmers Guide To Building Testable PHP Applications Chris - photo 1
The Grumpy Programmer's Guide To Building Testable PHP Applications
Chris Hartjes

This book is for sale at http://leanpub.com/grumpy-testing

This version was published on 2013-10-15

This is a Leanpub book Leanpub empowers authors and publishers with - photo 2

* * * * *

This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do.

* * * * *

2012 - 2013 Chris Hartjes
Copyright

All content in this book, unless otherwise indicated, is (c) 2012 ChrisHartjes. In lieu of DRM for electronic copies of this book, I ask thatreaders respect my copyright and do not distribute portions of this bookwithout my express written consent. If you help to organize a PHP users groupplease contact me about obtaining free copies to give away to your members.

ISBN: 978-1-105-45488-2

Thanks

First, Id like to thank my technical reviewers. They caught all the detailsthat I missed and made this guide what it is. So thanks to (in no particular order)Peter Meth, Joel Perras, Matthew Turland, and Remi Woler for their help. Better guides come from the input ofothers.

Second, Id like to thank those in the PHP community who are always pushing theenvelope, always speaking loudly and clearly about the importance of bestpractices while trying to give back to the community at the same time. Thosepeople inspired me to keep writing and speaking about topics that interest meand hopefully interest you. I may feel out of sync at times with the mainstreamPHP community but if my online ranting and raving has inspired other programmersto step up their own game, then I am grateful I had an impact.

Finally, Id like to thank my wife Claire for sticking with me on my journeyfrom a fresh-out-of-college newbie programmer to the well-rounded, well-seasoned, extremely grumpy programmer I am today. Thanks for putting up with the long hoursthat a programmer spends staring at screens instead of staring into theirpartners beautiful eyes. My wife is my partner in everything I do.

As always, I welcome your comments about anything you see in this guide, any questionsyou have, or if you just want to get my thoughts on a wide variety of topics relatedto programming. And baseball too.

This guide was built with the help of the awesome folks at Leanpub.My initial decision to do the guide as text with some AsciiDoc markup turned out tomake it easier to convert things into Markdown asLeanpub required. I also used Pandoc to tweaksome of the content in the three bonus essays I have included in this guide.

A big thank you! to Elizabeth Gauthier for the awesome cover. My wife commentedon what an incredible likeness it is.

Unfortunately, this guide is not aimed at the beginning programmer. Writing testableapplications is a hard thing to do and requires that you already have a solid backgroundin programming. This guide is targeted at intermediate-level programmers who havehad some exposure to writing tests and want to push their skills to the next level.

If you are looking for an introductory guide to writing unit tests I highlyrecommend the PHPUnit documentation. It willcover all the basics.

I can be reached via email at chartjes@littlehart.net and on Twitter at @grmpyprogrammer. Iblog on a regular basis at http://www.littlehart.net/atthekeyboard. Thanks for takingthe time to check out the guide and I hope you find things that help you get a betterhandle on your ability to test your PHP applications.

Testing Is Good, Testable Applications Are Better

There is no denying that the PHP world has finally caught up with other programmingcommunities in terms of its attitude towards testing. As a result, you can find a lotof really good resources either online or in book form from your favourite retailer.

Most of this information focuses on the actual writing of tests and strategies forthe type of tests you need to write. What I found was missing from most of theseresources was how to write applications that you could actually test. Sounds likesomething obvious, at least to me.

There is an open secret out there: some applications can never be tested with automatedtesting tools. Theyre built in such a manner that you couldnt wrap anything beyondtests that examine the HTML output from it. Thats really a shame, because these sortof things dont happen on purpose. Like technical debt in your code, it builds up overtime and at some point you end up with an application that might as well be a black box: youput inputs into it and you get output back, and have no easy way to determine how tofix things if it sends you back something you dont expect.

But make no mistake: building a non-trivial testable application is somethingthat actually takes experience. A lot of experience. You will mess up. Youwill need to refactor things at a later point, and will often find that refactoringto be painful when contrasted with the seemingly-simple feature request that youare trying to implement.

I am a big believer in the power of automated testing to give you an application thatis maintainable, extendible and performant. I dont always get to work on applicationsthat have made a commitment to be testable. It really is a different way of lookingat the entire process of testing. Its one thing to know how to write an assertionstatement, or understand how to use mock objects to isolate components of a modulethat you are trying to test. Its another to have to create an application that lets you test it from end to end.

I am hoping to pass on my thoughts on building applications that you can easily test,and show you some of the techniques that I use to try and make the job easier. In thisguide you will learn about creating the proper environment for your application, aprogramming concept known as Dependency Injection, and some best practices fortesting the output of your application from the command line.

I really think that an optimal architecture for a web application is to buildsmall modules of code that you then integrate together to solve larger problems.There is no other magic bullet to build a complicated system. I have run across anold saying (that I have been unable to find an attribution for) that says simple systems can display complex behaviour but complexsystems can only display simple behaviour.

Keep your modules, components, libraries, whatever you decide to call them small, readable, and easy to verify that they work as desired in isolationor when integrated together. That way you will have an application that isvery easy to write tests for and provide you with some protection againstregression errors and other unexpected bumps in the road.

The goal is always the same: create a workflow that shortens the time it takesfor code to make it from your text editor of choice all the way into productionwith the fewest bugs possible.

Building Testable Applications is Hard

If youve been a PHP developer for any length of time you have probably encounteredsomeone who talks about the benefits of testing your code. Test-Driven Development (TDD),Behaviour-Driven Development (BDD), and Functional Testing are just some strategies you can use. Not testing your code should not be an option.

I was once there too: I did not believe in the value of writing tests for my code. I amfamiliar with all the excuses people give:

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «The Grumpy Programmers Guide To Building Testable PHP Applications»

Look at similar books to The Grumpy Programmers Guide To Building Testable PHP Applications. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «The Grumpy Programmers Guide To Building Testable PHP Applications»

Discussion, reviews of the book The Grumpy Programmers Guide To Building Testable PHP Applications and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.