Almost Done

One last thing we will do here is clean up some of the dependencies we have introduced. Our package structure has emerged as we were building up the Web service and integrating it with the data access. We have enough code written now to help us see the dependencies between the modules. We will be moving the classes around between assemblies and namespaces to better reflect the emerged architecture. This is an important step of the test-driven development process; we are in fact exposing our architecture by clarifying the packaging boundaries.

We want to be able to distribute our production code without our test code, which necessitates the separation of the service interface tests into a separate assembly just as we did in the previous chapter with the data access tests. The second restructuring we want to do is move the definition of the typed DataSet , RecordingDataSet into a separate assembly and into a separate namespace: DataModel .

Figure 6-2 represents the emerged architectural packages.

click to expand
Figure 6-2: Package structure

The Bad News

Unfortunately, manual refactoring of the code of this scope is quite difficult and can be time-consuming ; however, it is no less important. Of course, the tests give us the confidence that after the refactoring everything still works, but the process of moving classes between namespaces and assemblies is not as simple as it could have been if there were tools that better supported such activity. The process is not complicated ”in fact, it is very mechanical and repeatable; but when we have many classes to move around, it quickly becomes annoying. The build process and the source control system also lag in support of such activity. This is not some fundamental limitation of the approach; it is the lack of adequate tool support that makes it harder.

Test-Driven Development in Microsoft .NET
Test-Driven Development in Microsoft .NET (Microsoft Professional)
ISBN: 0735619484
EAN: 2147483647
Year: 2004
Pages: 85

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: