如何准确定位反馈回来的bug问题

本文分享了如何准确地定位用户反馈的Bug问题。首先需要详细询问并尝试复现问题,其次考虑用户使用的具体环境,并从业务流程及操作入口出发分析可能性。此外,与软件开发者合作寻找解决方案也是关键。

如何测试准确定位反馈回来的bug问题

当一个用户反馈过来的bug问题,应该如何进行分析呢?

在最近遇到的bug问题我进行了一些总结:

1、询问发生问题的具体操作,我们是否有条件,进行还原,
ps:第一点其实不容易,用户通常很难把问题完整的描述下来,再通过客服或市场转述回来,信息很容易出现偏差,所以很多时候需要我们自己判断。

2、分析用户出现问题的主要情境
因为使用软件或硬件的环境不同可能会影响测试结果,最好能还原用户的真实环境。

3、通过业务流程和操作入口来分析用户操作的可能性。
业务流程我们很容易想到,但偶尔会遗忘操作入口的情况,例如,这段信息在A和B都能保存,但你只考虑到A的情况,这就少了一种情况,所以这点要注意。

4、咨询软件开发者的意见
有时候,我们查找问题还要软件人员的帮助,因为软件开发人员作为操刀者,最有可能给你提供测试的思路,我有次问题就是跟软件开发者沟通后,重新设计,才找到bug问题的来源和操作。

因为我测试的流程和用例都设计好了,而且每次版本发布我们都会做大大小小的用例测试,难免会有特殊操作没有覆盖掉,发现BUG问题,其实也帮助了我们完善测试流程和用例,所以爱上发现bug问题其实也很有必要。

自己的一点分析,欢迎交流!

import React, { useRef, useEffect, useState } from 'react'; import * as echarts from 'echarts'; import EChartsReact from 'echarts-for-react'; import { index } from 'd3'; import { log } from 'echarts/types/src/util/log.js'; type Props = { data: number[][]; propid: number; setRedLine: (value: number) => void; lineIndex: number; }; const LineGraph: React.FC<Props> = ({ data, propid, setRedLine, lineIndex }) => { const chartRef = useRef<EChartsReact | null>(null); const [showMarkPoint, setShowMarkPoint] = useState(false); // 控制气泡显示状态 const [legendIndex, setLegendIndex]= useState(0); // 选中区域(默认全部) const [startValue, setStartValue]=useState(0); const [endValue, setEndValue]=useState(data.length); // 计算TP90 function getTp90() { const values = data.map(item => item[0]); const sorted = [...values].sort((a, b) => b - a); const lineIndex = Math.max(0, Math.floor(sorted.length * 0.9) - 1); return sorted[lineIndex] || 0; } // 生成图表配置 const getOption = () => { const linearr = []; const legenddata = []; for (let i = 0; i < data[0].length; i++) { linearr.push(data.map(item => item[i])); legenddata.push(`Line ${i + 1}`); } const dataseries = linearr.map((lineData, idx) => { let newarr=[...lineData] let objArr=Object.entries(newarr).slice(startValue || 0,(endValue || data.length-1)+1) let sortarr=objArr.sort((a,b)=>b[1]-a[1]).slice(0,5).map(item=>item[0]) console.log("--------------------------------------------"); console.log("前5个索引",sortarr); console.log("当前索引数组",objArr); console.log("索引:",legendIndex); // console.log( propid,idx,"---start1:",startValue || 0,"end1:",(endValue || data.length-1)+1); console.log( propid,idx,"---start5:",startValue,"end5:",endValue+1 ); console.log("最终值:", showMarkPoint && legendIndex==idx ? { data: [ ...sortarr.map((item, index) => { if (objArr.map(item=>item[0]).indexOf(item)<0 ) { return null; } return { name: `峰值 ${index + 1}`, value: lineData[Number(item)], xAxis: Number(item), yAxis: lineData[Number(item)], } }) ] } :undefined ); return{ name: `Line ${idx + 1}`, type: 'line', data: lineData, showSymbol: true, markPoint: showMarkPoint && legendIndex==idx ? { data: [ ...sortarr.map((item, index) => { return { name: `峰值 ${index + 1}`, value: lineData[Number(item)], xAxis: Number(item), yAxis: lineData[Number(item)], } }) ] } :undefined } }); const markLineSeries = { name: 'MarkLines', type: 'line', data: [], showSymbol: false, silent: false, markLine: { symbol: 'none', animation: false, data: [ { silent: true, legendHoverLink: false, yAxis: getTp90(), name: `TP90`, lineStyle: { color: '#00f', type: 'dashed', width: 2 }, label: { show: true, formatter: `TP90:${getTp90()}` } }, { silent: true, legendHoverLink: false, xAxis: lineIndex, lineStyle: { color: '#f00', type: 'solid', width: 2 }, label: { show: true, formatter: `当前位置:${lineIndex + 1}` } }, { name: 'tip', silent: true, xAxis: lineIndex, lineStyle: { width: 0 }, label: { backgroundColor: 'rgba(0,0,0,0.7)', color: '#fff', padding: 8, offset: lineIndex-startValue>endValue-lineIndex? [-10,230]:[10, 230], align: lineIndex-startValue>endValue-lineIndex? 'right' : 'left', borderRadius: 4, formatter: [ `${lineIndex + 1}\n`, lineIndex >= 0 && lineIndex < data.length ? data[lineIndex].map((item: any, index2: any) => `line${index2 + 1}: ${item}`).join('\n\n') : null ].join('\n'), } } ] } }; const series = [...dataseries, markLineSeries]; const xAxisData = data.map((_, idx) => idx + 1); return { title: { text: `${propid}号折线图` }, tooltip: { trigger: 'axis', }, toolbox: { feature: { myTool2: { show: true, title: '顶峰值', icon: 'image://https://echarts.apache.org/zh/images/favicon.png', onclick: function (){ setShowMarkPoint(prev=>!prev); } }, dataZoom: { yAxisIndex: 'none' }, } }, legend: { data: legenddata }, xAxis: { type: 'category', name: '索引', data: xAxisData }, yAxis: { type: 'value', name: '数值' }, series: series, }; }; const onChartReady = (myChart: any) => { const zr = myChart.getZr(); const clickHandler = (params: any) => { const pointInPixel = [params.offsetX, params.offsetY]; const pointInGrid = myChart.convertFromPixel({ seriesIndex: 0 }, pointInPixel); const isInGrid = myChart.containPixel({ seriesIndex: 0 }, pointInPixel); if (isInGrid && pointInGrid && pointInGrid[0] >= 0 && pointInGrid[0] < data.length) { setRedLine(pointInGrid[0]); } }; zr.on('click', clickHandler); myChart.on('legendselectchanged', (params: any) => { let newarr = Object.values(params.selected); setLegendIndex(newarr.indexOf(true)); // setLegendIndex(newarr.indexOf(true)); console.log("start1:",startValue,"end1:",endValue); console.log("----test-----",myChart.getOption().series[0].markPoint); console.log("----2test2-----",myChart.getOption().series[0]); }); myChart.on('dataZoom', (params: any) => { // console.log("start:",params.batch[0].startValue,"end:",params.batch[0].endValue); setStartValue(params.batch[0].startValue); setEndValue(params.batch[0].endValue); console.log('缩放数据:', params); } ) }; return ( <div style={{ position: 'relative' }}> <EChartsReact ref={chartRef} option={getOption()} style={{ width: '1000px', height: '400px' }} notMerge={false} onChartReady={onChartReady} lazyUpdate={false} /> </div> ); }; export default LineGraph; // 还是不行(前提当气泡小于5个)经过点击legend后缩放图表,然后再次调整legend操作会让图表出现空的峰值气泡?且一直定位不动?怎么解决bug?
最新发布
08-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值