问题描述
基本上我想知道是否有人有任何技巧可以确保您的代码在有限的时间内得到良好测试而无需其他人的任何帮助?
Basically I'm wondering if anyone has any tips for ensuring your code is well tested without getting any help from anyone else in a limited time frame?
过去,我总是能够找到其他人对我的代码进行测试,或者让专门的质量保证团队检查所有内容并找出所有错误.
In the past I've always been able to find someone else to do testing on my code or had a dedicated quality assurance team go over everything and find all the errors.
我通常很小心,但我总能发现一些我错过的东西,当我测试它们时,我就是看不到它们.
I'm usually pretty careful but I always find there a things I miss and when I test them I just don't see them.
然而,在我目前的工作中,我得到了两个 PHP Web 应用程序在非常有限的时间内编写,并且我被告知我需要自己进行所有测试,尽管我的反馈说这不是一个好主意.
However in my current job I've been given two PHP web applications to write in a very limited time frame and I've been told I need to do all the testing myself despite my feedback that this wasn't a good idea.
我想知道是否还有其他人遇到过这个问题并且可以提供一些见解?
I was wondering if anyone else had this problem before and could offer some insight?
我在想,也许最好在对每个区域进行编码之前编写一个快速测试计划,并在进行测试之前仔细检查需求.
I was thinking perhaps it would be good to write a quick test plan before coding each area and also to double check the requirements before doing testing.
推荐答案
当然,无论是否测试优先,单元测试都应该是您的第一道防线,确保您的应用程序的每个部分都按照您认为应该的方式工作.然而,您所谈论的测试类型,在那里获得另一双眼睛可能会有所帮助,更多的是在验收测试领域——应用程序作为一个整体是否按照它应该的方式工作?它是否适用于各种奇怪的场景或行为等.
Certainly unit testing, whether test-first or not, should be your first line of defense, ensuring that each piece of your application works the way you think it should. However, the type of testing you're talking about, where it can be helpful to get another pair of eyes, is more in the area of acceptance tests -- does the application as a whole work the way it should; does it work for various weird scenarios or behaviors, etc.
一种有用的方法是想象角色:首先以您自己的身份测试应用程序,然后再次测试它,假设您已经 85 岁了,视力不太好,并且不太会使用鼠标.你可能倾向于点击最亮或最大的东西,假设它是你应该做的,但它可能不是.现在想象一下,你 12 岁,匆匆忙忙.你不会去阅读说明.还能用吗?
One helpful approach is to imagine personas: first test the application as yourself, but then test it again imagining that you are 85 years old, can't see terribly well, and don't use a mouse that well. You may tend to click on the brightest or largest thing, assuming it's what you're supposed to do, which it may not be. Now imagine you're 12 and in a tearing hurry. No way are you going to read instructions. Does it still work?
对于任何给定的字段,一个人可能输入的内容的边缘情况是什么?如果只输入空格会怎样?只有数字进入文本字段?如果你输入 HTML 会发生什么?Javascript?非西方字母表中的东西?如果你输入的东西真的很长怎么办?
For any given field, what are the edge cases of what a person might type in? What happens if you type only spaces? Only numbers into a textual field? What happens if you type HTML? Javascript? Something in a non-western alphabet? What if you type something really really long?
关键不只是测试快乐路径",即用户按照您想象的方式浏览应用程序.以任何人都不应该的方式完成申请.因为……他们会的.
The key is not just to test the "happy path", where the user goes through the application the way you had in mind. Go through the application in ways no one ever should. Because... they will.
另一个重要的部分是永远不要忽视任何事情.很容易出现一个奇怪的屏幕并对自己说哦,那只是侥幸."你必须让自己注意到并追踪一切不正常的事情.
The other important piece is never to ignore anything. It's easy to have a weird screen come up and say to yourself "Oh, that's just a fluke." You have to make yourself notice and track down everything that isn't just as it should be.
这篇关于自测技巧?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!