GoConqr has a new look! Let us know what you think.

Notes

Test Driven Development

James Drummond Application, build, testing and deployment A-Level English 1 page

Content of the notes (1)

Page 1

What are the aims / what is the point of TDD?

One of the primary aims of unit testing is to isolate a method or component that you want to test and see how it behaves under a variety of circumstances.

How to write testable Javascript:

Externalize all javascript - don't write inline as it can't be tested.

Provide a public interface - it's difficult to test private methods

Use instantiable objects

Flatten the pyramid of doom: avoid many nested levels of callbacks

Separate DOM event handlers from the actions they perform: e.g. separate submit button click from form submit.

Mock in XHR requests

The process of test driven development:

You first write a test for a function before you write the function itself

You create a failing test initially, rounding this out with passing tests.

You then build the actual functionality of the function.

Run the tests to see that you get the expected results.

After that you wrinse and repeat.

New Page

Information

Description
A-Level Application, build, testing and deployment (Test Driven Development) Note on Test Driven Development, created by James Drummond on 14/12/2014.
Created by
James Drummond
Views
30
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?