February 3, 2011

A Guide Through the Layers of Automated Testing

 

With automated testing comes many different layers of testing. For new developers this can be a bit overwhelming. Take for example the other day at work when a developer came to me and asked what type of test should they write for a code change they did.

This question got me thinking, with all the different layers of testing out there, how does someone new to automated testing know what tests to create?

So I decided to sit down lay out what the different layers of testing are and when you should use them. This isn’t a complete list, however I feel this is a good base for a new developer to get started in automated testing.

Test Types

  • Unit test – Testing an individual method’s logic, by removing all outside dependencies. You would use frameworks like NUnit and VS Unit Testing Framework to accomplish this.
  • Integration Test – Testing two or more methods together, testing the dependencies between the methods. You would use frameworks like NUnit and VS Unit Testing Framework to accomplish this.
  • Functional Test – Testing a scenario end-to-end from the presenter to the database and back again. This type of test tests the entire application just below the GUI. You would use frameworks like Cucumber and MSpec to accomplish this.
  • GUI Test – Testing the user interface of a form. GUI test should just test the GUI, not the underlying business logic. You would use frameworks like Selenium and Coded UI Tests to accomplish this.

When to Use

Here are some scenarios you may encounter and what tests you would use.

Method Change in Service Data Access Layer

  • Unit Test - need to be written against the method
  • Integration Test (Optional) – written to verify that the data coming back from the database is valid

Method Change in Data Access Layer

  • Unit Test – need to be written against the method
  • Integration Test – written from the data access layer to the service layer and below

Method Change in a Presenter (MVP model)

  • Unit Test – need to be written against the method.
  • Integration Test – written from the method to the data access layer and below.
  • Functional Test (Optional) - If the method is in a presenter, then a cucumber test will need to be written that will do an end to end test from the method.

Change to a Form (Strictly a UI change)

  • GUI Test – against the change.

Conclusion

Deciding to begin testing you code is a very rewarding experience. It can also be a very overwhelming experience. Armed with this information I wish you well on your wonderful journey into automated testing.

35 comments:

  1. If you're new to testing, the attitudes are as important as the nuts and bolts of testing.

    When you make code changes or add code ask yourself, "How do I prove that this works as expected?" and "How do I prove that this didn't break anything else?"

    Testing also saves time over the life of a project. It's worth it.

    ReplyDelete
  2. Excellent sharing Thanks for share i am sure its must help me. thanks for doing this.

    Scrum Process

    ReplyDelete
  3. Thanks for your informative article on software testing. Your post helped me to understand the future and career prospects in software testing. Keep on updating your blog with such awesome article. Best software testing training institute in Chennai | Software Testing Training in Chennai | Software testing course in Chennai

    ReplyDelete
  4. Nice information about the load testing!!! I prefer Loadrunner automation testing tool to validate the performance of software application/system under actual load. Loadrunner Training in Chennai | Loadrunner training institute in Chennai

    ReplyDelete
  5. I am happy to found such helpful and fascinating post that is written in well manner.
    Regards..
    QTP Training in Chennai | Software Testing Training in Chennai

    ReplyDelete
  6. Your post helped me to understand the future and career prospects in software testing. best fire and safety college in chennai |nebosh course in India

    ReplyDelete
  7. Your blog is awesome..You have clearly explained about it ...Its very useful for me to know about new things..Keep on blogging..
    Software testing training in chennai

    ReplyDelete
  8. Really i enjoyed very much. And this may helpful for lot of peoples. So you are provided such a nice and great article within this.

    SAP Training in Chennai

    ReplyDelete


  9. First is to thank you for all this informative posts you give us for free; i bet all of us are happy.
    Such a great idea of yours! You have been a big help for me. Thanks a lot. more post for interesting topic. Great!

    SAP training in Chennai

    ReplyDelete
  10. Testing now a days has become as importnant as developing of an application. With the help of testing, we can find out the potential bugs which would affect the application. Fixing this at a very early stage would help the application to run without any problem.
    Software testing training in Chennai | Software testing training institute in Chennai | Software testing courses in Chennai

    ReplyDelete
  11. First is to thank you for all this informative posts you give us for free; i bet all of us are happy.
    Such a great idea of yours! You have been a big help for me. Thanks a lot. more post for interesting topic. Great!

    SAP training in Chennai

    ReplyDelete
  12. very nice information providing on blog
    http://hadooptraininginhyderabad.co.in/salesforce-training-in-hyderabad/

    ReplyDelete
  13. Really cool post, highly informative and professionally written and I am glad to be a visitor of this perfect blog, thank you for this rare info! , Regards, servicenow training in hyderabad

    ReplyDelete
  14. I am a regular reader of your blog. the blog is very interesting and will be much useful for us.
    Seo Company in Chennai

    ReplyDelete

  15. Great and useful article. Creating content regularly is very tough. Your points are motivated me to move on.


    SEO Company in Chennai

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. We should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well.
    massivetranscript.com/audio-transcription.php

    ReplyDelete
  18. WOW! Really Nice Post! I personally believe that to maintain the standard of a blog all the hacks mentioned above are important. All points discussed were worth reading and I’ll surely work with them all one by one.
    Commercial Voice Over

    ReplyDelete
  19. I think testing is very important. As Jonathan said in the first comment that testing saves time. It's true. I'm working on the new project now and without testing by this guys http://www.nixsolutions.com/services/quality-assurance-services/ I won't add new items to it.

    ReplyDelete
  20. Thanks for sharing such a nice article. It is really useful to me and all people. One think in my mind came while reading that it is not wasting of time.
    High Quality Online Cheap Essay Writers

    ReplyDelete
  21. High Quality Video Captioning Services Thanks for the post and it was wonderful to have a look over this article.

    ReplyDelete
  22. Translation stories usually are deployed for several customers in raising volume of vocabulary twos, from time to time for particular product lines or simply Pennsylvania Translation Rates with a undertaking and also and challenge base. TM lets task remembrances for being swapped or maybe contributed, lowering the reliance upon distinct translators. Huge, well as well as retained TMs make it possible for Bedford Translations to supply a steady merchandise, helping enhance extended purchaser associations and also locking down actually as well as cherished translation resources for future years.

    ReplyDelete
  23. Whether you are a substantial international manufacturer or a small enterprise trying to gain Virginia Translation their footing in the marketplace, correct translation normally takes that you' ways.

    ReplyDelete
  24. ELearning Voice Overs Test modulating the voice in a variety of kinds. Study loudly, understand generally, study together with fury, understand by using sincerity, examine along with excitement, examine by using sarcasm and see the visible difference. Do not file in your house on your hard drive. You happen to be aspiring to become professional voice actor or actress and also your voice biological materials must audio Skilled.

    ReplyDelete
  25. Automation selenium engineers are in demand nowadays if you are strong in coding means that you will get the opportunity. Fita will guide you to get a job in automation field and it has a great scope in future.
    Thanks,
    Selenium Training institute in Chennai | Selenium Training in Chennai | Selenium Course in Chennai

    ReplyDelete
  26. Testing is the fundamental one for working up the application. Programming testing is required to raise the blemishes and goofs for development phrases. It offers a good work for skilled specialists in programming testing field.
    Regards,
    Software Testing courses in chennai | Testing Training chennai

    ReplyDelete
  27. Wow!!! this is wonderful and excellent photos to share and this was amazing

    ReplyDelete
  28. Excellent blog, I wish to share your post with my folks circle. It’s really helped me a lot, so keep sharing post like this..
    Selenium Course in Chennai | Best Selenium training institute in Chennai|Selenium Training in Chennai|selenium testing training in chennai

    ReplyDelete
  29. The blog was absolutely fantastic! Lot of great information which was helpful
    Dot net Training institute in velachery

    ReplyDelete
  30. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. Textile Testing Equipment

    ReplyDelete