`
love~ruby+rails
  • 浏览: 849372 次
  • 性别: Icon_minigender_1
  • 来自: lanzhou
社区版块
存档分类
最新评论

Let a human test your app, not (just) unit tests

阅读更多

I’m a big believer in unit testing. We unit test our Rails apps extensively, and we’ve done so for years. On some projects, we do both unit testing and integration testing using Cucumber . I preach unit testing to everyone I can. I’d probably turn down a project if the client wouldn’t let us write tests (though this has never come up, and I don’t think it would be a hard sell).

But for a long time, that’s all I did on my projects. Our clients and users would find the bugs that got past the developers. They were, in effect, our QA testers. (I think a lot of small/agile teams are the same way; based on my experience, I’d be surprised if more than 20% of Rails projects were comprehensively tested by a human.)

This is not right. A good QA tester is worth the surprisingly modest expense.

If I unit test, do I really need to hire a QA tester?

Keep on writing unit tests. But unit tests and human testing are two completely different things. They both aim to increase code quality and decrease bugs, but they do this in different ways.

Developer (unit) testing has three benefits. It:

  • Makes refactoring possible. Don’t even try to refactor a large app without a test suite.
  • Speeds up development. I know there are some haters who deny this, but they’ve either never really given unit testing a chance, or their experience has been 180º different than mine.
  • Eliminates some bugs. Not all, but some.

Human testing has related, but somewhat different, benefits. It:

  • Eliminates other bugs. Unit tests are great for certain categories of bugs, but not for others. When a human walks through an application with the express purpose of making things break, they’re going to find things that developer-written unit tests won’t find.
  • Acts as a “practice run”. Before letting a client, boss, or user see a change, let a QA tester see it. You’d be surprised how many 500 errors and IE incompatibilities you can avoid.
  • Gives you confidence before you deploy. After working with good QA testers, I can’t imagine deploying an app to production without having a QA tester walk through it.
  • Saves you time. If you don’t have a QA role on your project, your developers will be defacto testers. They probably won’t do a good job at this, since they’ll be hoping things succeed (rather than making them fail). And their time is probably more expensive than a good tester’s time.

How to use a QA tester in an agile project

Agile testers should do four things.

First, they should verify or reject each story that is completed. Every time a developer indicates that a feature or bug is completed, whether you use a story tracker or index cards, a QA tester should verify this. Don’t deploy to production until the tester gives it a thumbs-up.

Second, they should do exploratory testing after every deploy. A few minutes clicking around in production can sniff out a lot of potential errors.

Third, they should test edge cases. What happens if a user types in a username that is 300 characters long? What they try to delete an item that is still processing? What if they upload a PDF file as an avatar? Testers are great at this sort of thing.

Fourth, they should test integrations. Unit tests can’t (and shouldn’t) test multi-step processes. Integration testing tools like Cucumber are OK, but don’t catch everything. Identify the main multi-step processes on your site, and have a human verify them every time they change.

Expect a tester to increase your development costs by 5%-10%. We find that 1 hour of testing for every 6 hours of developer time is a reasonable estimate. Our testers cost about 40% less than our developers. So on a typical invoice, testing services are about 10% of development services.

Bill separately for testing. Don’t just roll it into your developer rate. Clients are more likely to object to a 10% increase in your main hourly rate than a separate, lower testing line item.

Finding a good tester

There are two main ways to find a tester.

First, you can train one. Tech-savvy folks who aren’t programmers are a good option. They understand enough to fit in with your development process, but are happy testing and not coding. If you find the right person, they can be testing in no time, and won’t cost a ton of money.

Second, find one that understands agile development. There are plenty of professional testers out there, but most of them do waterfall testing: spend 3 weeks writing test cases, get release from developers, and spend 3 weeks testing. I can say, without hyperbole, that this is how exactly 0% of Rails development projects work. Look for the small number of testers that actually have experience with iterative development, flexible scope, and rapid turnaround. You can sometimes find these people at agile events (conferences or user groups). Otherwise, ask other developers. I found one via referral, and I’ve since referred him to others. This second category will probably be more expensive than the first, but if you want to ship the best code you can, go with this route.

分享到:
评论

相关推荐

    Download netcoreapp2.0 unit tests sample - 1.4 MB

    标题中的“Download netcoreapp2.0 unit tests sample”指的是下载一个基于.NET Core 2.0版本的单元测试示例项目。这个项目是为了演示如何在ASP.NET Core MVC应用程序中进行单元测试,它与.NET Core 2.0框架兼容,这...

    Download netcoreapp1.1 unit tests sample - 2.1 MB

    标题中的“Download netcoreapp1.1 unit tests sample”指的是一个下载链接,提供了一个使用.NET Core 1.1版本的单元测试示例项目。这个项目主要用于演示如何在ASP.NET Core MVC应用程序中进行单元测试,帮助开发者...

    Python Unit Test Automation:for Python Developers and Testers

    Python Unit Test Automation will allow you to quickly ramp up your understanding of unit test libraries for Python 3 through the practical use of code examples and exercises. All of which makes this ...

    unit tests written in Java.zip

    Most popular Mocking framework for unit tests written in Java

    BURNINTEST--硬件检测工具

    - When BurnInTest crashes, it will not generate a "minidump" file. Minidumps will need to be sent to Microsoft as per the normal process. However, a log entry will be added to the normal BurnIn...

    前端开源库-node-module-with-unittests-template

    前端开源库-node-module-with-unittests-template带有UnitTests模板的节点模块、带有UnitTests模板的节点模块:带有UnitTests和覆盖率报告的通用节点模块的模板

    bloody-unit-tests

    《bloody-unit-tests:高效单元测试的实用工具》 在软件开发过程中,单元测试是确保代码质量、可维护性和稳定性的重要环节。"bloody-unit-tests"项目正是一款专注于创建单元测试模板的工具,专为.NET开发者设计,...

    UNit_Test单元测试课件

    "UNit_Test单元测试课件"显然是一份详细讲解单元测试的资料,旨在帮助开发者理解和掌握这一关键技能。单元测试是针对软件中的最小可测试单元进行检查和验证,这些单元通常是一个函数、方法或类。它的目标是确保每个...

    unit_tests.zip

    《NXP i.MX6ULL官方测试工具:unit_tests.zip深度解析》 在嵌入式系统开发领域,NXP的i.MX6ULL处理器因其高效能、低功耗的特性而备受青睐。为了帮助开发者更好地理解和调试这款处理器,NXP官方提供了一套名为“unit...

    Test Driven Development with Python 2nd edition 2017 pdf

    You’ll learn how to write and run tests before building each part of your app, and then develop the minimum amount of code required to pass those tests. The result? Clean code that works. In the ...

    Test-Driven Development with Python [2017]

    You’ll learn how to write and run tests before building each part of your app, and then develop the minimum amount of code required to pass those tests. The result? Clean code that works. In the ...

    Unit Testing with Mock Objects

    They allow unit tests to be written for everything, simplify test structure, and avoid polluting domain code with testing infrastructure. Keywords: Extreme Programming, Unit Testing, Mock Objects, ...

    Test-Driven iOS Development with Swift

    Writing tests before your code improves the structure and maintainability of your app. Key Features Learn test-driven principles to help you build apps with fewer bugs and better designs Become ...

    Test-Driven Java Development(PACKT,2015)

    Test-driven development (TDD) is a development approach that relies on a test-first procedure that emphasises writing a test before writing the necessary code, and then refactoring the code to ...

    activemq-unit-tests-5.9.1-tests.jar

    标签:activemq-unit-tests-5.9.1-tests.jar,activemq,unit,tests,5.9.1,tests,jar包下载,依赖包

    activemq-unit-tests-5.10.0-tests.jar

    标签:activemq-unit-tests-5.10.0-tests.jar,activemq,unit,tests,5.10.0,tests,jar包下载,依赖包

Global site tag (gtag.js) - Google Analytics