Giter Club home page Giter Club logo

drawingthepyramid's Introduction

Drawing The Pyramid

WORK IN PROGRESS

This project has two goals:

  • Provide an easy way to draw a test automation pyramid with proper proportions.
  • Provide a good example for doing property based testing in JavaScript using fast-check. You might want to consider this example for a Coding Dojo on that topic.

Watch live on paulroho.com/DrawingThePyramid.

For a concise introduction to Property based testing refer to the wonderful 15' talk The Magic of Generative Testing: Fast-Check in JavaScript by Gabriel Lebec.

Getting Started

Get the Sources

Clone the repository

$ git clone https://github.com/paulroho/DrawingThePyramid.git
$ cd DrawingThePyramid

Setup

$ npm install

This downloads all the npm-packages as stated in project.json.

Watch it in the Browser

$ npm start

This starts a life-server and opens the url in your browser. life-server is started with the --watch=. switch, you do not have to refresh your browser. life-server does it for you on saving any file. Press Ctrl+C to stop the server.

Hint: As you are probably not too much interested in observing the output of the live-server, you might consider running this command from a integrated terminal of your IDE, such as Visual Studio Code.

Refer to Known Issues - Browser Support.

Run the Tests

On a dedicated terminal from project root:

$ npm test

This starts mocha with the --watch switch automatically re-running the tests on each file change. Use Ctrl+C to cancel test execution.

Hint: You better start this command from a terminal window external to your IDE.

Known Issues

Browser Support

  • Firefox on Android - On Firefox for Android the input box for the numbers are partially covered by the classification input (Issue #1)
  • Legacy Microsoft Edge - While the code works fine with Mozialla Firefox and Google Chrome, legacy Microsoft Edge has some issues loading all assets properly.
    • Interestingly, if you have the debugger tools open, refreshing the page once or twice usually makes it work in Edge as well.

Using in a Coding Dojo

This repo can work as the basis for a coding dojo learning the basics of property-based testing.

Start with Branch DojoStart

The branch DojoStart offers a starting point. A working setup of the code is in place, but its implementation is strikingly wrong:

An out of shape pyramid

A few tests are in place to see how to get started with implementing property-based tests.

Roles for Pair-Programming

It is instructional (and fun BTW!) to make the excercise in pairs with very special roles:

The Tester

  • Formulates a property
  • Implements a property-based spec

Hint: Make sure that property and spec is very focused on just one single aspect.

The Developer

  • Implements production code

Developers understand that it is their duty to satisfy whatever spec the tester wrote. But they should embody the following character:

  • Lazy - They code just the minimum. No thinking ahead.
  • Mean - Keeping the code buggy by all means brings them joy.
  • Devious - They do not want the code to be right.

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.