Peter Bahaa's Blog

Business and Technical Articles

Business Logic Document “Writing Better Test Cases”

January 26
by Peter Bahaa 26. January 2009 04:49

Unit test is one of power testing methodology for developers code, and its easy , and i as a .net developer , i like that is embedded in VS, by single click you can create a unit test function.

If you are working with agile and you have non-stop changing requests, new features and of course bugs, there are no  way of not using strong unit-tests, it will always raise a flag, that says MY CODE IS OK, it simply ensure that you have more stable deliveries.

In any company, we always care about customer satisfaction , so using unit-test should do the trick, and when you working closely to technical customer you will see that they always expecting no logical errors, especially when you are using unit-test. producing logical errors mean week unit-tests

Here is samples of logical bugs:

  • User can buy slots from sailing already left the port!
  • User can donate for another user
  • After removing all family member user can see that there are a family exists
  • Sailing departure date can’t be after arrival date
  • User can’t buy 0 or empty slots.

so the first thing i said to myself when i saw those bugs, our validation process is more than strong, but most of these bugs could be produced by un-expected user behavior, yes I’m talking about Fraud and hacking, the bad person will never uses your UI :) , he probably will have to work around.

So I’m suggesting to set some rules before start development in any area of your project, and if you are using Agile so you will be doing these on the start of each sprint.

User rights: User can’t donate for another user.

  • Handling and dealing with expired data: User can’t buy a sailing already left
  • Data manipulation that affects other data: Family with no members can’t be considered as a family
  • Data verification against normal cases: Employee birth date can’t be TODAY

so that should create a document called business logic document:

  • Easy and fast to build
  • No more logical bugs
  • Building up strong test cases
  • Good to be built in beginning of each new sprint
  • All the team members should share to build this document (That include Testers)

so you can set each rule area, and its violation type: ex

Rule Area Type
User must have buy right to buy Buy Operation Access Violation
Can’t donate from other user account Donate Operation Invalid Operation Parameter

 

Don’t hesitate to ask about any issue on BLD “Business Logic Document”

Tags:

Technical | Tips & Tricks

Comments

9/12/2011 5:58:23 AM #

If you could e-mail me with a couple of suggestions on just how you made your blog look this wonderful, I might be grateful.

range extender

9/16/2011 5:47:01 AM #

Hi. I wanted to drop you a fast be aware to express my thanks. Ive been following your weblog for a month or so and have picked up a ton of good data and enjoyed the strategy youve structured your site. I'm trying to run my very own weblog nevertheless I believe its too common and I need to focus on loads of smaller topics. Being all issues to all folks is just not all that its cracked up to be.

purple pumps

9/19/2011 3:05:19 AM #

Great post! It\'s so hard to find good info on production on the internet nowadays with all the fluff that is out there. I look forward to reading more of your articles and keep up the good work. Smile

John Simpson

9/24/2011 12:26:55 PM #

Actually like your websites details! Undoubtedly a wonderful provide of knowledge that is extraordinarily helpful. Keep it up to carry publishing and I am gonna proceed studying by the use of! Cheers.

Tyrone

9/24/2011 12:27:53 PM #

Thanks for the write up! Also, I noticed that your RSS feeds are not working. Could you take a look at that?

Ulysses

9/25/2011 8:23:38 AM #

it is really a cool and useful piece of info. I am glad that you shared this useful information with us. Please keep us informed like this. Thanks for sharing.

Una

10/3/2011 4:06:19 AM #

good content

Mike

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar