.NET ... Like TDD with Flat Files

I have a project in which most of the problems are to ensure that the software functions correctly using flat text files output by several external systems.

Mangement decided to introduce Agile and TDD as a concrete implementation.

I found that mocking input from flat files does not make sense, because the main problem to solve is to work precisely with these specific files.

eg. if the output on external systems changes, the unit test will fail.

The module-testing of code abstracted from files makes little sense and creates very little value for business (since abstracted code will take a long time to abstract it, but in reality a hundred methods from one line will be released).

I just want to repeat - the task is to keep a tight tab in that the software can work with flat files, and TDD - to make it verifiable at any time.

What will be the suggestions? How can this be organized, defined, implemented?

+3
source share
4 answers

Is there a flat file format specification?

, , , .

, TDD - . ( /) TDD. , .

? , .

+2

. Assembly.GetManifestResourceStream, . Stream TextReader API , MemoryStream StringReader . ( , TextReader, , , Stream.)

StringReader, , , - .

, , - , /. , . , , , .

, , : , , unit test , , "", , . , , - .

+6

: , , / . ? , ( )?

, , , , . , , , .

+4

From a .NET perspective, a flat file is essentially strings , so I would develop most of my API to test input and output strings.

If these lines become too large, you can insert them into separate files, but it is always better to conduct testing to reduce each test case to the minimum necessary to play / execute a certain function.

+1
source

Source: https://habr.com/ru/post/1755479/


All Articles