Silverlight 2 includes a testing framework for unit testing Silverlight applications in the browser. The framework allows automated testing of both non-UI and UI logic. Tests are written using the Silverlight Testing Framework which is included with Silverlight controls. Writing tests involves adding references, deriving from the SilverlightTest class, and adding controls to the testing surface to assert properties. Patterns like MVP can also help separate concerns to facilitate testing. The framework is still in beta with Silverlight 2 but may include future improvements like UI automation APIs.