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

Add comment




biuquote
  • Comment
  • Preview
Loading



Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar