Flylib.com

Books Software

 
 
 

The First Feature


The First Feature

The first and highest priority feature that we need to implement involves accessing our database from anywhere on the Internet. As stated previously, we do not specify directly which platforms our customers use, so whatever access mechanism we come up with must be interoperable with their systems. To this end, we plan to use an ASP.NET Web service to retrieve recording information from our database.

The different aspects of the Web service implementation are detailed in Chapters 5, 6, and 7. Chapter 5, Programmer Tests: Using TDD with ADO.NET focuses on the implementation of a Data Access Layer using ADO.NET within the context of the solution. Chapter 6, Programmer Tests: Using TDD with ASP.NET Web Services, describes the Web service portions of the feature. Finally, Chapter 7, Customer Tests: Completing the First Feature, focuses on tests written by the customer using an open source testing tool called FIT ( http:/ /fit.c2.com ). These tests are used to verify that the story is implemented correctly from the customer s perspective.

We really did not implement the feature in the order that is documented in the chapters. We started out on the client, and we eventually accessed the database and returned values one test at a time. However, the number of steps and the amount of detail that needs to be shown is overwhelming (and frankly pretty boring). We know because we tried it that way first, and we fell asleep writing it. Therefore, we choose to make the chapters more topical instead of using the narrative approach. Describing the solution in this manner also allows us to show aspects of testing that might not be needed for the solution but are important things to keep in mind when writing tests.



Additional Features

Chapter 8, Driving Development with Customer Tests, introduces the ability to associate a review with an existing recording. For this feature, we need to provide some additional Web services, and we need to be able to modify the existing database. We also see how easy it is to extend the existing functionality to be able to support the new feature.

Chapter 9, Driving Development with Customer Tests: Exposing a Failure Condition, describes an unsolved issue that was not fully addressed in Chapter 8. The issue arises when a user tries to add a review to a recording that the reviewer has already reviewed. This should not be allowed by the system. In this chapter, we first specify the problem by writing new customer and programmer tests. After the tests fail, we implement a solution. This solution is relevant to the database access layer as well as the services.

Chapter 10, Programmer Tests: Using Transactions, continues the theme of the previous chapters by solving a problem that was caused by improper updates to the database, including issues with the programmer tests as well as the customer tests. The main issue is related to the program adding a Reviewer entity when a Review is created. If for some reason the Review is not added properly, we should automatically delete the Reviewer entity, so there should never be a Reviewer entity without a Review. The code that we implemented in Chapters 8 and 9 did just this. The solution that is implemented in this chapter uses the transaction support in SQL Server to remedy this problem. It also demonstrates the extensibility of the solution by allowing the relatively easy insertion of transaction support after the code has been written.

Chapter 11, Service Layer Refactoring, addresses the need to move common functions that were developed in Chapters 8 through10 into a new layer, called a Service Layer. We build this new layer as part of the last feature, which is to implement a Web client (which we focus on in Chapter 12, Implementing a Web Client ). This chapter demonstrates the evolving nature of the architecture based on new functionality. We also address dependency management, which is important when building layered software architectures.

Chapter 12 describes how to write programmer tests when implementing an ASP.NET Web client. The chapter addresses the issues associated with writing tests for user interfaces.