当前位置:网站首页>我的Debug之路1.0
我的Debug之路1.0
2022-06-21 14:45:00 【sunonzj】
刚做完一个项目肯定是会有问题的,不可能测试一个bug都没有.吧..
之前开发的接口项目,提供给微信小程序用的。
最近项目和前端对接,发现了很多问题,简单说一下解决异常的思路心得。
先了解是哪个接口有问题,具体的异常信息是什么。
(像一些参数效验、抛出异常信息,记录错误日志真的是非常重要,因为项目在服务器跑起来能除了浏览器调试查看异常信息,也只能靠日志记录错误了)
1、数据问题:数据库测试数据有问题,查看是否有关联表未插入数据或者插入的数据不对。分析他们填写到后台的参数类型,格式是否符合(有些没做参数效验...)。
2、服务问题:查看服务是否构建、zookeeper中服务提供是否正常。
3、接口代码问题,(代码问题那就是测试不够啊,这样不好,改起来麻烦而且影响进度),,以后还是要自己多测试找找bug,尽量让接口没bug,因为和前端沟通,然后再修改,再重新构建,步骤还是挺复杂的。
确认参数无误,那就运行本地项目,测试一下(用他们的参数)运行确实报错,查看错误信息,并解决,根据错误信息还不能解决,设断点,找出报错的代码。。登录服务器查看日志,日志显示事务的第一个节点的save方法有问题,服务重新构建无误,查看dubbo(用的zookeeper)也没问题,md这时候就很烦了(大概确定服务、数据库、代码都没问题,而事务有问题),百度错误信息,还是没解决,请教同事看着他操作一番也没查到错误,最后在新建流程的地方发现错误在这呢,,原来是之前项目经理设计数据库时表名单词拼错trade写成了tarde,然后同事改回来了..但那时候我们代码都写完了,只好把代码都改成trade...然后漏了这个流程新建的地方忘记改了,导致服务save的时候有问题,因为服务命名是根据表名写的。
一个不算错误的错误,解决起来却花了不少时间啊··· 还浪费了同事时间,这种问题我一时还发现不了,同事也是搞了一番才找到。。以后想问题还是得更全面一点吧。
ps:找问题和解决问题的方法基本都是跟我那个同事学的,看他解决问题的办法和思路,受益良多,当然问的多了他也会烦,所以有时候态度不好,都是可以理解的。
解决过的问题也很多了,各种问题也遇到过,最费时间的还是那种不是问题的问题,,有的时候会搞个一上午,然后吃完中饭回来一看,”哇擦,原来这地方有个空格”。经常耗在一个简单到爆的地方很久,心态有时候都会炸。。
细心很重要,全局观也要,不能被一个方法或者一句代码卡着。。然后,实在想不出来的时候,不防先休息一下(上个厕所或者揉一揉大脑),你会发现突然你就知道哪里错了..
思路要清晰,虽然很容易被搞混乱。。不能钻牛角尖,虽然老是因为想要搞明白某个问题而浪费几个小时。
Debug Still in....
边栏推荐
- Judge password strength - Optimization
- [how to install MySQL 8.0 to a non system disk] [how to create a new connection with Navicat and save it to a non system disk] and [uninstall MySQL 8.0]
- Small case of throttling function
- [font multi line display ellipsis] and [dialog box] implementation ----- case explanation, executable code
- Qt-8- use SQL database
- 网上开户安全吗?新手可以开账户吗
- Because the college entrance examination is the most fair competition and selection
- Format printout
- CSDN's test teacher teaches JMeter to generate stress test reports
- 养老年金险是理财产品吗?资金安全吗?
猜你喜欢

Redisson distributed lock design from a bug

Summary of the most basic methods of numpy
![[graduation project recommendation] - personnel management system](/img/b5/4235b54fa0da9e4637010a68bf848b.jpg)
[graduation project recommendation] - personnel management system

Make word2vec for Bert model

JS written test question: array

Chart. JS 2.0 doughnut tooltip percentage - chart js 2.0 doughnut tooltip percentages

Taobao secsha plug-in

USB message capture tcpdump

Chapter 3 - data link layer

Two of my essays
随机推荐
Is pension insurance a financial product? Is the fund safe?
Write a compile time annotation
2021 the latest selenium truly bypasses webdriver detection
Numpy: basic package for high performance scientific computing & data analysis
Chart. JS 2.0 doughnut tooltip percentage - chart js 2.0 doughnut tooltip percentages
Mqtt keepalive and reconnect
Clickhouse cluster installation has too many dry goods
T32 custom menu bar
JS interview questions: variable promotion function promotion, scope chain error prone questions
Work assessment of contract law of Jilin University in March of the 22nd spring -00100
Use OpenCV to decompose the video into single frame pictures and synthesize the video with pictures
Mysql5.7 setup password and remote connection
Define structure dynamically when macro is defined
Chapter 2 - physical layer (I)
启牛学堂app下载证券开户,是安全的吗?有风险嘛?
Getting started with qt-1-ui
The SQL query statement executes select (1) first, and the ByteDance algorithm engineer is interviewed
STM32F0-DAY1
Gensim error attributeerror: type object 'word2vec' has no attribute 'load_ word2vec_ format‘
Compile time annotation automatically generates dataholder