ruby – 变异测试:有人知道突变体吗?

ruby – 变异测试:有人知道突变体吗?,第1张

概述昨天在这个 article的变异测试中偶然发现并且立即尝试了 elasticrepo一个lib我正在写入d性搜索索引github. 不幸的是,我似乎错过了一些东西,因为我没有得到任何所谓的“杀死:rspec”和零突变: lsoave@ubuntu:~/rails/github/elasticrepo$mutant -I lib/elasticrepo -r repo_subset --rspec- 昨天在这个 article的变异测试中偶然发现并且立即尝试了 elasticrepo一个lib我正在写入d性搜索索引github.

不幸的是,我似乎错过了一些东西,因为我没有得到任何所谓的“杀死:rspec”和零突变:

lsoave@ubuntu:~/rails/github/elasticrepo$mutant -I lib/elasticrepo -r repo_subset --rspec-dm2 ::RepoSubsetMutant configuration:Matcher:   #<Mutant::Matcher::ObjectSpace scope_name_pattern=/\ARepoSubset(\z|::)/>Filter:    Mutant::Mutation::Filter::ALLStrategy:  #<Mutant::Strategy::Rspec::DM2>subjects:   0mutations:  0noop_fails: 0kills:      0alive:      0mtime:      0.00srtime:      0.01slsoave@ubuntu:~/rails/github/elasticrepo$

现在我认为它可能与路径有关,然后在这种情况下:

lsoave@ubuntu:~/rails/github/elasticrepo$ls -l lib/elasticrepototal 16-rw-rw-r-- 1 lsoave lsoave  333 Jun  8 16:07 extractor.rb-rw-rw-r-- 1 lsoave lsoave 1960 Jun  8 16:07 indexer.rb-rw-rw-r-- 1 lsoave lsoave 1330 Jun  8 16:07 repo_subset.rb-rw-rw-r-- 1 lsoave lsoave   43 Jun  1 12:28 version.rblsoave@ubuntu:~/rails/github/elasticrepo$

这里是要测试的类的“结构”(就命名空间而言):

lsoave@ubuntu:~/rails/github/elasticrepo$head -2 lib/elasticrepo/repo_subset.rbmodule Elasticrepo  class RepoSubsetlsoave@ubuntu:~/rails/github/elasticrepo$

请随意查看整个代码以测试突变:elasticrepo

由于响应行,正则表达式也可能出现问题:

Matcher:   #<Mutant::Matcher::ObjectSpace scope_name_pattern=/\ARepoSubset(\z|::)/>

任何人都可以帮忙吗?

解决方法 免责声明:突变的作者在这里.

刚克隆你的回购.需要改变:

>突变体目前仅在mri-1.9.3和rbx 19-模式下运行.我很快就会把它移植到2.0.0.
>指定完全限定的常量名称:: Elasticrepo :: RepoSubset而不是:: RepoSubset
>另请注意,对于当前的突变体版本,标志–rspec-dm2被简单地替换为–use rspec

Mutant确实可以正确运行此更改.

快乐变异!

总结

以上是内存溢出为你收集整理的ruby – 变异测试:有人知道突变体吗?全部内容,希望文章能够帮你解决ruby – 变异测试:有人知道突变体吗?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1280013.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存