0

I would like to learn from you and know the way you would design scenarios and test cases for this form with 3 fields and a submit button.

Form with 3 fields:

  • ID field: minlength 7, maxlength 7 length, numeric, required

  • email field: 1-50 length, valid email i.e: example.domain.com, required

  • name field: 1-30 length, only letters and spaces, required

Description: When the submit button is pressed, it will validate the fields before sending the form. If the fields are valid, it will display a message saying: form sent. if any of the fields are not valid, it will display a validation message saying which fields are not valid. Simple as that.

This is a simple form I just made up, I have a way of designing test cases but I would like to increase my knowledge by knowing other approaches or even if it's possible, better techniques.

Normally, I would create the following test cases but I'm not sure this is the right approach, maybe using orthogonal array or another technique? isn't it a better way to test this form in an agile approach?

Scenario1: Verify form registration:

  • TC1: Send form with id valid, email valid, name valid. Expected result: Show form sent message

Scenario2: Verify form error messages:

  • TC2: Send form with id empty, email valid, name valid. Excepted result: id not valid
  • TC3: Send form with id letters, email valid, name valid. Excepted result: id not valid
  • TC4: Send form with id symbol, email valid, name valid. Excepted result: id not valid
  • TC5: Send form with id special chars, email valid, name valid. Excepted result: id not valid
  • TC6: Send form with id 1 digit, email valid, name valid. Excepted result: id not valid
  • TC7: Send form with id 6 digit, email valid, name valid. Excepted result: id not valid
  • TC8: Send form with id 8 digit, email valid, name valid. Excepted result: id not valid
  • TC9: Send form with id valid, email empty, name valid. Excepted result: email not valid
  • TC10: Send form with id valid, email letters, name valid. Excepted result: email not valid
  • TC11: Send form with id valid, email symbol, name valid. Excepted result: email not valid
  • TC12: Send form with id valid, email special chars, name valid. Excepted result: email not valid
  • TC13: Send form with id valid, email 31 digit, name valid. Excepted result: email not valid
  • TC14: Send form with id valid, email with 2 @, name valid. Excepted result: email not valid
  • TC15: Send form with id valid, email ip domain, name valid. Excepted result: email not valid
  • TC16: Send form with id valid, email without @, name valid. Excepted result: email not valid
  • TC17: Send form with id valid, email without user, name valid. Excepted result: email not valid
  • TC18: Send form with id valid, email without domain, name valid. Excepted result: email not valid
  • TC19: Send form with id valid, email without top level domain, name valid. Excepted result: email not valid
  • TC20: Send form with id valid, email with 2 dots in domain, name valid. Excepted result: email not valid
  • TC21: Send form with id valid, email with 2 dots in user, name valid. Excepted result: email not valid
  • TC22: Send form with id valid, email with 1 dot at the end of user, name valid. Excepted result: email not valid
  • TC23: Send form with id valid, email with 1 dot at the beginning, name valid. Excepted result: email not valid
  • TC24: Send form with id valid, email valid, name empty. Excepted result: name not valid
  • TC25: Send form with id valid, email valid, name numeric. Excepted result: name not valid
  • TC26: Send form with id valid, email valid, name symbol. Excepted result: name not valid
  • TC27: Send form with id valid, email valid, name special chars. Excepted result: name not valid
  • TC28: Send form with id valid, email valid, name 31 chars. Excepted result: name not valid
  • TC29: Send form with id valid, email valid, name double spaces. Excepted result: name not valid

I'm using this topic as reference: Test data to test form input fields?

Should the previous test cases in the scenario2 be written step by step, executed and evidenced? Or just written in a simple matrix and executed without evidences?

I really hope you take your time reading and responding this topic, your response will be appreciated and this knowledge will be shared with my colleages. Thank you in advance.

2

I would test as follows:

Take your 29 tests and create back end user tests for them. e.g.

TC1: Send form with id valid, email valid, name valid. Expected result: Show form sent message

Create a unit test for the above so that the routine that accepts the form determines that the inputs are valid and responds accordingly. You will provide the payload instead of an actual web form posting and you should mock and stub out the database. This will result in unit tests that run in 0.1 to, at most 1 second. This approach should allow you to have a test suite for the above that runs in 5-10 seconds. Yup, not a typo, that is seconds. The speed of this means that developers can run these tests quickly and easy with every small change they make. So 29 tests ther.

Then I would create a smaller subset for integration specs that perhaps test a blank save attempt to the database, a successful save, a duplicate error and a specific blank required field save. So 4 tests.

Finally create one happy UI test for when things work and 1 sad case. So 2 tests.

This sort of approach will let you build a test pyramid

           XX  
          XXXX  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

This will help you avoid testing most stuff through the UI which we call the bad UI testing pattern 'ice-cream cone'

       XXXXXXXXX
         XXXX
          XX
0

If you have access to the source code you could generate equivalence classes for each of the inputs to create the smallest amount of combinations to test your form

http://www.softwaretestinggenius.com/tutorial-6-to-generate-equivalence-class-test-cases-for-the-triangle-problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.