您的位置:首页 > Web前端

How to write effective Test cases, procedures and definitions

2014-02-12 09:58 603 查看
以前总是纠结如何写测试用例,怎么提高测试用例的覆盖率,根据什么来编写测试用例,是个很头痛的事情。

其实测试本来就是一个无穷举的过程,想一次性把所有用例写全,很难,都是在测试过程中不断的完善和补充用例,下面是以前的老大给我们培训的如何写测试用例,从老外网站转过来的,各位将就看下,还是很有启发的。

How to write effective Test cases, procedures and definitions

“A test case has components that describes an input, action or event and an expected response, to determine if a feature of an application is working correctly.” Definition by Glossary 

A test case in software engineering is a set of conditions or variables under which a tester will determine whether an application or software system is working correctly or not.Definition From Wikipedia

There are levels in which each test case will fall in order to avoid duplication efforts.

Level 1: In this level you will write the basic test cases from the available specification and user documentation.

Level 2: This is the practical stage in which writing test cases depend on actual functional and system flow of the application.

Level 3: This is the stage in which you will group some test cases and write a test procedure. Test procedure is nothing but a group of small test cases maximum of 10.

Level 4: Automation of the project. This will minimize human interaction with system and thus QA can focus on current updated functionalities to test rather than remaining busy with regression testing.

So you can observe a systematic growth from no testable item to a Automation suit.

a.Test Cases are prone to regular revision and update:

Change in requirement 

During the execution of TCs, many ideas arise in the mind, many sub-conditions of a single TC cause update and even addition of TCs. 

During regression testing several fixes and/or ripples demand revised or new TCs.

b. Test Cases are prone to distribution among the testers who will execute these

c. Test Cases are prone to clustering and batching

d. Test Cases have tendency of inter-dependence

e. Test Cases are prone to distribution among developers (especially in TC driven development environment)

So, keeping theabove 5 factors in mind, here are some tips to write test cases:

1.Keep it simple but not too simple; make it complex but nottoo complex


2. After documenting Test cases, review once as Tester

3. Bound as well as ease the testers

4.Be a Contributor

5. Never Forget the End User




Conclusion:

Test Case Writing is an activitywhich has solid impact on the whole testing phase. This fact makes the task ofdocumenting TCs, very critical and subtle. So, it should be properly plannedfirst and must be done
in well-organized manner. The person who is documentingthe TCs must keep in mind that, this activity is not for him or her only, but awhole team including other testers and developers, as well as the customer willbe directly and indirectly affected by this
work.

So, the due attention must be paidduring this activity. “Test Case Document” must be understandable for all ofits users, in an unambiguous way and should be easily maintainable. Moreover,TC document must address
all important features and should cover all importantlogical flows of the AUT, with real time and practically acceptable inputs.

The basic objective of writing test cases is to validate the testing coverage of theapplication. If you are working in any CMMi company then youwill strictly follow test cases standards. So writing test cases brings somesort of standardization and minimizes
the ad-hoc approach in testing.

Fields in testcases:

Test case id:

Test data: Variables and theirvalues

Steps to be executed:

Expected result:

Unit to test: What to be verified?

Comments:

So here is a basic format of testcase statement:

Verify

Using [tool name, tag name,dialog, etc]

With [conditions]

To [what is returned, shown,demonstrated]

Verify: Used as the first word of the testcase statement.

Using: To identify what is being tested.You can use ‘entering’ or ‘selecting’ here instead of using depending on thesituation.

For any application basically youwill cover all the types of test cases including functional, negative andboundary value test cases.

Keep in mind while writing test casesthat all your test cases should be simple and easy to understand. Don’t write explanations likeessays. Be to the point.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Testcase 测试用例