OneStopTesting - Quality Testing Jobs, eBooks, Articles, FAQs, Training Institutes, Testing Software, Testing downloads, testing news, testing tools, learn testing, manual testing, automated testing, load runner, winrunner, test director, silk test, STLC

Forum| Contact Us| Testimonials| Sitemap| Employee Referrals| News| Articles| Feedback| Enquiry
 
Testing Resources
 
  • Testing Articles
  • Testing Books
  • Testing Certification
  • Testing FAQs
  • Testing Downloads
  • Testing Interview Questions
  • Career In Software Testing
  • Testing Jobs
  • Testing Job Consultants
  • Testing News
  • Testing Training Institutes
  •  
    Fundamentals
     
  • Introduction
  • Designing Test Cases
  • Developing Test Cases
  • Writing Test Cases
  • Test Case Templates
  • Purpose
  • What Is a Good Test Case?
  • Test Specifications
  • UML
  • Scenario Testing
  • Test Script
  • Test Summary Report
  • Test Data
  • Defect Tracking
  •  
    Software testing
     
  • Testing Forum
  • Introduction
  • Testing Start Process
  • Testing Stop Process
  • Testing Strategy
  • Risk Analysis
  • Software Listings
  • Test Metrics
  • Release Life Cycle
  • Interoperability Testing
  • Extreme Programming
  • Cyclomatic Complexity
  • Equivalence Partitioning
  • Error Guessing
  • Boundary Value Analysis
  • Traceability Matrix
  •  
    SDLC Models
     
  • Introduction
  • Waterfall Model
  • Iterative Model
  • V-Model
  • Spiral Model
  • Big Bang Model
  • RAD Model
  • Prototyping Model
  •  
    Software Testing Types
     
  • Static Testing
  • Dynamic Testing
  • Blackbox Testing
  • Whitebox Testing
  • Unit Testing
  • Requirements Testing
  • Regression Testing
  • Error Handling Testing
  • Manual support Testing
  • Intersystem Testing
  • Control Testing
  • Parallel Testing
  • Volume Testing
  • Stress Testing
  • Performance Testing
  • Agile Testing
  • Localization Testing
  • Globalization Testing
  • Internationalization Testing
  •  
    Test Plan
     
  • Introduction
  • Test Plan Development
  • Test Plan Template
  • Regional Differences
  • Criticism
  • Hardware Development
  • IEEE 829-1998
  • Testing Without a TestPlan
  •  
    Code Coverage
     
  • Introduction
  • Measures
  • Working
  • Statement Coverage
  • Branch Coverage
  • Path Coverage
  • Coverage criteria
  • Code coverage in practice
  • Tools
  • Features
  •  
    Quality Management
     
  • Introduction
  • Components
  • Capability Maturity Model
  • CMMI
  • Six Sigma
  •  
    Project Management
     
  • Introduction
  • PM Activities
  • Project Control Variables
  • PM Methodology
  • PM Phases
  • PM Templates
  • Agile PM
  •  
    Automated Testing Tools
     
  • Quick Test Professional
  • WinRunner
  • LoadRunner
  • Test Director
  • Silk Test
  • Test Partner
  • Rational Robot
  •  
    Performance Testing Tools
     
  • Apache JMeter
  • Rational Performance Tester
  • LoadRunner
  • NeoLoad
  • WAPT
  • WebLOAD
  • Loadster
  • OpenSTA
  • LoadUI
  • Appvance
  • Loadstorm
  • LoadImpact
  • QEngine
  • Httperf
  • CloudTest
  •  
    Languages
     
  • Perl Testing
  • Python Testing
  • JUnit Testing
  • Unix Shell Scripting
  •  
    Automation Framework
     
  • Introduction
  • Keyword-driven Testing
  • Data-driven Testing
  •  
    Configuration Management
     
  • History
  • What is CM?
  • Meaning of CM
  • Graphically Representation
  • Traditional CM
  • CM Activities
  • Tools
  •  
    Articles
     
  • What Is Software Testing?
  • Effective Defect Reports
  • Software Security
  • Tracking Defects
  • Bug Report
  • Web Testing
  • Exploratory Testing
  • Good Test Case
  • Write a Test
  • Code Coverage
  • WinRunner vs. QuickTest
  • Web Testing Tools
  • Automated Testing
  • Testing Estimation Process
  • Quality Assurance
  • The Interview Guide
  • Upgrade Path Testing
  • Priority and Severity of Bug
  • Three Questions About Bug
  •    
     
    Home » Testing Articles » Manual Testing Articles » Unit Testing in a Managed Environment

    Unit Testing in a Managed Environment

    A D V E R T I S E M E N T


    You're ready to start unit-testing in a more managed, process-oriented way. How do you do it? Let's say, for example, you have Microsoft Team System in place, and you use it for source control and tracking work items. Obviously, you can do much more with Team System, but let's start with the basics. You've tasted enough unit-testing to feel that everyone can benefit from them. Where would you start?

    Here are my thoughts. This is what I would consider the essential setup to start with:


    1. Check in whatever tests you already have, and start checking in any new test code. You don't want to lose what you already have. Even if you don't have a continuous integration system in place (see the next step), you can run the tests manually on your (or any) machine anytime.

     

    2. Use a continuous build system. In Team System it's Team Build, or you can use CruiseControl.Net, TeamCity or any other tool. Whenever someone checks in code, the build starts automatically and reports success/failure. Without running the tests, it would just give a compilation status report, which is a good starting point. The entire build process, from beginning to end should be automatic, and should not have anyone intervening, or fixing just one thing to work. Think of it as a pulse of the project. If the build fails, fix it pronto. Don't let the poor team lose it's pulse.

     

    3. Add to the build script (or integration script) running of tests. Any automated test should run within the build cycle. The build report should report the results of the tests.

     

    4. Make a habit of looking at the test report. If the build fails because of test failure, consider it good feedback. It motivates you to do something - fix the test, change it, delete it, or even ignore it or leave it there. You need to be aware of the test results. From there you can improve.

     

    Once you have this setup, you can now start improving other stuff, like say, prioritizing or tracking your progress. In the next posts, I'll discuss what to track, and how to manage your unit-tests within a process.

     

    Most teams vary in their composition. You won't get a team comprised of top-performers most of time. Depending on the size of team you'll have a few technical leaders, and average developers. If you have less than average developers, get rid of them, they will just slow you down.

     

    I'll assume that management wants the process to work. It may not always be the case. In this case, no one blocks the team, and they are given enough time to learn, adjust and refactor their code. If they are lucky, they can get more tools to help them.

     

    The first practice needed in place is code review, and if you can manage it, employ its bigger and better sibling, pair programming.  The best way for people to learn is to discuss what their code does. And if you get an experienced developer with a less experienced one, it becomes as guidance for the latter.

     

    Reviewing tests is an excellent way to make sure the code is tested correctly. Now, if you review the tests, that means you have tests to review, which means you're implementing the process. If there are no tests stop and write them. Experienced developers can tell if the tests are testing too much, if they are too long, and if they make sense at all. And through the code review process, this experience is passed to the less experienced.

     

    Now let's talk conventions. Does the left brace is above the right brace? It is? Really? Well, you've just lost 5 seconds of precious development-time checking that. The team should agree on the conventions that work for them and stick to that. But more important, agree on what's important and helps the development effort. Like, um.. READABILITY.

     

    Tests should be readable. Let's start with naming: What do we test? What's the scenario and what's the expected result? The test name should say that. When it does, you can look at the test code and corroborate that it actually does it. If not, maybe it's a sign you need another test. Or maybe you should rewrite the test completely.

     

    How long is the test in lines of code? Three screens long? Too long. Scrolling up and down does not help readability. Are you testing too much? Separate the tests. Are you setting up too much? Time to learn about testing in isolation. Is it really an integration test? Move it to the integration test suite.

     

    Is your test brittle? Does it know too much about the production code it's testing?  Time to rethink. Are we drawing the isolation line in the correct place? Does it mimic the production code, line by line? That's a no-no. You're not testing what you think is testing. Isolate.

     

    Code review is the second best effective practice I know for unit testing implementation. The best is Pair programming. It instills the conventions inside the production code as you go, which is more effective than intermittent code review. So go for it if you can. We do.



    More Manual Testing Articles
    1 2 3 4 5 6 7 8 9 10 11 Next



    discussionDiscussion Center
    Discuss
    Discuss

    Query

    Feedback
    Yahoo Groups
    Y! Group
    Sirfdosti Groups
    Sirfdosti
    Contact Us
    Contact

    Looking for Software Testing eBooks and Interview Questions? Join now and get it FREE!
     
    A D V E R T I S E M E N T
       
       

    Members Login


    Email ID:
    Password:


    Forgot Password
    New User
       
       
    Testing Interview Questions
  • General Testing
  • Automation Testing
  • Manual Testing
  • Software Development Life Cycle
  • Software Testing Life Cycle
  • Testing Models
  • Automated Testing Tools
  • Silk Test
  • Win Runner
  •    
       
    Testing Highlights

  • Software Testing Ebooks
  • Testing Jobs
  • Testing Frequently Asked Questions
  • Testing News
  • Testing Interview Questions
  • Testing Jobs
  • Testing Companies
  • Testing Job Consultants
  • ISTQB Certification Questions
  •    
       
    Interview Questions

  • WinRunner
  • LoadRunner
  • SilkTest
  • TestDirector
  • General Testing Questions
  •    
       
    Resources

  • Testing Forum
  • Downloads
  • E-Books
  • Testing Jobs
  • Testing Interview Questions
  • Testing Tools Questions
  • Testing Jobs
  • A-Z Knowledge
  •    
    Planning
    for
    Study ABROAD ?


    Study Abroad


    Vyom Network : Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | Free eBooks | Job Interview Questions | Free Tutorials | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Bangalore Info | GATE Preparation | MBA Preparation | Free SAP Training
    Privacy Policy | Terms and Conditions
    Sitemap | Sitemap (XML)
    Job Interview Questions | Placement Papers | SMS Jokes | C++ Interview Questions | C Interview Questions | Web Hosting
    German | French | Portugese | Italian