ebook img

Test Driven Development - The Ajax Experience PDF

73 Pages·2008·1.57 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Test Driven Development - The Ajax Experience

Tes t D riven D evelopment with YUI Tes t Nicholas C . Zakas P rincipal Front E nd E ngineer, Y ahoo! Who's this g uy? • P rincipal Front E nd E ngineer, Y ahoo! Front P age • Y UI C ontributor • Author Tes t D riven D evelopment Design Features Run Write Tests Tests Write Code Why Tes t D riven D evelopment? • No s uch thing as a s mall change • S pecifically identifies tas ks • Y ou unders tand your code the bes t • Upfront inves tment pays off later • Q A res ources are limited • P eace of mind Tes t D riven D evelopment Design Features Run Write Tests Tests Write Code The R equirements • Us ually, requirements are functional • Trans late into interfaces (objects and methods ) • D es cribe what each method s hould do in terms of inputs and outputs Design Features The R equirements • Need: When a us ername is entered, ignore s paces at the beginning and end of text • Trans lation: I need a trim function • Trim function: – R emove leading white space from the given string and return result – R emove trailing white space from the given string and return result Design Features Tes t D riven D evelopment Design Features Run Write Tests Tests Write Code Unit Tes ts • Tes t a s mall, is olated part of code (unit) – Unit = method • Tes t inputs and outputs – One set at a time • Tes t: “G iven this input, I expect this output.” Write Tests Unit Tes ting C omplaints • R amp-up time • Unfamiliar s yntax/concepts • Tes t harnes s s etup is hard • Writing tes ts takes too long • C an't figure out what broke when a tes t fails Write Tests

Description:
Why Test Driven Development? • No such thing as a small change. • S pecifically identifies tasks. • You understand your code the best. • Upfront investment pays
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.