【问题标题】:How to Use AI to analyse test execution output (SQL output) to design a regression suite?如何使用 AI 分析测试执行输出(SQL 输出)来设计回归套件?
【发布时间】:2017-02-16 08:17:49
【问题描述】:

我们目前运行 SQL 报告来提取测试执行输出,以便我们可以查看测试的成功程度,然后对要添加到我们的回归套件中的测试做出有根据的猜测。

但是,这很耗时,因为它需要有人检查所有数据并做出某些假设。

我的任务是研究使用人工智能来筛选数据的可能性,并想知道是否有人尝试过以及他们是如何实施的。

【问题讨论】:

  • 如果输出在某种程度上是可重复的并且不是太大,我会推荐一个与文本分析连接的神经网络。
  • 如果您对实施有任何建议,我们将不胜感激,即使用的软件,分步指南。

标签: sql testing artificial-intelligence regression-testing


【解决方案1】:

我不确定这是否可行,但您可以使用开箱即用的 Python scikit-learn

就这么简单:

from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.neural_network import MLPClassifier
from sklearn.pipeline import Pipeline
import pandas as pd
####DATA PREP##
data = pd.read_csv('filepath')
#Forgot the target xD
# target = pd.read_csv('target_data_filepath')
target = data.target #If target is in data
other_data = pd.read_csv('filepath_other')
###MAKE MODEL##
tfidf_vect = TfidfVectorizer()
mpl_class = MLPClassifier()
pipe = Pipeline([('Tfidf Vectorizer', tfidf_vect),('MLP Classifier', mlp_class)]
pipe.fit(data, target) #remove target from data beforehand if applies
####PREDICT###
pipe.predict(other_data)

data 是您在单独条目中的文本,每条记录的整个输出

target 是你事先找到的,不管它是否应该包含在某处

other_data 是您要测试的内容

但请注意,以上只是一个模型,我不保证我的所有方法名称都是正确的。阅读请关注scikit-learn's doku,相当昂贵但内容丰富的书籍,例如Building Machine Learning Systems with Python on Packt,还有很多其他免费的blogs like this machinelearningmastery.com

【讨论】:

  • 谢谢你 - 一些有用的资源让我开始调查
猜你喜欢
  • 2023-03-26
  • 1970-01-01
  • 2022-12-12
  • 2017-01-12
  • 2020-11-26
  • 2011-04-30
  • 1970-01-01
  • 2015-12-21
  • 2020-09-03
相关资源
最近更新 更多