Home

Thursday, May 21, 2009

The Test Cases

It is a hot debate topic among testing professionals “Exploratory Testing Vs Scripted Testing”. Open any discussion forum and you will find one or more such discussions. In these discussions, majority of the test professionals support Exploratory Testing and a very few test professionals are there in favour of Scripted Testing. This displays that the exploratory testing is in trend.

I also think that Exploratory Testing is better approach than Scripted Testing but still we can't ignore the importance of Scripted Testing. Although majority of testers support Exploratory Testing Techniques but still the mostly organizations follow the Scripted Testing process.

In Scripted Testing, tests are predefined in form of Test Cases.

What are Test Cases? - In simple words, a test case is a step or sequence of steps to test the correct behavior of a functionality/feature of an application.

More organized definition of Test Case could be:

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

It doesn't mean that a single test case is sufficient to determine the correct functionality of an application. It may take many test cases to determine that a software system or application is functioning correctly. Test cases are often referred to as test scripts, particularly when written. Written test cases are usually collected into test suites.

Now the question is why we write test cases? - The reason behind writing test cases is to ensure the testing coverage of an application. Another reason is to test the application quickly. The idea is to write test cases based on design while code is incomplete, so that we could test the application quickly once the code is ready.

The test cases can be divided into two categories:

Formal Test Cases : Formal test cases are designed to fully test all the requirements of an application. There must be at least two test cases for each requirement: one positive test and one negative test.

Informal Test Cases : For application without formal requirements, test cases can be written based on the accepted normal operation of programs of a similar class. In few organiztions, test cases are not written at all but the activities and results are reported after the testing is completed.

Test Case Format: A typical Test Case may include

  • Test Case No.

  • Testing Component

  • Description of Test

  • Input Data (If any)

  • Expected Result

  • Actual result

  • Test Date

  • Status – Pass/Fail

  • Remarks

A sample Test Case is attached here.

6 comments:

Santhosh Tuppad said...

@Mohit,
I agree with your statement about coverage with test cases. But, in addition I would like to add something to your point.

We could have a better coverage in other approach which is much better than TEST CASES ( Test Cases are boring ).

I hope now your thought might have changed as I see this blog post was posted in May 2009 hehe *smiles*.

This comment would be helpful for others I guess as I assume that you believe in Exploratory Testing.

Thanks,
Santhosh Shivanand Tuppad

Mohit said...

@Santhosh

Before replying to your comment, I needed to go through the post.

If you noticed, I have already mentioned in the post that I also think that Exploratory Testing is better approach than Scripted Testing.

The idea behind the post was to discuss that traditional approaches are not incorrect, they are just outdated with the current scenario.

By the way, I am interested to know the approaches you use for test coverage.

With Regards
Mohit

Amit said...

@ Mohit,

Nice , short and sweet article telling the concept. But tell me one thing suppose you are working on a project for which there is no formal requirement(s) , has your PM told asked you to write TEST CASES or INFORMAL TEST CASES. which term has he used

I can introduce a new term over here GROOMED TEST CASES but is it a industry standard term ?

Mohit said...

@Amit

Suppose you are working on a project for which there is no formal requirement(s) , has your PM told asked you to write TEST CASES or INFORMAL TEST CASES. which term has he used
--If you can believe, i never used scripted testing approach. Although sometimes I needed to design the test cases but thats just formality. But Whenever my PM has said to me to prepare test cases, he always used the word Test Cases.

I can introduce a new term over here GROOMED TEST CASES but is it a industry standard term ?
-- I am keen to know about the Groomed Test Cases. I believe its not the other name for some existing term.

Amit said...

@ Mohit ,

Exactly my friend , that's what my concern is when I asked you the question. There is as such no term called as FORMAL/INFORMAL test cases in standard software testing glossary (You can check it anywhere). The terms you used (FORMAL/INFORMAL) are not industry specific but its organization specific. Whether test cases are written on the basis of SRS (formal requirements document) OR without any stated requirement (Based on general behavior) they are just TEST CASES. Also it’s not the question of using scripted testing approach. In case you are not following scripted testing approach (that is not writing test cases) you are performing ad-hoc / exploratory testing

Now coming to GROOMED TEST CASES, this again is a organization specific term. It simply refers to test cases written in proper format and contain all the details as mentioned in your post (Test Case Format Section). You can refer to my post (Some common scene in software testing > Scene # 1).

The purpose of the previous comment was just that if you are explaining some concept publicly please use industry specific terms


Thanks & Regards,
Amit

Mohit said...

@Amit

Point Noted. Thanks for valuable suggestion :)