ArticleslgStudy

science

Syntactic methods

Syntactic methods is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Syntactic methods rather than just read about it. In short: In software engineering, syntactic methods are techniques for developing correct software programs. The techniques attempt to detect, and thus prevent, certain kinds of defects (bugs) by examining the structure of the code being produced at its syntactic rather than semantic level.

Key takeaways

  • Syntactic methods belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Syntactic methods to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Syntactic methods from memory before moving on to harder problems.

Reference excerpt

In software engineering, syntactic methods are techniques for developing correct software programs. The techniques attempt to detect, and thus prevent, certain kinds of defects (bugs) by examining the structure of the code being produced at its syntactic rather than semantic level.

Usage Syntactic methods are often used when formal methods are not an option, and are often a simpler and, more importantly, cheaper alternative. In non-mission-critical systems, formal methods may prove to be too expensive for the benefit they provide. The costs of modelling, personnel, execution and development may often outweigh the benefits gained by preventing possible failures. This approach revolves around the use of an abstract dependency graph which is created from the system in question. An abstract dependency graph is a directed graph, a graph of vertices connected by one-way edges. Most often, the vertices and edges of the graph represent the inputs and outputs of functions in or components of the system. By inspecting the created abstract dependency graph, the developer can detect syntactic anomalies (or Preece anomalies) in the system. While anomalies are not always defects, they often provide clues to finding defects in a system. Therefore, the anomalies in a system help point the developer in the right direction in finding defects.

Anomalies There are four main types of anomaly:

Redundancies – A chunk of the graph is redundant if its terminals can be reached if the chunk is removed from the graph Conflicts – A system contains conflicts if the same inputs can imply different outputs Circularities – A loop in the graph indicates a circularity in the system Deficiencies – A chunk is deficient if a subset of inputs leads to no terminals While anomalies often point to defects, they can just as easily reflect normal intended functionality in the system. It is up to the developer to look into anomalies in order to determine whether they are clues to problems or simply false alarms. By creating a visual directed graph of a system, there are several obvious visual flags that indicate the above anomalies:

a sub-graph with no input is probably missing something important; while looking at the transitive closure of a system (all nodes downstream from a node), a node in its own transitive closure indicates a circularity; while looking at the transitive closure of a system, subsumption between pairs of rows indicates redundancy; conflicts are somewhat more difficult as they become more semantic than syntactic. When formal methods prove too costly, a system can be checked solely on its syntax. This is not as thorough, as it only looks at a system on a surface level. However, it does give a developer many clues as to where a system's defects may lie.

General references "Syntactic theory of software architecture." Dean, Thomas R., Cordy, James R. IEEE Transactions on Software Engineering 21 (4), pp. 302–313 (1995) "Syntactic type abstraction" Grossman, D., Morrisett, G., Zdancewic, S. ACM Transactions on Programming Languages and Systems 22 (6), pp. 1037–1080 "A new algorithm for slicing unstructured programs." Harman, M., Danicic, S. Journal of Software Maintenance and Evolution 10 (6), pp. 415–441 "Reverse engineering of embedded software using syntactic pattern recognition" Fournigault, M., Liardet, P.-Y., Teglia, Y. Trémeau, A. Robert-Inacio, F.Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) Volume 4277 LNCS - I, 2006, Pages 527–536. (2006)

External links "Project: Algebraic and Syntactic Methods in Computer Science (ASMICS 2)" Université Paris 7, Laboratoire Informatique Théorique et Programmation (working group) "Syntactic Methods in Computer Graphics" by Pavel Slavik

Worked examples

Example 1 — a first encounter with Syntactic methods

Start with the simplest possible case. Write down what Syntactic methods claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Syntactic methods before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Syntactic methods ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Syntactic methods

In research
Syntactic methods appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Syntactic methods in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Syntactic methods is common in secondary-school and first-year university syllabi. It links to neighbouring topics Formal methods, so understanding it makes those chapters shorter.
In everyday life
Look for Syntactic methods outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Syntactic methods in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Syntactic methods means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Syntactic methods out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Syntactic methods in simple terms?

In software engineering, syntactic methods are techniques for developing correct software programs. The techniques attempt to detect, and thus prevent, certain kinds of defects (bugs) by examining the structure of the code being produced at its syntactic rather than semantic level.

Why does Syntactic methods matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Syntactic methods?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Syntactic methods.

Tags

  • Formal methods

Keep exploring