What the study found
The study presents FLAT, which treats formal languages as types so that different kinds of strings, such as URLs and email addresses, can be distinguished in code. It also presents FLAT-PY, a Python testing framework that uses annotations and runtime checking to report detected type errors early.
Why the authors say this matters
The authors say mainstream languages often treat many different string-based data types as the same string type, which can allow misuse such as passing malicious HTML text where an email address is expected. They suggest that using formal languages as types can help avoid potential vulnerabilities and can unify string API documentation, input validation, malicious input detection, language-based fuzzing, and test oracles.
What the researchers tested
The researchers implemented their idea in FLAT-PY, a framework for Python. They attached annotations directly to Python code and used code instrumentation to perform runtime type checking, then conducted case studies on real Python code fragments.
What worked and what didn't
The abstract says FLAT-PY can detect logical bugs from random inputs generated by a language-based fuzzer. It also says this was done while relying on a reasonable number of user annotations. No specific failures or quantitative comparisons are described in the abstract.
What to keep in mind
The available summary does not provide details about the size of the case studies, the exact number of annotations required, or performance measures. It also does not describe limitations beyond noting that semantic constraints may be needed in addition to context-free grammars.
Key points
- FLAT treats formal languages as types to distinguish different string-based data types.
- The approach uses context-free grammars and, when needed, semantic constraints to restrict valid strings.
- FLAT-PY adds annotations to Python code and performs runtime type checking through code instrumentation.
- The abstract says FLAT-PY can detect logical bugs from random inputs produced by a language-based fuzzer.
- The paper claims this approach can support documentation, validation, malicious input detection, fuzzing, and test oracles.
Disclosure
- Research title:
- Formal language types help detect string-related errors
- Authors:
- Fengmin Zhu, Andreas Zeller
- Institutions:
- Helmholtz Center for Information Security, Helmholtz Center for Information Security
- Publication date:
- 2026-03-07
- DOI:
- 10.1145/3799978
- OpenAlex record:
- View
Get the weekly research newsletter
Stay current with scholarly research without reading academic papers — one filtered digest, every Friday.