代码审查常见代码质量问题

2023-10-29

 配套的Bug解释模式

为了有针对性的使用这个工具,减少bug的误报,提高使用效率,我们选择了10个左右的bug模式,下面就是对这10个模式的解释。

这些bug可能会引起程序的性能或逻辑问题.

需要说明的是,findbugs能检测的bug pattern远不仅于此,甚至可以定制自己的探测器,因此,这个文档会不断扩充,同时,也欢迎大家不断探索和分享使用实践.

大的分类主要包括以下几种:

Bad practice

不好的习惯

Correctness

代码的正确性

Dodgy

小问题

Malicious code vulnerability

恶意代码

Internationalization

国际化问题

Performance

性能问题

Security

安全性问题

Multithreaded currectness

线程问题

Experrimental

实验性问题

 

 

API:http://findbugs.sourceforge.net/api/index.html

 

技术手册:http://findbugs.sourceforge.net/manual/index.html

 

更多请参见官网:http://findbugs.sourceforge.net/bugDescriptions.html

 

6.1、       ES_COMPARING_PARAMETER_STRING_WITH_EQ

     ES: Comparison of String parameter using == or != (ES_COMPARING_PARAMETER_STRING_WITH_EQ)

This code compares a java.lang.String parameter for reference equality using the == or != operators. Requiring callers to pass only String constants or interned strings to a method is unnecessarily fragile, and rarely leads to measurable performance gains. Consider using the equals(Object) method instead.

     使用 == 或者 != 来比较字符串或interned字符串,不会获得显著的性能提升,同时并不可靠,请考虑使用equals()方法。

6.2、       HE_EQUALS_NO_HASHCODE

     HE: Class defines equals() but not hashCode() (HE_EQUALS_NO_HASHCODE)

This class overrides equals(Object), but does not override hashCode().  Therefore, the class may violate the invariant that equal objects must have equal hashcodes.

     类定义了equals()方法但没有重写hashCode()方法,这样违背了相同对象必须具有相同的hashcodes的原则

6.3、       IT_NO_SUCH_ELEMENT

     It: Iterator next() method can't throw NoSuchElement exception (IT_NO_SUCH_ELEMENT)

This class implements the java.util.Iterator interface.  However, its next() method is not capable of throwing java.util.NoSuchElementException.  The next() method should be changed so it throws NoSuchElementException if is called when there are no more elements to return.

     迭代器Iterator无法抛出NoSuchElement异常,类实现了java.util.Iterator接口,但是next()方法无法抛出java.util.NoSuchElementException异常,因此,next()方法应该做如此修改,当被调用时,如果没有element返回,则抛出NoSuchElementException异常

6.4、       J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION

     J2EE: Store of non serializable object into HttpSession (J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION)

This code seems to be storing a non-serializable object into an HttpSession. If this session is passivated or migrated, an error will result.

     将没有实现serializable的对象放到HttpSession中,当这个session被钝化和迁移时,将会产生错误,建议放到HttpSession中的对象都实现serializable接口。

6.5、       ODR_OPEN_DATABASE_RESOURCE

     ODR: Method may fail to close database resource (ODR_OPEN_DATABASE_RESOURCE)

The method creates a database resource (such as a database connection or row set), does not assign it to any fields, pass it to other methods, or return it, and does not appear to close the object on all paths out of the method.  Failure to close database resources on all paths out of a method may result in poor performance, and could cause the application to have problems communicating with the database.

     方法可能未关闭数据库资源,未关闭数据库资源将会导致性能变差,还可能引起应用与服务器间的通讯问题。

6.6、       OS_OPEN_STREAM

     OS: Method may fail to close stream (OS_OPEN_STREAM)

The method creates an IO stream object, does not assign it to any fields, pass it to other methods that might close it, or return it, and does not appear to close the stream on all paths out of the method.  This may result in a file descriptor leak.  It is generally a good idea to use a finally block to ensure that streams are closed.

     方法可能未关闭stream,方法产生了一个IO流,却未关闭,将会导致文件描绘符的泄漏,建议使用finally block来确保io stream被关闭。

6.7、       DMI_CALLING_NEXT_FROM_HASNEXT

     DMI: hasNext method invokes next (DMI_CALLING_NEXT_FROM_HASNEXT)

The hasNext() method invokes the next() method. This is almost certainly wrong, since the hasNext() method is not supposed to change the state of the iterator, and the next method is supposed to change the state of the iterator.

6.8、       IL_INFINITE_LOOP

     IL: An apparent infinite loop (IL_INFINITE_LOOP)

This loop doesn't seem to have a way to terminate (other than by perhaps throwing an exception).

     明显的无限循环.

6.9、       IL_INFINITE_RECURSIVE_LOOP

     IL: An apparent infinite recursive loop (IL_INFINITE_RECURSIVE_LOOP)

This method unconditionally invokes itself. This would seem to indicate an infinite recursive loop that will result in a stack overflow.

     明显的无限迭代循环,将导致堆栈溢出.

6.10、   WMI_WRONG_MAP_ITERATOR

     WMI: Inefficient use of keySet iterator instead of entrySet iterator (WMI_WRONG_MAP_ITERATOR)

This method accesses the value of a Map entry, using a key that was retrieved from a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the Map.get(key) lookup.

     使用了keySet iterator和Map.get(key)来获取Map值,这种方式效率低,建议使用entrySet的iterator效率更高.

6.11、   IM_BAD_CHECK_FOR_ODD

     IM: Check for oddness that won't work for negative numbers (IM_BAD_CHECK_FOR_ODD)

The code uses x % 2 == 1 to check to see if a value is odd, but this won't work for negative numbers (e.g., (-5) % 2 == -1). If this code is intending to check for oddness, consider using x & 1 == 1, or x % 2 != 0.

     奇偶检测逻辑,未考虑负数情况.

 

7.实际项目中Bug类型统计

 

7.1、       Call to equals() comparing different types

 

id: EC_UNRELATED_TYPES, type: EC, category: CORRECTNESS
This method calls equals(Object) on two references of different class types with no common subclasses. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime.

 

 

 

原因分析:

 

这缺陷的意思是,大部分都是类型永远不会有这种情况, 比如a为DOUBLE类型所以EQUALS只匹配字符串 if(a.equals())或if(a.quals())这类判断是根本不会有用的;

 

示例:if("1".equals(DAOValue.valueofSuccess()))

 

 

 

7.2、       Dead store to local variable 

 

id: DLS_DEAD_LOCAL_STORE, type: DLS, category: STYLE

 

This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used.

 

Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

 

 

 

原因分析:

 

DLS问题指的是给本地变量赋了一个值,但随后的代码并没有用到这个值。

 

 

 

7.3、       Method call passes null for nonnull parameter

 

id: NP_NULL_PARAM_DEREF, type: NP, category: CORRECTNESS

 

This method call passes a null value for a nonnull method parameter. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced.

 

 

 

原因分析:对参数为null的情况未作处理。

 

例如:

 

 

 

 

 

7.4、       Method with Boolean return type returns explicit null  

 

id: NP_BOOLEAN_RETURN_NULL, type: NP, category: BAD_PRACTICE

 

A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException.

 

 

 

原因分析:

 

方法如果定义为返回类型Boolean,则可以返回Boolean.TRUE, Boolean.FALSE or null (如果 return 的是 true or  false, 则AutoBoxing 成 Boolean.TRUE, Boolean.FALSE)。因为JDK 支持 基本类型和装箱类型的自动转化, 所以下面的代码中:

 

boolean result = test_NP_BOOLEAN_RETURN_NULL();

 

因为此时test_NP_BOOLEAN_RETURN_NULL() 返回的是NULL, 所以 JDK 做 automatic unboxing 的操作时, 即调用了 object. booleanValue() 方法时,抛出了空指针。

 

改成:boolean result = test_NP_BOOLEAN_RETURN_NULL()==null?false:true;

 

 

 

7.5、       No relationship between generic parameter and method argument

 

id: GC_UNRELATED_TYPES, type: GC, category: CORRECTNESS

 

This call to a generic collection method contains an argument with an incompatible class from that of the collection's parameter (i.e., the type of the argument is neither a supertype nor a subtype of the corresponding generic type argument). Therefore, it is unlikely that the collection contains any objects that are equal to the method argument used here. Most likely, the wrong value is being passed to the method.

 

In general, instances of two unrelated classes are not equal. For example, if the Foo and Bar classes are not related by subtyping, then an instance of Foo should not be equal to an instance of Bar. Among other issues, doing so will likely result in an equals method that is not symmetrical. For example, if you define the Foo class so that a Foo can be equal to a String, your equals method isn't symmetrical since a String can only be equal to a String.

 

In rare cases, people do define nonsymmetrical equals methods and still manage to make their code work. Although none of the APIs document or guarantee it, it is typically the case that if you check if a Collection<String> contains a Foo, the equals method of argument (e.g., the equals method of the Foo class) used to perform the equality checks.

 

 

 

原因分析:调用Collection类中的contains方法比较时,所比较的两个参数类型不致;

 

例如:

 

 

 

修改后:

 

 

 

 

 

7.6、       Null pointer dereference in method on exception path

 

id: NP_ALWAYS_NULL_EXCEPTION, type: NP, category: CORRECTNESS

 

A pointer which is null on an exception path is dereferenced here.  This will lead to a NullPointerException when the code is executed.  Note that because FindBugs currently does not prune infeasible exception paths, this may be a false warning.

 

Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible.

 

 

 

原因分析:在异常处理时,调用一个空对象的方法时可能引起空指针异常。

 

例如:

 

 

 

 

 

7.7、       Nullcheck of value previously dereferenced

 

id: RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE, type: RCN, category:CORRECTNESS

 

A value is checked here to see whether it is null, but this value can't be null because it was previously dereferenced and if it were null a null pointer exception would have occurred at the earlier dereference. Essentially, this code and the previous dereference disagree as to whether this value is allowed to be null. Either the check is redundant or the previous dereference is erroneous.

 

 

 

原因分析:前面获取的对象,现在引用的时候没有交验是否为null。

 

例如:

 

 

 

 

 

 

 

7.8、       Possible null pointer dereference

 

id: NP_NULL_ON_SOME_PATH, type: NP, category: CORRECTNESS

 

There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.

 

 

 

原因分析:可能存在空引用。

 

例如:

 

 

 

 

 

 

 

7.9、       Possible null pointer dereference in method on exception path

 

id: NP_NULL_ON_SOME_PATH_EXCEPTION, type: NP, category: CORRECTNESS

 

A reference value which is null on some exception control path is dereferenced here.  This may lead to a NullPointerException when the code is executed.  Note that because FindBugs currently does not prune infeasible exception paths, this may be a false warning.

 

Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible.

 

 

 

原因分析:

 

代码调用时, 遇到异常分支, 可能造成一个对象没有获得赋值依旧保持NULL空指针。 接下来如果对这个对象有引用, 可能造成NullPointerException 空指针异常。

 

例如:

 

 

 

 

 

 

 

7.10、   Test for floating point equality

 

id: FE_FLOATING_POINT_EQUALITY, type: FE, category: STYLE

 

This operation compares two floating point values for equality. Because floating point calculations may involve rounding, calculated float and double values may not be accurate. For values that must be precise, such as monetary values, consider using a fixed-precision type such as BigDecimal. For values that need not be precise, consider comparing for equality within some range, for example: if ( Math.abs(x - y) < .0000001 ). See the Java Language Specification, section 4.2.4.

 

 

 

原因分析:

 

Float类型的数据比较时,会存在的定的误差值,用!=来比较不是很准确,建议比较两个数的绝对值是否在一定的范围内来进行比较。如,if ( Math.abs(x - y) < .0000001 )

 

例如:

 

 

 

 

 

7.11、   Useless assignment in return statement

 

id: DLS_DEAD_LOCAL_STORE_IN_RETURN, type: DLS, category: STYLE

 

This statement assigns to a local variable in a return statement. This assignment has effect. Please verify that this statement does the right thing.

 

 

 

原因分析:

 

在return的对象中,没有必要通过对象赋值再进行返回。

 

例如:

 

 

 

 

 

7.12、   Write to static field from instance method

 

id: ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD, type: ST, category: STYLE

 

This instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice.

 

 

 

原因分析:向static字段中写入值。

 

例如:
 private static DBRBO dbrBO;
 public final void refresh() {
        danskeBankBO = null;
        dbrBO = null;
        fileAndPathBO = null;
    }
建议改为:去掉static。

 

 

 

7.13、   Incorrect lazy initialization and update of static field

 

id: LI_LAZY_INIT_UPDATE_STATIC, type: LI, category: MT_CORRECTNESS

 

This method contains an unsynchronized lazy initialization of a static field. After the field is set, the object stored into that location is further updated or accessed. The setting of the field is visible to other threads as soon as it is set. If the futher accesses in the method that set the field serve to initialize the object, then you have a very serious multithreading bug, unless something else prevents any other thread from accessing the stored object until it is fully initialized.

 

Even if you feel confident that the method is never called by multiple threads, it might be better to not set the static field until the value you are setting it to is fully populated/initialized.

 

 

 

原因分析:

 

该方法的初始化中包含了一个迟缓初始化的静态变量。你的方法引用了一个静态变量,估计是类静态变量,那么多线程调用这个方法时,你的变量就会面临线程安全的问题了,除非别的东西阻止任何其他线程访问存储对象从直到它完全被初始化。

 

 

 

7.14、   Method ignores return value

 

id: RV_RETURN_VALUE_IGNORED, type: RV, category: CORRECTNESS

 

The return value of this method should be checked. One common cause of this warning is to invoke a method on an immutable object, thinking that it updates the object. For example, in the following code fragment,

 

String dateString = getHeaderField(name);

 

dateString.trim();

 

the programmer seems to be thinking that the trim() method will update the String referenced by dateString. But since Strings are immutable, the trim() function returns a new String value, which is being ignored here. The code should be corrected to:

 

String dateString = getHeaderField(name);

 

dateString = dateString.trim();

 

 

 

原因分析:方法忽略了设置返回值。

 

例如:

 

 

 

 

 

 

 

7.15、   Method might ignore exception

 

id: DE_MIGHT_IGNORE, type: DE, category: BAD_PRACTICE

 

This method might ignore an exception.  In general, exceptions should be handled or reported in some way, or they should be thrown out of the method.

 

 

 

原因分析:应该将异常 处理、打印或者抛出

 

例如:

 

 

 

 

 

 

 

7.16、   Unwritten field

 

id: UWF_UNWRITTEN_FIELD, type: UwF, category: CORRECTNESS

 

This field is never written.  All reads of it will return the default value. Check for errors (should it have been initialized?), or remove it if it is useless.


 

 

原因分析:从未被初始化的变量,调用它时,将返回默认值,要么初始化,要么删掉它。

 

例如:

 

 

 

 

 

7.17、   Value is null and guaranteed to be dereferenced on exception path

 

id: NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH, type: NP, category: CORRECTNESS

 

There is a statement or branch on an exception path that if executed guarantees that a value is null at this point, and that value that is guaranteed to be dereferenced (except on forward paths involving runtime exceptions).

 

 

 

原因分析:exception分支上,存在引用一个null对象的方法,引发空指针异常。

 

例如:

 

 

 

7.18、   Very confusing method names

 

id: NM_VERY_CONFUSING, type: Nm, category: CORRECTNESS

 

The referenced methods have names that differ only by capitalization. This is very confusing because if the capitalization were identical then one of the methods would override the other.

 

 

 

原因分析:被引用的方法中存在容易混淆的变量。

 

例如:fzgsdm改成 fzgsDm 即可。

 

 

 

 

 

7.19、   Method invokes inefficient new String() constructor

 

id: DM_STRING_VOID_CTOR, type: Dm, category: Performance
Creating a new java.lang.String object using the no-argument constructor wastes memory because the object so created will be functionally indistinguishable from the empty string constant "".  Java guarantees that identical string constants will be represented by the same String object.  Therefore, you should just use the empty string constant directly.

 

 

 

原因分析:不使用new String()定义空的字符串

 

例如:

 

         

 

7.20、   Load of known null value

 

id: NP_LOAD_OF_KNOWN_NULL_VALUE, type: Np, category: Dodgy

 

The variable referenced at this point is known to be null due to an earlier check against null. Although this is valid, it might be a mistake (perhaps you intended to refer to a different variable, or perhaps the earlier check to see if the variable is null should have been a check to see if it was nonnull).

 

原因分析:null值的不当使用。

 

例如:

 

 

 

 

 

7.21、   Method concatenates strings using + in a loop  

 

id: SBSC_USE_STRINGBUFFER_CONCATENATION, type: SBSC, category: Performance

 

The method seems to be building a String using concatenation in a loop. In each iteration, the String is converted to a StringBuffer/StringBuilder, appended to, and converted back to a String. This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration. Better performance can be obtained by using a StringBuffer (or StringBuilder in Java 1.5) explicitly.

 

For example:

 

  // This is bad

 

  String s = "";

 

  for (int i = 0; i < field.length; ++i) {

 

    s = s + field[i];

 

  }

 

 

 

  // This is better

 

  StringBuffer buf = new StringBuffer();

 

  for (int i = 0; i < field.length; ++i) {

 

    buf.append(field[i]);

 

  }

 

  String s = buf.toString();

 

原因分析:在循环里使用字符串连接,效率低,应该使用StringBuilder/StringBuffer

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

代码审查常见代码质量问题 的相关文章

  • 软件测试开发/全日制/测试管理丨用户端 App 自动化测试

    随着移动应用的普及和发展 用户端 App 自动化测试成为确保应用质量 提高测试效率的关键环节 这一测试方法不仅可以模拟用户真实的操作行为 还能够覆盖多种设备和平台 为移动应用的稳定性和用户体验提供可靠的保障 选择合适的自动化测试框架 在用户
  • 【软件测试】学习笔记-高效提交Bug

    本篇文章介绍如何才能写出一份高效的软件缺陷报告 测试工程师需要利用对需求的理解 高效的执行力以及严密的逻辑推理能力 迅速找出软件中的潜在缺陷 并以缺陷报告的形式递交给开发团队 缺陷报告是测试工程师与开发工程师交流沟通的重要桥梁 也是测试工程
  • 软件测试|Python Selenium 库安装使用指南

    简介 Selenium 是一个用于自动化浏览器操作的强大工具 它可以模拟用户在浏览器中的行为 例如点击 填写表单 导航等 在本指南中 我们将详细介绍如何安装和使用 Python 的 Selenium 库 安装 Selenium 库 使用以下
  • 外包干了2个月,技术退步明显...

    先说一下自己的情况 大专生 18年通过校招进入武汉某软件公司 干了接近4年的功能测试 今年年初 感觉自己不能够在这样下去了 长时间呆在一个舒适的环境会让一个人堕落 而我已经在一个企业干了四年的功能测试 已经让我变得不思进取 谈了2年的女朋友
  • 软件测试/测试开发/全日制/测试管理丨Python关键字

    Python 语言有一些关键字 它们具有特殊的含义 不能被用作标识符 变量名 函数名等 False 布尔类型的假值 None 表示一个空对象或无值 True 布尔类型的真值 and 逻辑与操作符 as 用于给导入的模块起别名 assert
  • Linux终端常见用法总结

    熟悉Linux终端的基础用法和常见技巧可以极大提高运维及开发人员的工作效率 笔者结合自身学习实践 总结以下终端用法供同行交流学习 常 见 用 法 1 快捷键 1 1 Alt 在光标位置插入上一次执行命令的最后一个参数 1 2 Ctrl R
  • 测试开发必知:有Tomcat,为什么还要Nginx?

    只用Tomcat 不用Nginx搭建Web服务 行不行 我曾经提出的愚蠢问题 今天详细给自己解释下 为什么必须用Nginx 不用Nginx 只用Tomcat的Http请求流程 浏览器处理一个Http请求时 会首先通过DNS服务器找到域名关联
  • 软件测试|Pydantic详细介绍与基础入门

    简介 Pydantic 是一个强大的 Python 库 用于数据验证和解析 特别是用于处理 JSON 数据 它的主要目标是使数据验证和解析变得简单 直观和可维护 本文将介绍 Pydantic 的基础知识 包括如何定义模型 验证数据以及处理错
  • 软件测试|使用matplotlib绘制多种折线图

    简介 在数据可视化领域 Matplotlib是一款非常强大的Python库 它可以用于绘制各种类型的图表 包括折线图 本文将介绍如何使用Matplotlib创建多种不同类型的折线图 并提供示例代码 创建模版 在绘图之前 我们可以先创建我们的
  • 软件测试|Python数据可视化神器——pyecharts教程(九)

    使用pyecharts绘制K线图进阶版 简介 K线图 Kandlestick Chart 又称蜡烛图 是一种用于可视化金融市场价格走势和交易数据的图表类型 它是股票 外汇 期货等金融市场中最常用的技术分析工具之一 可以提供关于价格变动 趋势
  • 软件测试|使用matplotlib绘制多种柱状图

    简介 在数据可视化领域 Matplotlib是一款强大的Python库 它可以用于创建多种类型的图表 包括柱状图 本文将介绍如何使用Matplotlib创建多种不同类型的柱状图 并提供示例代码 创建基本柱状图 首先 让我们创建一个基本的柱状
  • 盲猜你不懂H5架构和原生架构的区别

    2024软件测试面试刷题 这个小程序 永久刷题 靠它快速找到工作了 刷题APP的天花板 CSDN博客 文章浏览阅读2 3k次 点赞85次 收藏11次 你知不知道有这么一个软件测试面试的刷题小程序 里面包含了面试常问的软件测试基础题 web自
  • 一篇文章带你了解Python常用自动化测试框架——Pytest

    2024软件测试面试刷题 这个小程序 永久刷题 靠它快速找到工作了 刷题APP的天花板 CSDN博客 文章浏览阅读2 3k次 点赞85次 收藏11次 你知不知道有这么一个软件测试面试的刷题小程序 里面包含了面试常问的软件测试基础题 web自
  • 软件测试中的白盒测试,这些技巧你知道吗?

    对于很多刚开始学习软件测试的小伙伴来说 如果能尽早将黑盒 白盒测试弄明白 掌握两种测试的结论和基本原理 将对自己后期的学习有较好的帮助 今天 我们就来聊聊黑盒 白盒测试的相关话题 1 黑盒测试的方法和小结 最常见黑盒测试方法包括 边界值 等
  • Python常用的自动化小脚本!

    一 list转json string转json 可以使用Python内置的 json 模块将列表 List 和字符串 String 转换成JSON格式 List转JSON假设我们有一个列表 List my list apple banana
  • 软件测试/测试开发/全日制/测试管理丨Android WebView 技术原理

    Android WebView是一个内置的组件 允许在Android应用中嵌套显示Web内容 Android WebView的技术原理涉及到使用WebKit引擎来渲染Web内容 并提供一系列API和回调函数 使得开发人员可以控制和定制Web
  • 一文让你了解UI自动化测试

    测试都起什么作用 是项目的保险 但不是项目的救命草 测试无实际产出 但作用远大于实际产出 测试是从项目维度保证质量 而不是测试阶段 UI自动化 下面简称自动化 基于UI进行自动功能测试 以Web端作为例子 一般的UI功能自动化都是基于HTM
  • 外包干了2个月,技术倒退2年。。。

    先说一下自己的情况 本科生 20年通过校招进入深圳某软件公司 干了接近4年的 功能测试 今年国庆 感觉自己不能够在这样下去了 长时间呆在一个舒适的环境会让一个人堕落 而我已经在一个企业干了四年的功能测试 已经让我变得不思进取 谈了3年的女朋
  • 外包干了3个月,技术退步明显。。。。。

    先说一下自己的情况 本科生 20年通过校招进入广州某软件公司 干了接近3年的 功能测试 今年年初 感觉自己不能够在这样下去了 长时间呆在一个舒适的环境会让一个人堕落 而我已经在一个企业干了3年的功能测试 已经让我变得不思进取 谈了2年的女朋
  • 软件测试面试:还没有自动化测试项目经验,3个项目帮你走入软测职场!

    2024软件测试面试刷题 这个小程序 永久刷题 靠它快速找到工作了 刷题APP的天花板 CSDN博客 文章浏览阅读2 3k次 点赞85次 收藏11次 你知不知道有这么一个软件测试面试的刷题小程序 里面包含了面试常问的软件测试基础题 web自

随机推荐

  • DB2客户端连接不上db2默认端口50000

    DB2客户端连接不上db2默认端口50000 1 添加组和用户 root localhost expc groupadd g 2000 upp root localhost expc useradd m g upp d home upp u
  • Java中map的分类和常见的情况

    Java为数据结构中定义了一个接口Java util Map 它有四个实现类 分别是HashMap Hash table LinkedHashMap 和 TreeMap Map主要用于存储键值对 根据键得到值 因此不允许键重复 重复了覆盖了
  • RabbitMQ(一)——入门

    前言 原来公司项目的消息中间件一直在用RabbitMQ 今天抽出时间简单总结梳理一下关于RabbitMQ的相关知识点 我们知道消息队列在分布式系统中应用的的地方有很多 它也有很多种类型 除了今天重点介绍的RabbitMQ 还有像Active
  • ADC的接地

    by Walt KesterQ I ve read your data sheets and application notes and also attendedyour seminars but I m still confused a
  • SpringBoot自动装配出现NULL的情况

    环境 idea 2021 6 mysql 8 0 问题描述 今天遇到通过 Autowired注解自动注入后 发现字段为空的问题 问题产生的原因是将被注入的对象交给了IOC容器管理但是却通过new对象的方式使用该对象 导致该对象下的内容都无法
  • C语言if语句实现分支结构应用练习题

    此练习为本人自己练习完成的答案 答案方法不止一种 仅供参考 练习题列表 1 1 计算分段函数 1 10 分 1 2 分段函数 10 分 1 3 打折促销 10 分 1 4 12 24小时制 10 分 1 5 分数等级转换 10 分 1 1
  • HashMap源码

    数组 数组存储区间是连续的 占用内存严重 故空间复杂度很大 但数组的二分查找时间复杂度很小 为 o 1 数组的特点 查找速度快 插入和删除效率低 链表 链表存储区间离散 占用内存比较宽松 故空间复杂度很小 但时间复杂度很大 为 o n 链表
  • MTCNN+CRNN解决车牌识别问题-2

    这次到CRNN部分了 CRNN网络很简单 就是CNN RNN 因为RNN适用于时间序列类型的数据 车牌呢 其实也是有规律的 比如第一位是汉字 后面是字母 汉字 前一部分通过MTCNN将车牌区域已经定位了 那这部分就需要拿CRNN来对其进行训
  • Unable to cast object of type in System.DirectoryServices.AccountManagement.GroupPrincipal

    在使用UserPrincipal Current ToString 获取域登录用户信息时 本地调试没有问题 上传到服务器报错 Unable to cast object of type System DirectoryServices Ac
  • CSwin-PNet: CNN-Swin-Vit 组合金字塔网络用于超声图像中乳腺病变分割

    ATTransUNet 期刊分析 摘要 贡献 方法 整体框架 1 Residual Swin Transformer block 2 Interactive channel attention module 3 Supplementary
  • java数据类型

    整数类型 byte short int long 浮点数类型 float double 字符类型 String 布尔类型 boolean 1 整数类型 byte 128 127 short 32768 32767 int 214748364
  • CTFHub-时间盲注-wp #(自制脚本做法)

    时间盲注脚本 coding utf 8 Time 2021 5 16 19 29 Author z1moq File ctfhub时间盲注 py Software PyCharm import requests import string
  • MATLAB实现控制系统模型(传递函数)的建立与转化,传递函数模型与零极点增益模型的转化,连续系统与离散系统的转化,对比不同采样周期对系统性能的影响

    最近使用MATLAB做了很多控制工程方面的仿真 测试不同系统的响应和特性 不得不说使用MATLAB做控制仿真还是十分简洁方便的 尤其是其中的simulink模块可以提供更加直观的模型 方便分析与测试 今天就分享在matlab中构造传递函数模
  • 【微信小程序】微信支付接入全流程

    一 前置条件 接入支付首先得需要有企业资质 并开通企业对公户 注册微信支付并进行对公户打款认证 二 开始接入 1 下载微信支付的AP证书 2 服务端接入微信支付 2 1 引入相关maven配置
  • Java基础之集合

    Java基础 集合 1 Collection接口 Collection 是 List 和 Set 的父接口 常用方法如下 package com java day16 import java util ArrayList import ja
  • 简单实现继承一个抽象类的同时实现接口

    定义一个抽象类animal author ljf 定义一个抽象类animal 关键字abstract public abstract class Animal 将动物共有属性进行封装 名字 年龄 颜色 性别 说话 private Strin
  • np.dot(a, b)用法

    In short np dot a b 就是一个乘法函数 数和数相乘 若a和b都是数 np dot 1 2 2 一维数组的内积 np dot 1 2 3 4 5 6 1 2 3 4 5 6 1x4 2x5 3x6 32 矩阵的乘积 x np
  • Unity学习笔记——TextMeshPro使用详解

    https blog csdn net elineSea article details 88799896 TextMesh Pro是Unity默认文本组件的替代品 TextMesh Pro和默认组件一样拥有高性能 它使用了完全不同的Sig
  • 为什么大部分人认为测试用例不重要?如何正确编写软件测试用例?

    如何编写测试用例似乎不是开发的重要部分 但是为了让一个软件测试人员最好地完成他们的工如如何编写测试用例似乎不是开发的重要部分 但是为了让一个软件测试人员最好地完成他们的作 他们需要一套清晰的步骤和一个被测试的东西的清晰定义 编写优秀的测试用
  • 代码审查常见代码质量问题

    配套的Bug解释模式 为了有针对性的使用这个工具 减少bug的误报 提高使用效率 我们选择了10个左右的bug模式 下面就是对这10个模式的解释 这些bug可能会引起程序的性能或逻辑问题 需要说明的是 findbugs能检测的bug pat