Subscribe by Email

Tuesday, April 17, 2012

Explain the concepts of syntax test technique?

Very few people are familiar with the term syntax test technique. We shall discuss about this testing technique but after a brief discussion about the syntax of the programming languages.

Every real world language in this world has got certain rules following which the meaningful statements and sentences can be drafted from the raw words. These rules are collectively known as the syntax of the language. Similarly syntax also exists for the computer programming languages.

About Syntax and Syntax Test Technique

- Each programming language has got its own unique syntax.

- The syntax is known to define the surface of a language.

- Type of syntax of a language depends on the type of the programming i.e., whether it is a text based language or a visual based language.

- Syntax forms a part of the semantics.

- The syntax test technique involves the process of parsing i.e., the linear sequence of the tokens is transformed in to a hierarchical syntax tree.

- Parsing is also an effort and time consuming process but, nowadays several automated tools are available for this purpose also and are quite effective in generating parses.

- These parses are generated using the language grammar specifications as stated in the Backus- Naur form.

- Backus- Naur forms as well as regular expressions of the lexicon together comprise the syntax of the textual programming languages.

- There are other rules called productions which are used to classify the syntax in to different categories.

- The syntax just describes whether or not the program is valid.

- It is the semantics which describe the meaning of the program.

- It is not necessary that a syntactically correct code of the program should be semantically correct also.

Steps of Syntax Test Technique

A typical syntax testing technique consists of the following steps:

1. Identification of the format of the target language.

2. Definition of the syntax of the target language in to formal notation like Backus- Naur form.

3. Testing the syntax under normal conditions by keeping the Backus- Naur form of the language under adequate coverage. This is the minimal requirement for carrying out a syntax test.

4. Testing of the garbage conditions i.e., testing the software system against the invalid input test data. This condition has a high pay off and automation is highly recommended.

5. Debugging of the whole software program.

6. Automation of the test execution process. This is necessary since a lot of test cases are required for the effective syntax testing.

7. For carrying out the whole process, 3 most frequent wrong actions have been identified as shown below:

(a) The recognizer could not identify the string which was good.
(b) The recognizer accepted a bed string.
(c) The recognizer crashed or hanged during the process of the recognition of the good and bad strings.
(d) Any incorrectness in the Backus- Naur specifications can spoil a good string and turn it in to a bad one.

8. There should be a proper testing strategy since all the strings cannot be tested.

9. Only one error should be generated and tested each time.

10. First, all the single errors should be tested using specifically created test cases, then the double errors and lastly the triple errors are tested.

11. Your focus should be on one level at a time.

Dangers related to Syntax Testing

Certain dangers have also been identified related to the syntax testing:

(a) It is quite common for the testers to forget the normal cases.

(b) While testing, testers often go overboard with the testing combinations.

(c) Syntax testing is often taken very lightly since it is pretty easy when compared to the structural testing.

(d) A lack of knowledge about the program can make you to execute many test cases. So its better to have a thorough study of the program before you test it.

No comments:

Facebook activity