Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing workshop #241

Closed
bajiat opened this issue Jul 13, 2015 · 1 comment
Closed

Testing workshop #241

bajiat opened this issue Jul 13, 2015 · 1 comment
Assignees
Milestone

Comments

@bajiat
Copy link
Contributor

bajiat commented Jul 13, 2015

Organize, plan and facilitate a testing workshop

Workshop Outline

  • Why test?
    • Align code with business goals and needs
    • Code documentation
    • Prevent regression
    • Confidence when refactoring
    • Make sure our assumptions are correct
    • Project and team scaling
  • Behavior Driven Design
    • User Stories - interactive (bakery)
      • As a ... [role]
      • I want ... [feature or activity]
      • So that ... [outcome]
    • Scenarios - interactive (bakery)
      • Given ... [initial setup]
      • When ... [event or action]
      • then ... [expected outcome]
  • Types of Tests - system diagram
    • Unit
    • Integration
    • Functional (Browser)
  • Tests are functions
  • Test Doubles
  • Testing sequence
    • Setup
    • Execute
    • Verify
    • Teardown
  • Jasmine
    • beforeAll()
    • describe()
      • it()
    • afterAll()
  • Browser Testing

Resources

@brylie
Copy link
Contributor

brylie commented Jul 16, 2015

Bakery examples:

spec.js

describe('Bakery', function () {
  it('should bake bread', function () {
    expect(bakeBread()).toEqual('Fresh baked bread!');
  })

  it ('should bake customer favorite bread', function () {
    expect(bakeCustomerFavoriteBread('rye')).toEqual('Fresh baked rye bread!');
  })
})

source.js

var bakeBread = function (breadType) {
  if (breadType) {
    return 'Fresh baked ' + breadType + ' bread!'
  } else {
    return 'Fresh baked bread!';
  }
};

var bakeCustomerFavoriteBread = function (favoriteBread) {
  var bakedBread = bakeBread(favoriteBread);

  return bakedBread;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants