PHPackages                             gquemener/behat-analysis-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. gquemener/behat-analysis-extension

AbandonedLibrary

gquemener/behat-analysis-extension
==================================

Analysis tool for Behat

v1.0.0(12y ago)2710.9k↓100%2[3 issues](https://github.com/gquemener/behat-analysis-extension/issues)MITPHPPHP &gt;=5.3.4

Since Jul 17Pushed 7y ago2 watchersCompare

[ Source](https://github.com/gquemener/behat-analysis-extension)[ Packagist](https://packagist.org/packages/gquemener/behat-analysis-extension)[ RSS](/packages/gquemener-behat-analysis-extension/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Behat analysis extension
========================

[](#behat-analysis-extension)

[![Latest Stable Version](https://camo.githubusercontent.com/19b48322f1e9e75300af1ceebc13a7fcaa309edd03c6d5294d7e084a9e02f36e/68747470733a2f2f706f7365722e707567782e6f72672f677175656d656e65722f62656861742d616e616c797369732d657874656e73696f6e2f762f737461626c652e706e67)](https://packagist.org/packages/gquemener/behat-analysis-extension)[![Build Status](https://camo.githubusercontent.com/6f100589e8ef483c95e271901813fddc4aad28c5a1e281a4cab29218c918b4b3/68747470733a2f2f7472617669732d63692e6f72672f677175656d656e65722f62656861742d616e616c797369732d657874656e73696f6e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/gquemener/behat-analysis-extension)

Introduction
------------

[](#introduction)

[![Why?](https://camo.githubusercontent.com/d41953a1c55ef5be67bdd04de3ada8b8406c9a716f46ab8e3062072180a35ccb/687474703a2f2f616d69656368726973746f2e66696c65732e776f726470726573732e636f6d2f323031332f30362f686f772d692d6d65742d796f75722d6d6f746865722d6261726e65792d7768792e676966)](https://camo.githubusercontent.com/d41953a1c55ef5be67bdd04de3ada8b8406c9a716f46ab8e3062072180a35ccb/687474703a2f2f616d69656368726973746f2e66696c65732e776f726470726573732e636f6d2f323031332f30362f686f772d692d6d65742d796f75722d6d6f746865722d6261726e65792d7768792e676966)

Well, I always start asking "why?" when encoutering some crazy project. So, I will start by answering this trivial question.

I've simply realised that the more a project grows, the more its `FeatureContext` also grows! Some of the ones I've worked on have more than 1000 lines of code and it suffers from the same maintainability issues than any other huge class. Many great tools already exists to provide solution against this drawback: OOP, [SubContexts](http://docs.behat.org/guides/4.context.html#using-subcontexts), [PageObjectContext](https://github.com/sensiolabs/BehatPageObjectExtension), ...

But still, sometimes you need to look at your past and try to improve what you've done and that's why I've done this extension!

This extension provides some basic analysis about your step definitions. For the moment, it focuses on rarely used steps and similar ones.

Installation
------------

[](#installation)

1. Define dependencies in your `composer.json`:

```
{
    "require": {
        ...

            "gquemener/behat-analysis-extension": "~1.0"
    }
}
```

2. Install/update your vendors:

```
    $ curl http://getcomposer.org/installer | php
    $ php composer.phar install
```

3. Activate extension by specifying its class in your `behat.yml`:

```
    # behat.yml
    default:
        # ...
        extensions:
            Behat\AnalysisExtension\Extension: ~
```

Usage
-----

[](#usage)

After installation, a new `analysis` formatter should be available. Then, run your feature suite using it:

```
    $ bin/behat -fanalysis --dry-run
```

NB: It's recommended (but not mandatory) to run the analysis using the `--dry-run` option to accelerate the report generation.

Example
-------

[](#example)

```
    $ bin/behat -fanalysis --dry-run
        ---------------------------------------------------------------------- 70
        ---------------------------------------------------------------------- 140
        ---------------------------------------------------------------------- 210
        ---------------------------------------------------------------------- 280
        ---------------------------------------------------------------------- 350
        ------------------------

        58 scenarios (58 skipped)
        374 steps (374 skipped)

        Behat Steps Analysis
        ====================
        40 steps were used once.
        The most used step is /^I am logged in as "([^"]*)"$/ with 58 calls.
        Some steps might be merged to reduce their implementation redundancy:
          - /^I am on the "([^"]*)" attribute page$/ and /^I am on the "([^"]*)" product page$/
          - /^I enable the product$/ and /^I disable the product$/
          - /^I enable the product$/ and /^I save the product$/
          - /^an enabled "([^"]*)" product$/ and /^a disabled "([^"]*)" product$/
```

Contribution
------------

[](#contribution)

It is more than welcome as always!

Feel free to contact me on twitter [@GildasQ](http://www.twitter.com/GildasQ) or through [the issue system](https://github.com/gquemener/behat-analysis-extension/issues/new).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4680d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/601a33ec3e405a1a803937142a0917bd2a4fef4a55ac8bb0f506084f70d09039?d=identicon)[GildasQ](/maintainers/GildasQ)

---

Top Contributors

[![gquemener](https://avatars.githubusercontent.com/u/668604?v=4)](https://github.com/gquemener "gquemener (10 commits)")

### Embed Badge

![Health badge](/badges/gquemener-behat-analysis-extension/health.svg)

```
[![Health](https://phpackages.com/badges/gquemener-behat-analysis-extension/health.svg)](https://phpackages.com/packages/gquemener-behat-analysis-extension)
```

###  Alternatives

[drupal/drupal-extension

Drupal extension for Behat

22215.1M147](/packages/drupal-drupal-extension)[friends-of-behat/symfony-extension

Integrates Behat with Symfony.

48223.4M550](/packages/friends-of-behat-symfony-extension)[friends-of-behat/variadic-extension

Variadic support for behat context arguments

2286.0M445](/packages/friends-of-behat-variadic-extension)[friends-of-behat/mink-extension

Mink extension for Behat

14034.2M466](/packages/friends-of-behat-mink-extension)[wp-cli/wp-cli-tests

WP-CLI testing framework

422.7M87](/packages/wp-cli-wp-cli-tests)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
