Software Testing Tips
page 5 of 10
by Brendan Enrick
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 40603/ 50

Organize, Refactor, and Take Care of Your Tests

I recommend you repeat this daily, “My test code is just as important as my production code”. I think this is a very good point to remember when you’re writing tests. All of those principles you apply when writing production code should be followed with test code. DRY, SOLID, YAGNI, etc. are all important even with the testing code.

Obviously duplicating code can make your tests difficult to maintain. What if some business logic changes? If you were repeating yourself you now have the fun task of going through a dozen tests changing each one, but if you had not repeated the same code you might have been able to update one location in the test code. A lot of people are concerned when the line count of a single file gets large and they will refactor it into multiple manageable files. This same policy should apply to test classes. If you’ve ever gone into a test class with way too many classes, you probably know how difficult it can be to maintain.

Tests exist to make development easier, and if they become difficult to maintain then something needs to change. I certainly don’t advocate spending large amounts of time refactoring the tests, but since they are supposed to increase the longevity of the application they must also be maintained.


View Entire Article

User Comments

Title: QA Manager   
Name: Sami Ullah
Date: 2010-10-22 3:08:04 AM
Comment:
Hi ! These tips are really useful.
Title: SOA Testing   
Name: SOA Testing
Date: 2010-09-06 1:17:21 AM
Comment:
Hi.
These tips are very useful one It contain very important detail Its really a fantastic things for me
Title: Software Testing   
Name: SOA Testing
Date: 2010-08-23 4:15:48 AM
Comment:
Wow..These are really a great tips it will useful for me I like it very much.
Title: SQA Services   
Name: SOA TESTING
Date: 2010-08-10 2:08:58 AM
Comment:
Hello..
Wow great post you have give us wonderful tips It will useful for us.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-28 10:37:50 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search