14
Testing JavaScript XP Methodologies Garrett Smith Front End Engineer

Testing JavaScript

  • Upload
    dhtml

  • View
    3.174

  • Download
    0

Embed Size (px)

DESCRIPTION

Slides from JS Meetup Presentation "Testing JavaScript".

Citation preview

Page 1: Testing JavaScript

Testing JavaScript XP Methodologies

Garrett Smith Front End Engineer

Page 2: Testing JavaScript

What is Testing?• Testing verifies that the system does

what its supposed to

Page 3: Testing JavaScript

Quality

• Internal Quality - measured by the programmer

• External Quality - measured by the customer

Page 4: Testing JavaScript

Types of Testing• Unit Testing

• Acceptance Testing

• Internal Quality - is it easy to maintain? How hard is it to make changes?

• External Quality - does it do what it's supposed to?

Page 5: Testing JavaScript

Unit Testing• A "unit" can be an ADT, an Object, or a

function

Page 6: Testing JavaScript

Costs of not Testing• Code debt

• Can’t refactor safely

Page 7: Testing JavaScript

Benefits• Tests facilitate change

• Good coverage ensures that all code paths work

• Tests make the code easier to understand

• Testability leads to cleaner code; microformats

Page 8: Testing JavaScript

Cost of Testing• Hard work and discipline

• Requires hardcore team commitment

Page 9: Testing JavaScript

Freedom to ChangeTests facilitate change

OK

Page 10: Testing JavaScript

Fixing Bugs

Page 13: Testing JavaScript

Tools

• JSUnit

• YUI Test

• JSCoverage

Page 14: Testing JavaScript

Further Reading• Agile Software Development: Principles, Patterns and Practices, Robert

C. Martin

• Architecture is a Second Order Effect, http://blog.objectmentor.com/articles/2007/10/20/architecture-is-a-second-order-effect

• Re: Simples Rules make creating Big Balls of Mud impossible. http://coding.derkeiler.com/Archive/General/comp.object/2007-01/msg00241.html

• http://en.wikipedia.org/wiki/Code_coverage

• http://www.objectmentor.com/omSolutions/agile_xp_differences.html

• Extreme programming explained: Embrace Change By Kent Beck

• Planning Extreme Programming, Beck, Fowler, Kohnke