npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cucumber-perf

v2.0.1

Published

The js implimentation of Cucumber-Perf

Downloads

32

Readme

cucumber-perf-js

A performance testing framework for cucumber io.

What is Cucumber Perf?

Cucumber perf represents a new idea in automated testing development.

What is Cucumber?

Cucumber is a implementation of Behavior Driven Development (BDD). Which uses simple natural language scripts to define a software feature. These executable specifications are written in a language called gherkin. Example:

Feature: Beer
  Scenario: Jeff drinks a beer
  Given: Jeff is of age and has a beer
  And: Jeff opens his beer.
  When: Jeff takes a sip.
  Then: Verify he enjoyed it.

These scripts can be used to develop the features themselves but also drive automated tests.

The issue?

So, you now have a working functional automation test suite. But you want to run a performance test. This would require either rewriting your existing functional tests or copying a bunch of code. Also, you would need to create a performance test harness.

Most likely each team will end up with something that is project specific and doesn't use the existing functional code base.

The fix

Cucumber Perf provides a level of automation on top of Cucumber. It’s an implementation of a new concept (as far as I know) called Concurrent Behavior Driven Testing (CBDT).

Cucumber perf provides a means to use your existing functional code without writing a single line of code. It provides the ability to run performance simulations with support for common load testing features:

  • Timed Tests
  • Multi-Threading
  • Thread Count Limits
  • Ramp Up/Down
  • Data replacing
  • Random Wait
  • Reporting
  • Logging

It uses a type of script called Salad. Salad is a reimplementation of Cucumber Gherkin with the focus on performance simulations.

Plan: Bar visit

Simulation: Jeff drinks 3 beers.
  Group: beer.feature
  Runners: 1
  Count: 3

Plans:

Here is an example plan

Plan: test
Simulation: simulation 1
Group test.feature
	#slices
	#these values will replace property "value out"
	|value out|
	|changed value 1|
	|changed value 2|
	#number of threads
	Runners: 2
	#total number of threads to run.
	Count: 2
#a optional random wait mean for before thread runs tests.
#thread will wait between +-50% of this mean
RandomWait: 00:00:02

#Will run all groups for the period below
Simulation Period: simulation 2 period
Group test.feature
	|value out|
	|changed value |
		Threads: 5
		#count is ignored in a simulation period
		Count: 1
#run time
Time: 00:00:30
RampUp: 00:00:10
RampDown: 00:00:10

What is Concurrent Behavior Driven Testing?

Concurrent Behavior Driven Testing is the methodology of creating functional automation that can be used in concurrent test scenarios. This means coding with the understanding that each functional test could be used in a multithreaded environment.

CBDT requires an automation team to follow strict guidelines when coding functional test cases. Being careful to avoid static variables and race conditions that will cause failures in a multi-threaded world. This of course requires a larger understanding of programing or a least team leadership that can enforce these guidelines.

Getting Started

It takes planning to implement Cucumber Perf.

Your functional automation should follow these rules:

  • Use a non specific test harness. This should standardize all your common functions.
  • Do not use static variables! Your code must work in a multithreaded world.
  • Properly comment your features and scenarios. You want to keep track of what scenarios can be run multithreaded.

Follow directions in wiki to get up and running.

Installing

npm i cucumber-perf

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details