File Processing Testing
I git a question regarding file processing testing.
I have a application where when we drop a text file to certain SFTP location, application should picks up the file and then produce another text file with different data structure. In the input file we have about 20 fields with certain length. I have the file specification with all the rules.
So I've got few concerns;
1. What sort of test techniques should we apply here.
2. Are we to validate each and every field with negative cases. Because in case of negative cases we need to consider format, length, datatype (for e.g. numeric leading zeros with right align, strings padded with space left align ). So if we consider this we have to test quite lot of scenarios depend on the number of fields.
3. Is there a way to reduce negative number of test cases or Is it a risk?
Appreciate your comments
Most of those risk and qualitative targets I can't really give you much guidance on, they're specific to your situation.
What i can give you guidance on is how you can go about automating the verification.
- To validate value exists, common way is to use simple regular expressions. If you want to validate a unique value appears somewhere under some value, you can 98% of the time accomplish that using a regular expression. Regular expressions and regular expression groups is one of the most common way to handle value validation. Match.Groups Property (System.Text.RegularExpressions) Validations using regex generally follow the form of (in xml) search for /.*<SomeLabel[^>]*propname=\"expectedvalue\"[^>]*>/, basically validating using wildcards excluding the closing statement character.
- A common way of validating formatting is using a Lexer, Lexical analysis - Wikipedia, the free encyclopedia , Using a Lexer, you can validate rules like is your parenthesis balanced, or does your open xml tag have a closing xml tag. There are many lexers out there for different languages, use one that fits you best. 2 Famous ones I know of are Lex and Yacc. Usually you can google up stuff like, "What is the Java equivalent of Lex and Yacc, and you'll probaby find something.