Giter VIP home page Giter VIP logo

testing-antipatterns's Introduction

What is an Anti-pattern

An antipattern is a recurring negative solution to a problem:

  • Because it's a solution to a problem, it tends to stick around after it's implemented. If it didn't solve a problem, it would be thrown out.
  • Because it recurs, it gets implemented -- and reimplemented -- by developers in a wide variety of settings.
  • Because it's negative, it's not the optimal solution

The combination of these three elements is what makes antipatterns so troublesome.

Learning rspec, jasmine etc is the easiest part of testing. Writing good tests is the hard part. In this workshop, I am going to presents some common testing antipatterns and show how to resolve them.

These are some of the antipatterns we will be discussing today:

  • Tests that only check for the expected result, not the boundaries and exceptions - Happy Path
  • Test that runs incredibly slow. When developers kick it off, they have time to go to the bathroom, grab a smoke, or worse, kick the test off before they go home at the end of the day - Slow pokes
  • Tests that are hard to figure out what is being tested - Obscure Tests
  • Tests that break when they shouldn't - Fragile Tests
  • Tests that pass and fail without you changing anything - Erratic Tests
  • Test code that is not well refactored as the production code - Second Class Citizen
  • Tests that require branches in production code - Test Hooks

testing-antipatterns's People

Watchers

James Cloos avatar Prosper Otemuyiwa avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.