XP2002 HomePage
XP2003 Main
Call for Submissions
Program
Detailed Program
Educational Symposium
PhD Symposium
News
Location
Registration
Organization
Links
Hot Spots
Companion's Program
Sponsors
Our Proud Sponsors
Accommodation
Accepted Papers

 

back to the program

Advanced Unit Testing Techniques in .Net
(28TH May, 17:30 - 21:30)

Presenter

Summary

Development of a good set of unit-tests is a fundamental building block of XP practice. Most developers rapidly become "test infected" and learn to love the rapid cycle of development from red to green in testing their code.

But certain areas have a reputation of being quite difficult to test. This includes user interface code, distributed applications and multi-threaded applications with concurrency issues.

This tutorial will begin with a review of the principles of unit-testing and test-first development but will go beyond the basics to show how to deal with some of these difficult areas. We'll do this in the environment of the .Net platform using the NUnit open-source testing framework, but the approaches used will be applicable to other environments and languages.

The tutorial will include lecture-style presentation and hands on exercises. Those participants wishing to work through the examples using their laptops will receive advance instructions regarding the software that they need to install. All the software used in the tutorial is freely available.

Duration (three hours, half day), aims and audience

Review the practice of test-first development and unit-testing in XP using examples running under the NUnit framework. Learn to improve the design of a piece of software while at the same time making it more easily testable. Learn to apply patterns that are useful in testing specific types of applications, including graphical user interfaces, distributed applications and multi-threaded programs.

Programmers experienced in developing and running unit tests in one of the xUnit environments who want to advance their skill in developing testable applications in one or more "problem areas" of testing. Programmers who have used other test framworks and want to transfer their skills to the .Net environment and learn to use NUnit well. A knowledge of the .Net framework and the C# language will be helpful. However, experienced Java or C++ developers should be able to follow the examples without difficulty.

Outline 

Topics covered will include:

  • A brief review of unit testing practices and test-first development, and of the facilities of the NUnit testing framework, to get us all on the same page.
  • A series of motivating examples showing key areas that seem to resist the "normal" approach to unit testing.
  • General enabling techniques for difficult test situations:
    • Use of interfaces.
    • Inheriting from the class under test.
    • Using mock objects.
  • Testing user interface code:
    • Designing for testability: two principles for good UI separation.
    • Defining what needs to be tested at the unit level.
    • Testing events and event handling.
  • Testing multi-threaded code.
  • Remoting and timing problems.
  • Cross-language and unmanaged code testing.

Presenter resume 

Charlie Poole has worked in the software development field for over 25 years, first in the IT department of a government agency and subsequently as an independent developer, coach and consultant. Charlie is a veteran C++ developer with a background in the Windows SDK and COM. He has been working with the .Net framework and C# language since the early beta releases and is one of the developers of the NUnit open-source testing framework for .Net. He is the president of the Seattle XP Users Group and is active in promoting XP in the Northwest.

Contact information 

Charlie Poole

www.pooleconsulting.com
www.charliepoole.org

back to the program