定制 halleck45/mutatesting 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

halleck45/mutatesting

Composer 安装命令:

composer require halleck45/mutatesting

包简介

mutation testing tool for PHP

README 文档

README

Mutation testing tool for PHP.

Build Status Latest Stable Version

According to Wikipedia:

Mutation testing (or Mutation analysis or Program mutation) evaluates the quality of software tests. Mutation testing involves modifying a program's source code or byte code in small ways.

MutaTesting supports PHPUnit and atoum. You can create an adapter for any PHP testing framework.

## Requirements

You only need PHP 5.3 . No specific PHP extension is required...

Installation

### As phar archive

Simply download the phar archive and run the following command :

php mutatesting.phar {tool} {binary}  {test directory}

With Composer

Edit your composer.json:

"require": {
    "halleck45/mutatesting" : "@dev"
}

And run Composer:

php composer.phar update halleck45/mutaTesting

Usage

./bin/mutatesting {tool} {binary}  {test directory}

Example for PHPUnit:

./bin/mutatesting phpunit phpunit.phar myTestFolder

Example for atoum:

./bin/mutatesting atoum mageekguy.atoum.phar myTestFolder

Note that you don't need to use the -d or -f option with atoum...

Advanced usage

Strategy

In order to avoid to have too much mutants, MutaTesting uses PhpMetrics in order to estimate number of bugs in each tested file, and focuses only on files that contain more anomalies.

You can use the --bugs option to define the limit to use.

For example, --bugs=".6" means that mutants are preserved only if there is at least 0.6 estimated bugs in the tested file.

Formatters

To have a html report file, tou need to use the --report-html option.

./bin/mutatesting {tool} {binary} {test directory} --report-html=/tmp/file.html

Testing options

If your tests need options, you can pass them with --options

./bin/mutatesting phpunit phpunit.phar  myTestFolder --options="-c phpunit.xml"

#### Parallelization

You can change the number of parallelized tests with the processes options :

./bin/mutatesting {tool} {binary} {test directory} --processes=10

#### Performance

MutaTesting is very slow : your unit tests will be runned as many times as there are mutant. In order to increase performance, a cache file is created in /tmp/muta-cache.php.

Copyright

Copyright (c) 2014 Jean-François Lépine. See LICENSE for details.

统计信息

  • 总下载量: 157
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 66
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 65
  • Watchers: 5
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-06-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固