Best option for retrospectively applying TDD in C # codebase

I have an existing structure consisting of 5 C # libraries, the structure has been used well since 2006 and is the main code base for most of my projects. My company wants to deploy TDD due to software quality; having worked through many textbooks and reading the theory, I understand the benefits of TDD.

Time is not infinite. I need to make a plan for a pragmatic approach to this. From what I already know, the options that I see are as follows:

A) One test project can be used to overlap objects from all 5 library components. A series of high-level tests can be the starting point of what is first seen as a very large software library.

B) Test project for each of the 5 library components. Projects will test functions at the lowest level in isolation of other library components.

C) Because code is widely regarded as working, just add unit tests to bug fixes or new features. Write a test that fails in logic that has an error, with steps to reproduce the error. Then repeat the code factor until the tests pass. Now you can be sure that the error has been fixed and it will not be entered later in the loop

Whichever option you choose, "Mocking" may be required to replace external dependencies, for example:

  • Database
  • Web service
  • Configuration files

If someone has more information, this will be very helpful. I plan to use Microsoft's built-in MSTest in Visual Studio 2010.

+5
5

. , ( A). : , , , CSV . , , .

, ; , ( ), , .

, ( B). , .

, . , ( C). , , , , .

, , , . , ; , .

+6

(A), (B) TDD. ; . , , TDD. ", , , ", , (B), . .

, (B), , ( , ). , . 5 , . , . ; , , , , . . , , ( , ).

, , , . !

+5

, , TDD.

C) : , , , "" .

. - "": , , ? ) , , ) , , , ( , ).

, Pex Code Contracts, , , , .

+3

C. , , . , , , , , .

, , , .

0

A B TDD . C, .

0

All Articles